Hallo,
ich habe mich gerade neu angemeldet, in der Hoffnung, dass mir hier jemand weiterhelfen kann.
Ich bin dabei, einen Mailserver auf einem Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-37-generic x86_64) mit Postfix und Courier aufzusetzen. Alle Anmeldungen sollen per MySQL geprüft werden. Der Empfang von Mails funktioniert tadellos, das Lesen per IMAP ebenfalls. Aber der Versand will nicht. Google hat mir schon etliche Hinweise geben wollen, aber nichts davon löst mein Problem.
In den Logs findet man folgendes:
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin Parse the username testuser@[domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin try and connect to a host
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin trying to open db 'mailserver' on host '127.0.0.1'
==> /var/log/mysql/mysql.log <==
150519 10:16:18 185 Connect mxadmin@localhost on
184 Connect mxadmin@localhost on mailserver
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: begin transaction
==> /var/log/mysql/mysql.log <==
184 Query START TRANSACTION
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin create statement from userPassword testuser [domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin doing query select password FROM users where email='testuser@[domain]';
==> /var/log/mysql/mysql.log <==
184 Query select password FROM users where email='testuser@[domain]'
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: commit transaction
==> /var/log/mysql/mysql.log <==
184 Query COMMIT
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin Parse the username testuser@[domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin try and connect to a host
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin trying to open db 'mailserver' on host '127.0.0.1'
==> /var/log/mysql/mysql.log <==
186 Connect mxadmin@localhost on mailserver
==> /var/log/auth.log <==
May 19 10:16:18 mail saslauthd[10688]: pam_unix(smtp:auth): check pass; user unknown
==> /var/log/mysql/mysql.log <==
186 Quit
184 Quit
185 Init DB mailserver
185 Query SELECT email, password, "", 5000, 5000, "/mail/virtmail", CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = 'testuser@[domain]'
==> /var/log/auth.log <==
May 19 10:16:18 mail saslauthd[10688]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
==> /var/log/mail.log <==
May 19 10:16:18 mail imapd: LOGIN, user=testuser@[domain], ip=[::ffff:192.168.20.143], port=[50399], protocol=IMAP
==> /var/log/auth.log <==
May 19 10:16:20 mail saslauthd[10688]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
May 19 10:16:20 mail saslauthd[10688]: do_auth : auth failure: ] [service=smtp] [realm=[domain]] [mech=pam] [reason=PAM auth error]
==> /var/log/mail.log <==
May 19 10:16:20 mail postfix/smtpd[11178]: warning: SASL authentication failure: Password verification failed
May 19 10:16:20 mail postfix/smtpd[11178]: warning: unknown[192.168.20.143]: SASL PLAIN authentication failed: authentication failure
May 19 10:16:22 mail postfix/smtpd[11178]: warning: unknown[192.168.20.143]: SASL LOGIN authentication failed: authentication failure
Der User "testuser@domain" existiert definitiv in der Datenbank, sonst könnte er sich nicht per IMAP seine Mails anschauen.
Wäre super, wenn mir jemand einen Tipp geben könnte.
Vielen Dank im Voraus
-Lunatic
Hier meine Konfig-Dateien:
-------------------------------------------------------
/etc/postfix/main.cf
config_directory = /etc/postfix
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
delay_warning_time = 24h
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550
unknown_local_recipient_reject_code = 550
maximal_queue_lifetime=2d
bounce_queue_lifetime=2d
queue_run_delay = 500s
minimal_backoff_time=500s
maximal_backoff_time=4000s
myhostname = [hostname]
sender_canonical_maps=hash:/etc/postfix/sender_canonical
recipient_canonical_maps=hash:/etc/postfix/recipient_canonical
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtp_sasl_auth_enable = no
myorigin = /etc/mailname
mydestination =
relayhost =
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql_relay_recipients.cf
mynetworks = 127.0.0.0/8 192.168.200.0/24
mailbox_size_limit = 0
message_size_limit = 0
virtual_mailbox_limit = 0
smtpd_recipient_limit = 5000
recipient_delimiter =
inet_interfaces = all
inet_protocols = ipv4
transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf
virtual_mailbox_base = /mail/virtmail
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unknown_sender_domain,
reject_invalid_hostname,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_invalid_hostname,
check_sender_access hash:/etc/postfix/blocked_senders,
check_client_access hash:/etc/postfix/whitelisted_senders,
permit
broken_sasl_auth_clients = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks
smtpd_client_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_pipelining
-------------------------------------------------------
/etc/postfix/master.cf
smtp inet n - - - - smtpd
-o smtpd_sasl_auth_enable=yes
pickup unix n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=virtmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
-------------------------------------------------------
/etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd ### habe auch schon auxprop ausprobiert
auxprop_plugin: sql
mech_list: plain login
allow_plaintext: true
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: mxadmin
sql_passwd: [Passwort]
sql_database: mailserver
sql_select: select password FROM users where email='%u@%r'
log_level: 7
-------------------------------------------------------
/etc/default/saslauthd
START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -r -m /var/spool/postfix/var/run/saslauthd"
-------------------------------------------------------
ich habe mich gerade neu angemeldet, in der Hoffnung, dass mir hier jemand weiterhelfen kann.
Ich bin dabei, einen Mailserver auf einem Ubuntu 14.04.2 LTS (GNU/Linux 3.16.0-37-generic x86_64) mit Postfix und Courier aufzusetzen. Alle Anmeldungen sollen per MySQL geprüft werden. Der Empfang von Mails funktioniert tadellos, das Lesen per IMAP ebenfalls. Aber der Versand will nicht. Google hat mir schon etliche Hinweise geben wollen, aber nichts davon löst mein Problem.
In den Logs findet man folgendes:
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin Parse the username testuser@[domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin try and connect to a host
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin trying to open db 'mailserver' on host '127.0.0.1'
==> /var/log/mysql/mysql.log <==
150519 10:16:18 185 Connect mxadmin@localhost on
184 Connect mxadmin@localhost on mailserver
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: begin transaction
==> /var/log/mysql/mysql.log <==
184 Query START TRANSACTION
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin create statement from userPassword testuser [domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin doing query select password FROM users where email='testuser@[domain]';
==> /var/log/mysql/mysql.log <==
184 Query select password FROM users where email='testuser@[domain]'
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: commit transaction
==> /var/log/mysql/mysql.log <==
184 Query COMMIT
==> /var/log/auth.log <==
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin Parse the username testuser@[domain]
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin try and connect to a host
May 19 10:16:18 mail postfix/smtpd[11178]: sql plugin trying to open db 'mailserver' on host '127.0.0.1'
==> /var/log/mysql/mysql.log <==
186 Connect mxadmin@localhost on mailserver
==> /var/log/auth.log <==
May 19 10:16:18 mail saslauthd[10688]: pam_unix(smtp:auth): check pass; user unknown
==> /var/log/mysql/mysql.log <==
186 Quit
184 Quit
185 Init DB mailserver
185 Query SELECT email, password, "", 5000, 5000, "/mail/virtmail", CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/'), "", "", "" FROM users WHERE email = 'testuser@[domain]'
==> /var/log/auth.log <==
May 19 10:16:18 mail saslauthd[10688]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
==> /var/log/mail.log <==
May 19 10:16:18 mail imapd: LOGIN, user=testuser@[domain], ip=[::ffff:192.168.20.143], port=[50399], protocol=IMAP
==> /var/log/auth.log <==
May 19 10:16:20 mail saslauthd[10688]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
May 19 10:16:20 mail saslauthd[10688]: do_auth : auth failure: ] [service=smtp] [realm=[domain]] [mech=pam] [reason=PAM auth error]
==> /var/log/mail.log <==
May 19 10:16:20 mail postfix/smtpd[11178]: warning: SASL authentication failure: Password verification failed
May 19 10:16:20 mail postfix/smtpd[11178]: warning: unknown[192.168.20.143]: SASL PLAIN authentication failed: authentication failure
May 19 10:16:22 mail postfix/smtpd[11178]: warning: unknown[192.168.20.143]: SASL LOGIN authentication failed: authentication failure
Der User "testuser@domain" existiert definitiv in der Datenbank, sonst könnte er sich nicht per IMAP seine Mails anschauen.
Wäre super, wenn mir jemand einen Tipp geben könnte.
Vielen Dank im Voraus
-Lunatic
Hier meine Konfig-Dateien:
-------------------------------------------------------
/etc/postfix/main.cf
config_directory = /etc/postfix
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
delay_warning_time = 24h
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550
unknown_local_recipient_reject_code = 550
maximal_queue_lifetime=2d
bounce_queue_lifetime=2d
queue_run_delay = 500s
minimal_backoff_time=500s
maximal_backoff_time=4000s
myhostname = [hostname]
sender_canonical_maps=hash:/etc/postfix/sender_canonical
recipient_canonical_maps=hash:/etc/postfix/recipient_canonical
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
smtp_sasl_auth_enable = no
myorigin = /etc/mailname
mydestination =
relayhost =
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql_relay_recipients.cf
mynetworks = 127.0.0.0/8 192.168.200.0/24
mailbox_size_limit = 0
message_size_limit = 0
virtual_mailbox_limit = 0
smtpd_recipient_limit = 5000
recipient_delimiter =
inet_interfaces = all
inet_protocols = ipv4
transport_maps = mysql:/etc/postfix/mysql_transport_maps.cf
virtual_mailbox_base = /mail/virtmail
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unknown_sender_domain,
reject_invalid_hostname,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_invalid_hostname,
check_sender_access hash:/etc/postfix/blocked_senders,
check_client_access hash:/etc/postfix/whitelisted_senders,
permit
broken_sasl_auth_clients = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks
smtpd_client_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_pipelining
-------------------------------------------------------
/etc/postfix/master.cf
smtp inet n - - - - smtpd
-o smtpd_sasl_auth_enable=yes
pickup unix n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
maildrop unix - n n - - pipe
flags=DRhu user=virtmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
-------------------------------------------------------
/etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd ### habe auch schon auxprop ausprobiert
auxprop_plugin: sql
mech_list: plain login
allow_plaintext: true
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: mxadmin
sql_passwd: [Passwort]
sql_database: mailserver
sql_select: select password FROM users where email='%u@%r'
log_level: 7
-------------------------------------------------------
/etc/default/saslauthd
START=yes
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -r -m /var/spool/postfix/var/run/saslauthd"
-------------------------------------------------------