SMTP geht nicht (Postfix + MySQL)

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
dmant
Beiträge: 251
Registriert: 09.10.2017 10:28:29

SMTP geht nicht (Postfix + MySQL)

Beitrag von dmant » 09.10.2017 11:49:19

Hi Leute,

ich betreibe seit längerem einen Debian Server. Hier habe ich auch einen Mailserver installiert. Dieser ist Postfix mit MySQL und saslauth.

Wenn ich per WebMail (SquirrelMail) einen Login in einen Mailaccount mache kann ich Empfangene Mails sehen und auch Mails versenden ohne Probleme.
Will ich nun allerdings einen Client benutzen (Thunderbird z.b.) dann kann ich Mails per POP und IMAP abrufen, allerdings keine Mails versenden. Weder mit STARTTLS noch ohne.

Als fehler in der /var/log/mail.log erscheint nur:

Code: Alles auswählen

Oct  9 11:45:24 ns3067246 postfix/smtpd[22518]: connect from x4db56385.dyn.telefonica.de[77.181.99.133]
Oct  9 11:45:24 ns3067246 postfix/smtpd[22518]: warning: x4db56385.dyn.telefonica.de[77.181.99.133]: SASL PLAIN authentication failed: authentication failure
Oct  9 11:45:24 ns3067246 postfix/smtpd[22518]: lost connection after AUTH from x4db56385.dyn.telefonica.de[77.181.99.133]
Oct  9 11:45:24 ns3067246 postfix/smtpd[22518]: disconnect from x4db56385.dyn.telefonica.de[77.181.99.133]
Oct  9 11:45:40 ns3067246 postfix/smtpd[22518]: connect from x4db56385.dyn.telefonica.de[77.181.99.133]
Oct  9 11:45:40 ns3067246 postfix/smtpd[22518]: warning: x4db56385.dyn.telefonica.de[77.181.99.133]: SASL PLAIN authentication failed: authentication failure
Oct  9 11:45:40 ns3067246 postfix/smtpd[22518]: lost connection after AUTH from x4db56385.dyn.telefonica.de[77.181.99.133]
Oct  9 11:45:40 ns3067246 postfix/smtpd[22518]: disconnect from x4db56385.dyn.telefonica.de[77.181.99.133]
telnet localhost 25

Code: Alles auswählen

root@ns3067246:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server.dmant.ovh ESMTP Postfix (Debian/GNU)
ehlo test
250-server.dmant.ovh
250-PIPELINING
250-SIZE 30720000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
/etc/postfix/sasl/smtp.conf

Code: Alles auswählen

pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true

auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: mail_admin
sql_passwd: XXXXXXX
sql_database: mail
sql_select: select password from users where email = '%u'
/etc/postfix/main.cf

Code: Alles auswählen

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

readme_directory = /usr/share/doc/postfix

message_size_limit = 30720000

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


myhostname = server.dmant.ovh
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = server.dmant.ovh, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service unix:private/policyd-spf
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, permit_tls_clientcerts
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
policyd-spf_time_limit = 3600

milter_default_action = accept
milter_protocol = 6
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
Leider werde ich aus dem Fehler absolut nicht schlau. Auch geht ja "web mässig" alles, nur eben per Client nicht.

Ich hoffe ihr könnt mir da weiter helfen.
Zuletzt geändert von dmant am 09.10.2017 12:05:31, insgesamt 1-mal geändert.

webhosterin
Beiträge: 3
Registriert: 29.09.2016 15:24:34

Re: SMTP geht nicht (Postfix + MySQL)

Beitrag von webhosterin » 09.10.2017 11:56:53

SMTP Authentifizierung beim Mailclient aktiviert? Würde jetzt darauf tippen.

Gesendet von meinem ZTE A2017G mit Tapatalk


dmant
Beiträge: 251
Registriert: 09.10.2017 10:28:29

Re: SMTP geht nicht (Postfix + MySQL)

Beitrag von dmant » 09.10.2017 12:21:08

/var/log/auth.log

Code: Alles auswählen

Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql auxprop plugin using mysql engine
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin Parse the username admin@dmant.ovh
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin try and connect to a host
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin trying to open db 'mail' on host '127.0.0.1'
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: begin transaction
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin create statement from userPassword admin dmant.ovh
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin doing query select password from users where email = 'admin@dmant.ovh';
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: commit transaction
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin Parse the username admin@dmant.ovh
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin try and connect to a host
Oct  9 12:17:45 ns3067246 postfix/smtpd[24398]: sql plugin trying to open db 'mail' on host '127.0.0.1'
Oct  9 12:17:45 ns3067246 saslauthd[24212]: pam_mysql - SELECT returned no result.
Oct  9 12:17:45 ns3067246 saslauthd[24212]: pam_mysql - SELECT returned no result.
Oct  9 12:17:45 ns3067246 saslauthd[24212]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Oct  9 12:17:45 ns3067246 saslauthd[24212]: do_auth         : auth failure: [user=admin] [service=smtp] [realm=dmant.ovh] [mech=pam] [reason=PAM auth error]

Antworten