Postfix with PAM authorization

Debian packages installation:

apt-get install postfix-tls sasl2-bin libsasl2-modules cyrus21-common

/etc/postfix/main.cf should contain:

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

append_dot_mydomain = no

myhostname = mail.matus.in
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.matus.in, localhost, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Autorizacia
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_path = smtpd
smtp_sasl_type = cyrus

# M$ Support
broken_sasl_auth_clients = yes

# Neposielat loginy ludi, ktori posielaju maily cez tento server
smtpd_sasl_authenticated_header = no

/etc/postfix/sasl/smtpd.conf should contain:

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
saslauthd_path: /var/run/saslauthd/mux

/etc/default/saslauthd should contain:

START=yes
MECHANISMS="pam"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

In /etc/group add user postfix to group sasl. So it should containt something like this:

sasl:x:45:cyrus,postfix

Create some needed directories:

cd /var/spool/postfix/
mkdir var var/run var/run/saslauthd
chmod 755 var/ var/run/
chmod 710 var/run/saslauthd/

Restart saslauthd and postfix:

/etc/init.d/saslauthd restart
/etc/init.d/postfix restart

Create mail users

adduser ...
 
postfix.txt · Last modified: 31.03.2010 17:51 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki