Probleme mit Postfix/Dovecot

Nach 5 Stunden ergebnislosem Zeitaufwand, reißt mir doch solangsam der Geduldsfaden…

Nun nahm ich mir endlich die Zeit Postfix und Dovecot zu konfigurieren!
Um die Benutzer leichter verwalten zu können greife ich auf Postfix.Admin zurück.

Das läuft ja auch alles, schön brav und sauber!
Doch das Problem ist:

  1. Emails können nicht empfangen werden.
  2. SMTP weißt Verbindung ab
  3. Clients wie Thunderbird können erst gar nicht zugreifen…

Ich bin jetzt schon die Configs auf und ab und Google durch, zum besagten Problem findet man nie wirklich irgendwo eine Lösung.
Hier mal die Config-Dateien von Postfix und Dovecot:

Postfix:
main.cf: pastebin.com/4LBENFpS
master.cf: pastebin.com/pBfypMYx

Dovecot:
dovecot.conf: pastebin.com/jUd2MfkE

Das Login mit den über Postfix.Admin angelegten Mailboxen klappt übrigens in WebUI’s wie Roundcube und SquirrelMail prima.
Aber wie gesagt, kommt nix an und senden geht auch nicht :’(!

MfG Syntafin

hi

das hört sich eher danach an, alsob ein Verbindungsproblem besteht oder alsob zB. die Pakete verworfen werden.

Ist da keine Firewall im Weg? Welche Fehlermeldungen, exakt, liefert Dir denn zB. Thunderbird oder andere Clients und was sagt die Log über das fehlgeschlagene Versenden aus?

ciao

Hier mal der so eben durchgeführte Thunderbird Test:

Oct 3 22:23:24 AntributeSRV1 dovecot: imap-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=80.***.***.***, lip=5.*.*.***, session=<WQIu9dvnmQBQhebD> Oct 3 22:23:24 AntributeSRV1 dovecot: imap-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=80.***.***.***, lip=5.*.*.***, session=<FBsu9dvnmgBQhebD> Oct 3 22:23:24 AntributeSRV1 postfix/smtpd[6663]: connect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 22:23:24 AntributeSRV1 postfix/smtpd[6666]: connect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6666]: SSL_accept error from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***]: lost connection Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6663]: SSL_accept error from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***]: lost connection Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6666]: lost connection after CONNECT from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6666]: disconnect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6663]: lost connection after CONNECT from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 22:23:35 AntributeSRV1 postfix/smtpd[6663]: disconnect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***]

Ansonsten, hier sehr “schöne” Stellen aus dem Mail-Log, bspw. vom Email-Empfang!

