<<TableOfContents>>


= Mailversand mit smtp-auth =

Für die Authentifizierung empfiehlt es sich [[TLS]] zu aktivieren, womit eine Verschlüsselung der Authentifizierung bewirkt wird.

 * [[Debian]]: Pakete `postfix-tls libsasl-modules-plain sasl-bin libsasl-digestmd5-plain` installieren.
 * [[SuSE]]: 7.3: im normalen Postfix-Paket ist [[TLS]] bereits vorhanden
 * ArkLinux: im normalen Postfix-Paket ist [[TLS]] bereits vorhanden
 * RedHat: im normalen Postfix-Paket ist [[TLS]] bereits vorhanden

/etc/postfix/main.cf:
{{{
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/saslpasswd

relayhost = auth.smtp.kundenserver.de
# relayhost = [smtp.1und1.com]
# relayhost = [smtp.example.org]:587
}}}

/etc/postfix/saslpasswd:
{{{
# after changes: postmap /etc/postfix/saslpasswd
#mailserver                       user:password
auth.smtp.kundenserver.de         m319533-11:geheeim
}}}

Anmerkung: den Hostnamen links sowohl mit als auch ohne Port / ohne [] probieren, die Doku und die Realität widersprechen sich hier wohl. :(

Danach: `/etc/init.d/postfix reload`

[2007-04-16] Ergaenzung fuer postfix 2.3.x und Mehrbenutzerbetrieb mit dem t-online "E-Mail-Basispaket":
/etc/postfix/main.cf:
{{{
smtp_sender_dependent_authentication = yes 
relayhost = [smtpmail.t-online.de]
}}}

Abweichend vom oben benannten Dateiformat gilt fuer /etc/postfix/saslpasswd folgendes Format:
{{{
user_1@t-online.de             user_1@t-online.de:password_user_1
...
user_n@t-online.de             user_n@t-online.de:password_user_n
}}}
Im t-online-"Kundencenter" sind fuer jede mailbox eigene Passwoerter zu vergeben und die
automatische Authentifizierung muss abgeschaltet sein.
Mit diesen Einstellungen bleibt dem FROM-header eine Manipulation durch smptmail.t-online.de erspart.
Im "E-Mail-Basispaket erlaubt t-online als Authentifizierung nur LOGIN und PLAIN, so dass die o.g.
Pakete nicht erforderlich sind.

Wem das zu kurz war, siehe auch: [[http://www.tuxhausen.de/postfix_smtp_auth.html|Tuxhausen Postfix SMTP-Auth]]

Wenn man beim Verschicken eine Fehlermeldung "no worthy mechs" bekommt: `apt-get install libsasl2-modules`
= Mailannahme per smtp-auth und SPAM-Schutz =

Für `mysasldomain` sucht man sich was hübsches raus, z.B. Firmenname (einfacher String, nur a-z).

/!\ Die SPAM-Schutz-Einstellungen sind ungetestet und daher auskommentiert - ggf. ne extra Sektion dafür aufmachen und das hier als Minimalbeispiel smtpd-auth lassen.

{{{
# sasl (password authentication)
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
# noplaintext <- does not work with outlook 2000
smtpd_sasl_local_domain = mysasldomain

#only for broken clients like outlook express 4 and exchange
##broken_sasl_auth_clients = yes

disable_vrfy_command = yes
smtpd_helo_required = yes

# from unknown, accept only mail for us (or relay_domains)
# from sals authenticated users, accept all
smtpd_recipient_restrictions =
 permit_mynetworks
 permit_sasl_authenticated
 check_relay_domains
 reject

# spam-protection, but may also harm some misconfigured mail servers
#smtpd_helo_restrictions =
# permit_mynetworks
# reject_invalid_hostname
# reject_non_fqdn_hostname
# reject_unknown_hostname
# permit

# spam-protection
#smtpd_client_restrictions =
# permit_mynetworks
# warn_if_reject reject_map_rbl
 
# spam-protection
#smtpd_sender_restrictions =
# permit_mynetworks
# reject_non_fqdn_sender
# reject_unknown_sender_domain
# permit

#smtpd_etrn_restrictions =
# reject
}}}

Mailpasswort für Mailuser ändern:
{{{
#!/bin/sh
# Aufruf: mailpasswd username
saslpasswd -c -u mysasldomain -a smtp $1
}}}

Wichtig für Debianer :-)
{{{
Postfix läuft bei Debian meistens im chroot.
Die Datei /etc/sasldb muß nach /var/spool/postfix/etc/sasldb
}}}

Passwortcheck definieren
{{{
/usr/lib/sasl/smtpd.conf
pwcheck_method: sasldb
}}}
/!\ Achtung: Diese Datei existiert bei einer Neuinstallation noch nicht. Sie muß angelegt werden


Gute Adresse zum Thema http://postfix.state-of-mind.de/patrick.koetter/smtpauth/  (Stand 2004)



---


KategorieMailServer