Talk:Complete Virtual Mail Server/SMTP Authentication

Todo
Several things that can be concidered todo for this section. A section to add postgres authentication directly cyrus-sasl, dovecot-sasl, which can be extra interesting when dovecot imap is used instead of cyrus sasl.

Postfix 2.10
Since postfix 2.10 (http://www.postfix.org/announcements/postfix-2.10.0.html), the smtpd_relay_restrictions and the smtpd_recipient_restrictions have been separated. the config should be something like that:


 * smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
 * smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks

I got errors with the above. a better relay_restrictions is : disable_vrfy_command = yes smtpd_delay_reject = yes smtpd_helo_required = yes smtpd_helo_restrictions = permit_sasl_authenticated permit_mynetworks, check_client_access hash:/usr/local/etc/postfix/broken_helo_clients, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname, reject_invalid_helo_hostname

smtpd_client_restrictions = permit_sasl_authenticated permit_mynetworks, check_client_access hash:/usr/local/etc/postfix/broken_helo_clients, reject_unknown_client_hostname

smtpd_sender_restrictions = permit_sasl_authenticated reject_non_fqdn_sender, reject_unknown_sender_domain

smtpd_relay_restrictions = permit_sasl_authenticated permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks, permit_sasl_authenticated

smtpd_data_restrictions = reject_unauth_pipelining

Using PAM pgsql
I had difficulties authenticating smtp connections using this setup.

From: Postfix SASL Howto :
 * The sql auxprop plugin is a generic SQL plugin. It provides access to credentials stored in a MySQL, PostgreSQL or SQLite database. This plugin requires that SASL client passwords are stored as plaintext.
 * If you must store encrypted passwords, you cannot use the sql auxprop plugin. Instead, see section "Using saslauthd with PAM", and configure PAM to look up the encrypted passwords with, for example, the pam_mysql module. You will not be able to use any of the methods that require access to plaintext passwords, such as the shared-secret methods CRAM-MD5 and DIGEST-MD5.

To get the pam_pgsql setup working the following is required:

Lemmerk (talk) 08:30, 13 February 2014 (UTC)