Oct 3 20:25:29 AntributeSRV1 postfix/smtpd[30838]: connect from mail-we0-f176.google.com[74.125.82.176] Oct 3 20:30:29 AntributeSRV1 postfix/smtpd[30838]: SSL_accept error from mail-we0-f176.google.com[74.125.82.176]: Connection timed out Oct 3 20:30:29 AntributeSRV1 postfix/smtpd[30838]: lost connection after CONNECT from mail-we0-f176.google.com[74.125.82.176] Oct 3 20:30:29 AntributeSRV1 postfix/smtpd[30838]: disconnect from mail-we0-f176.google.com[74.125.82.176] Oct 3 20:55:40 AntributeSRV1 postfix/smtpd[411]: connect from mail-we0-f181.google.com[74.125.82.181] Oct 3 21:00:40 AntributeSRV1 postfix/smtpd[411]: SSL_accept error from mail-we0-f181.google.com[74.125.82.181]: Connection timed out Oct 3 21:00:40 AntributeSRV1 postfix/smtpd[411]: lost connection after CONNECT from mail-we0-f181.google.com[74.125.82.181] Oct 3 21:00:40 AntributeSRV1 postfix/smtpd[411]: disconnect from mail-we0-f181.google.com[74.125.82.181] Oct 3 21:02:20 AntributeSRV1 postfix/pickup[27794]: 789C024A03BE: uid=0 from=<root> Oct 3 21:02:20 AntributeSRV1 postfix/cleanup[903]: 789C024A03BE: message-id=<20131003190220.789C024A03BE@antribute.eu> Oct 3 21:02:20 AntributeSRV1 postfix/qmgr[19522]: 789C024A03BE: from=<root@antribute.eu>, size=578, nrcpt=1 (queue active) Oct 3 21:02:20 AntributeSRV1 dovecot: auth-worker(909): mysql(localhost): Connected to database mailserver Oct 3 21:02:20 AntributeSRV1 postfix/pipe[907]: 789C024A03BE: to=<root@antribute.eu>, orig_to=<root>, relay=dovecot, delay=0.32, delays=0.17/0/0/0.14, dsn=5.1.1, status=bounced (user unknown) Oct 3 21:02:20 AntributeSRV1 postfix/cleanup[903]: A9DA024A03BF: message-id=<20131003190220.A9DA024A03BF@antribute.eu> Oct 3 21:02:20 AntributeSRV1 postfix/bounce[911]: 789C024A03BE: sender non-delivery notification: A9DA024A03BF Oct 3 21:02:20 AntributeSRV1 postfix/qmgr[19522]: A9DA024A03BF: from=<>, size=2305, nrcpt=1 (queue active) Oct 3 21:02:20 AntributeSRV1 postfix/qmgr[19522]: 789C024A03BE: removed Oct 3 21:02:20 AntributeSRV1 postfix/pipe[907]: A9DA024A03BF: to=<root@antribute.eu>, relay=dovecot, delay=0.12, delays=0.08/0/0/0.04, dsn=5.1.1, status=bounced (user unknown) Oct 3 21:02:20 AntributeSRV1 postfix/qmgr[19522]: A9DA024A03BF: removed Oct 3 22:00:19 AntributeSRV1 postfix/smtpd[4984]: connect from mail-we0-f179.google.com[74.125.82.179] Oct 3 22:01:53 AntributeSRV1 postfix/pickup[2119]: 53CC724A03BE: uid=0 from=<root> Oct 3 22:01:53 AntributeSRV1 postfix/cleanup[5111]: 53CC724A03BE: message-id=<20131003200153.53CC724A03BE@antribute.eu> Oct 3 22:01:53 AntributeSRV1 postfix/qmgr[19522]: 53CC724A03BE: from=<root@antribute.eu>, size=578, nrcpt=1 (queue active) Oct 3 22:01:53 AntributeSRV1 dovecot: auth-worker(5119): mysql(localhost): Connected to database mailserver Oct 3 22:01:53 AntributeSRV1 postfix/pipe[5114]: 53CC724A03BE: to=<root@antribute.eu>, orig_to=<root>, relay=dovecot, delay=0.39, delays=0.12/0/0/0.26, dsn=5.1.1, status=bounced (user unknown) Oct 3 22:01:53 AntributeSRV1 postfix/cleanup[5111]: 9D3F224A03BF: message-id=<20131003200153.9D3F224A03BF@antribute.eu> Oct 3 22:01:53 AntributeSRV1 postfix/bounce[5121]: 53CC724A03BE: sender non-delivery notification: 9D3F224A03BF Oct 3 22:01:53 AntributeSRV1 postfix/qmgr[19522]: 9D3F224A03BF: from=<>, size=2305, nrcpt=1 (queue active) Oct 3 22:01:53 AntributeSRV1 postfix/qmgr[19522]: 53CC724A03BE: removed Oct 3 22:01:53 AntributeSRV1 postfix/pipe[5114]: 9D3F224A03BF: to=<root@antribute.eu>, relay=dovecot, delay=0.07, delays=0.03/0/0/0.04, dsn=5.1.1, status=bounced (user unknown) Oct 3 22:01:53 AntributeSRV1 postfix/qmgr[19522]: 9D3F224A03BF: removed Oct 3 22:05:19 AntributeSRV1 postfix/smtpd[4984]: SSL_accept error from mail-we0-f179.google.com[74.125.82.179]: Connection timed out Oct 3 22:05:19 AntributeSRV1 postfix/smtpd[4984]: lost connection after CONNECT from mail-we0-f179.google.com[74.125.82.179] Oct 3 22:05:19 AntributeSRV1 postfix/smtpd[4984]: disconnect from mail-we0-f179.google.com[74.125.82.179]

Sieht nach einem SSL-Fehler aus, wenn ich das mal so durchlese :astonished:

hi

hm, ja. Teste bitte mal Dein Zertifikat mit

…wird Dir was ausgegeben?

Ansonsten probiere bitte zuerst noch diese 3 Schritte:

  1. master.cf
    #smtps inet n - - - - smtpd
    aktivieren, also Kommentarzeichen weg, Mailserver neu laden/starten

  2. wenn kein Erfolg (das bringt Dir aber eher nur was bei älteren Clients von Microsoft, dürfte egal sein daher):
    #submission inet n - - - - smtpd
    aktivieren, also Kommentarzeichen weg, Mailserver neu laden/starten

  3. wenn kein Erfolg:
    schau bitte ob die Pakete richtig durchgelassen werden, mit

…und Ausgabe bitte posten.

ciao

Schonmal vorab bevor ich weiter mache:

root@AntributeSRV1 /etc/postfix/sslcert # openssl x509 -in mailserver.pem -inform pem -noout -text Error opening Certificate mailserver.pem 140560759264936:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('mailserver.pem','r') 140560759264936:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400: unable to load certificate

