Centos - Install postfix with SMTP auth

Quags

Administrator
Staff member
This is for setting up a mailserver on centos with SMTP auth, but does not over pop or imap.

Step 1: yum
yum install postfix cyrus-sasl-plain nano

Step 2: main.cf
nano /etc/postfix/main.cf

Add the following lines

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_sasl_password_maps = hash:/etc/sasldb2

step 3: create smtpd.conf

64 bit
nano /usr/lib64/sasl2/smtpd.conf

32 bit
/usr/lib/sasl2/smtpd.conf

add
mech_list: plain login

step 4: start at boot

/sbin/chkconfig saslauthd on
/sbin/chkconfig postfix on

step 5: restart
service saslauthd restart
service postfix restart

Step 6: create login / pass
saslpasswd2 -c -u server.hostname.com username
chown postfix:postfix /etc/sasldb2


Thats all.
 
Top