Postfix inside a jail

Vaaf vaaf at broadpark.no
Mon Mar 27 19:55:18 UTC 2006


Hello!

I'm trying to get FreeBSD 4.11-RELEASE, postfix-2.1.6,1 and 
mysql-5.0.16 working.

Even though the setup seems flawless, it won't work.

/var/log/maillog is empty. The maillog.N files are all 122 bytes. So 
nothing there.
Syslog is running, and it is configured to log to maillog.

This is what I did:

------- MySQL

CREATE DATABASE IF NOT EXISTS mail;
GRANT ALL ON mail.* TO mail at localhost IDENTIFIED BY 'lalalas_password';

USE mail;
CREATE TABLE IF NOT EXISTS alias (
   address varchar(255) NOT NULL default '',
   goto text NOT NULL,
   domain varchar(255) NOT NULL default '',
   created datetime NOT NULL default '0000-00-00 00:00:00',
   modified datetime NOT NULL default '0000-00-00 00:00:00',
   active tinyint(1) NOT NULL default '1',
   PRIMARY KEY (address),
   KEY address (address)
) TYPE=MyISAM COMMENT='Aliases';

USE mail;
CREATE TABLE IF NOT EXISTS domain (
   domain varchar(255) NOT NULL default '',
   description varchar(255) NOT NULL default '',
   aliases int(10) NOT NULL default '0',
   mailboxes int(10) NOT NULL default '0',
   maxquota int(10) NOT NULL default '0',
   transport varchar(255) default NULL,
   backupmx tinyint(1) NOT NULL default '0',
   created datetime NOT NULL default '0000-00-00 00:00:00',
   modified datetime NOT NULL default '0000-00-00 00:00:00',
   active tinyint(1) NOT NULL default '1',
   PRIMARY KEY (domain),
   KEY domain (domain)
) TYPE=MyISAM COMMENT='Domains';

USE mail;
CREATE TABLE IF NOT EXISTS mailbox (
   username varchar(255) NOT NULL default '',
   password varchar(255) NOT NULL default '',
   name varchar(255) NOT NULL default '',
   maildir varchar(255) NOT NULL default '',
   quota int(10) NOT NULL default '0',
   domain varchar(255) NOT NULL default '',
   created datetime NOT NULL default '0000-00-00 00:00:00',
   modified datetime NOT NULL default '0000-00-00 00:00:00',
   active tinyint(1) NOT NULL default '1',
   PRIMARY KEY (username),
   KEY username (username)
) TYPE=MyISAM COMMENT='Mailboxes';

USE mail;
INSERT INTO domain (domain) VALUES ('lalaladomain.com');
INSERT INTO alias (address, goto) VALUES ('info at lalaladomain.com', 
'lalala at gmail.com');

------- main.cf

mail_owner = postfix
home_mailbox = .maildir/

queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
mailbox_command = /usr/local/bin/procmail

mydomain = lalaladomain.com
myhostname = fosho.lalaladomain.com
mynetworks = 213.21.123.0/24, 127.0.0.0/8

myorigin = $mydomain
mydestination = $mydomain, localhost.$mydomain, $myhostname

debug_peer_level = 2
debugger_command =
         PATH=/usr/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = no
html_directory = no

# mkdir /var/spool/virtual
# chown -R postfix:postfix /var/spool/virtual
# chmod -R 771 /var/spool/virtual

virtual_transport = virtual
virtual_uid_maps = static:125
virtual_gid_maps = static:125
virtual_mailbox_base = /var/spool/virtual
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/v_domain.cf
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/v_mailbox.cf
virtual_alias_maps = mysql:/usr/local/etc/postfix/v_alias.cf

broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd

# openssl req -new -x509 -nodes -out smtpd.pem -keyout smtpd.pem -days 3650

smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /usr/local/etc/postfix/ssl/smtpd.pem
smtpd_tls_cert_file = /usr/local/etc/postfix/ssl/smtpd.pem
smtpd_tls_CAfile = /usr/local/etc/postfix/ssl/smtpd.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

unknown_local_recipient_reject_code = 450

------- v_alias.cf

user = postfix
password = lalalas_password
dbname = mail
table = alias
select_field = goto
where_field = address

------- rc.conf

sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"

However, mails to info at lalaladomain.com doesn't arrive at lalala at gmail.com.
I've used this setup on other boxes where they've worked just fine.

Any idea?

Thanks,
Vaaf



More information about the freebsd-questions mailing list