Eine .pem hab ich nicht mal o_O nun bin ich gerade sehr verwundert…

Nach aktivieren von:
smtps inet n - - - - smtpd
submission inet n - - - - smtpd

Geht es gerade in Thunderbird mit den Einstellungen!
Email senden über Thunderbird klappt!
Senden, kommt nicht an!

Was senden angeht:

Oct 3 23:22:03 AntributeSRV1 postfix/smtpd[6204]: connect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 23:22:04 AntributeSRV1 postfix/smtpd[6204]: 5842424A03BF: client=p5085E6C3.dip0.t-ipconnect.de[80.***.***.***], sasl_method=PLAIN, sasl_username=support@pixelcrafting.eu Oct 3 23:22:04 AntributeSRV1 postfix/cleanup[6369]: 5842424A03BF: message-id=<524DDFFC.3010007@pixelcrafting.eu> Oct 3 23:22:04 AntributeSRV1 postfix/qmgr[6190]: 5842424A03BF: from=<support@pixelcrafting.eu>, size=664, nrcpt=1 (queue active) Oct 3 23:22:04 AntributeSRV1 postfix/smtpd[6204]: disconnect from p5085E6C3.dip0.t-ipconnect.de[80.***.***.***] Oct 3 23:22:05 AntributeSRV1 postfix/smtp[6371]: 5842424A03BF: to=<sirzimt@gmail.com>, relay=gmail-smtp-in.l.google.com[173.194.70.26]:25, delay=0.83, delays=0.44/0.01/0.08/0.3, dsn=2.0.0, status=sent (250 2.0.0 OK 1380835325 w44si7665729eef.135 - gsmtp) Oct 3 23:22:05 AntributeSRV1 postfix/qmgr[6190]: 5842424A03BF: removed Oct 3 23:22:05 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=80.***.***.***, lip=5.9.2.131, mpid=6373, TLS, session=<JpARx9znkgBQhebD> Oct 3 23:22:50 AntributeSRV1 postfix/smtpd[6436]: connect from mail-wi0-f169.google.com[209.85.212.169]

Also irgendwie hat es IMAP noch ein wenig… bzw. nicht IMAP sondern die Zustellung.

Ausgabe von iptables:

[code]root@AntributeSRV1 /etc/postfix/sslcert # iptables -nvL
Chain INPUT (policy ACCEPT 2328K packets, 166M bytes)
pkts bytes target prot opt in out source destination
53M 14G fail2ban-ssh tcp – * * 0.0.0.0/0 0.0.0.0/0 multiport dports 22
4039M 496G LOG all – eth0 * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 7 prefix “BANDWIDTH_IN:”

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 LOG all – * eth0 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 7 prefix "BANDWIDTH_OUT:"
0 0 LOG all – eth0 * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 7 prefix “BANDWIDTH_IN:”

Chain OUTPUT (policy ACCEPT 5431K packets, 6800M bytes)
pkts bytes target prot opt in out source destination
7475M 9158G LOG all – * eth0 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 7 prefix “BANDWIDTH_OUT:”

Chain fail2ban-ssh (1 references)
pkts bytes target prot opt in out source destination
20 1520 DROP all – * * 216.150.226.23 0.0.0.0/0
21 1668 DROP all – * * 178.211.186.108 0.0.0.0/0
53M 14G RETURN all – * * 0.0.0.0/0 0.0.0.0/0
[/code]

Jedenfalls wäre da dann die Log von Dovecot sehr nützlich - smtp scheint ja daher nun mal zu klappen und ist richtig konfiguriert. Wahrscheinlich funzt da einfach was seitens Dovecot nicht - aber da es lokal mal klappt ist es wohl ein Problem mit der TCP-Kommunikation.

ciao

Hier mal der Log einer eben versuchten Email:

Oct 4 00:22:57 AntributeSRV1 postfix/smtpd[10630]: SSL_accept error from mail-we0-f176.google.com[74.125.82.176]: Connection timed out Oct 4 00:22:57 AntributeSRV1 postfix/smtpd[10630]: lost connection after CONNECT from mail-we0-f176.google.com[74.125.82.176] Oct 4 00:22:57 AntributeSRV1 postfix/smtpd[10630]: disconnect from mail-we0-f176.google.com[74.125.82.176] Oct 4 00:23:33 AntributeSRV1 dovecot: auth-worker(11039): mysql(localhost): Connected to database mailserver Oct 4 00:23:33 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11041, TLS, session=<KjLoot3nJgAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:33 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=44 out=513 Oct 4 00:23:35 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11045, TLS, session=<6bwBo93nJwAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:35 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=50 out=416 Oct 4 00:23:35 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11047, TLS, session=</PUCo93nKAAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:35 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=123 out=652 Oct 4 00:23:37 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11051, TLS, session=<fsUko93nKQAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:37 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=276 out=1223 Oct 4 00:23:38 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11054, TLS, session=<WbIvo93nKgAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:38 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=276 out=1223 Oct 4 00:23:38 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11056, TLS, session=<OWM3o93nKwAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:38 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=276 out=1223 Oct 4 00:23:39 AntributeSRV1 dovecot: imap-login: Login: user=<support@pixelcrafting.eu>, method=PLAIN, rip=2a01:4f8:160:7001::2, lip=2a01:4f8:160:7001::2, mpid=11060, TLS, session=<p5pAo93nLAAqAQT4AWBwAQAAAAAAAAAC> Oct 4 00:23:39 AntributeSRV1 dovecot: imap(support@pixelcrafting.eu): Disconnected: Logged out in=276 out=1223

hm, also bevor wir da jetzt großartig weitermachen, erstelle bitte zuerst ein richtiges Zertifikat, falls Du die Dummies von snakeoil oder so verwendest wird das alles nicht klappen :ps:

ciao

[quote=„miro“]hm, also bevor wir da jetzt großartig weitermachen, erstelle bitte zuerst ein richtiges Zertifikat, falls Du die Dummies von snakeoil oder so verwendest wird das alles nicht klappen :ps:

ciao[/quote]

Dann mache ich mir morgen mal die „Mühe“ mein Zertifikat zu kopieren xD…

So Zertifikat ist jetzt installiert :nutz:

Nach langer Wartezeit kam auch endlich was im Log beim „Empfang“ an…

Oct 4 21:02:06 AntributeSRV1 postfix/smtpd[1571]: SSL_accept error from mail-wg0-f42.google.com[74.125.82.42]: Connection timed out Oct 4 21:02:06 AntributeSRV1 postfix/smtpd[1571]: lost connection after CONNECT from mail-wg0-f42.google.com[74.125.82.42] Oct 4 21:02:06 AntributeSRV1 postfix/smtpd[1571]: disconnect from mail-wg0-f42.google.com[74.125.82.42] Oct 4 21:02:24 AntributeSRV1 postfix/smtpd[1590]: SSL_accept error from mail-wi0-f182.google.com[209.85.212.182]: Connection timed out Oct 4 21:02:24 AntributeSRV1 postfix/smtpd[1590]: lost connection after CONNECT from mail-wi0-f182.google.com[209.85.212.182] Oct 4 21:02:24 AntributeSRV1 postfix/smtpd[1590]: disconnect from mail-wi0-f182.google.com[209.85.212.182]

Er meckert mir immernoch wegen SSL…
Und ja… diesmal gibt es eine Ausgabe bei:

openssl x509 -in /etc/postfix/sslcert/cert.pem -inform pe m -noout -text

So langsam kommt es mir immer Spanischer vor…

hast Du die Zertifikate auch jeweils bei postfix und bei dovecot eingetragen? also in beide Konfigurationen an der richtigen Stelle?

ciao

[quote=„miro“]hast Du die Zertifikate auch jeweils bei postfix und bei dovecot eingetragen? also in beide Konfigurationen an der richtigen Stelle?

ciao[/quote]

Jap :nutz: ist alles eingetragen.
Musste ja für IMAP/SMTP das Zertifikat erneut akzeptieren!

Jetzt mal eine ganz blöde Zwischenfrage, es handelt sich hierbei um kein Zertifikat von Thawate oder VeriSign handelt.
Ich hab dafür jetzt das Zertifikat das von CACert unterzeichnet wurde verwendet.
Ein selbst-signiertes hätte ich auch noch zur Auswahl.

Kann es sein das zB Google das Zertifikat nicht annimmt? Weil ich verwende ja meine GMail-Adresse zum Testversand als.

NAA ENDLICH! Da kam endlich die Email von Google!!!

[quote]This is an automatically generated Delivery Status Notification

THIS IS A WARNING MESSAGE ONLY.

YOU DO NOT NEED TO RESEND YOUR MESSAGE.

Delivery to the following recipient has been delayed:

 [support@pixelcrafting.eu](mailto:support@pixelcrafting.eu)

Message will be retried for 2 more day(s)

Technical details of temporary failure:
The recipient server did not accept our requests to connect. Learn more at support.google.com/mail/bin/answ … nswer=7720
[(1) mx.pixelcrafting.eu . [5...***]:25: Connection dropped]
[/quote]

Da fällt mir gerade als ich was geprüft habe etwas auf!

Als “Common Name” in meinem Zertifikat steht ja “antribute.eu”, kann es sein das es deswegen Probleme gibt wenn man eine Mail an zB. support@pixelcrafting.eu sendet?
Weil er ja mit pixelcrafting.eu sich verbindet, aber Zertifikat labert von antribute.eu?