Emailversandt durch Shopware + Gmail/Strato unmöglich, aber möglich durch Kommandozeile

Hallo,

ich habe die letzten 2 Stunden mit den Einstellungen vom Mail gespielt. Ich habe zunächst unterschiedliche Felder an Gmail anzupassen versucht. Ich habe server (smtp.gmail.com/smtp-relay.gmail.com/smtp.strato.de), Port und Verbindungs Präfix (465 und ssl oder 587 und tls) sowie Verbindungs-Authentifizierung (keine Angebe / plain / login) geändert. Bei den Versuchen mit Gmail bekomme ich immer “exception ‘Zend_Mail_Protocol_Exception’ with message ‘Connection timed out’ in /engine/Library/Zend/Mail/Protocol/Abstract.php:273” und bei Strato anscheinend keine Meldung im Log. Ich habe dieselben Einstellungen mit 587/TLS in Apple Mail probiert sowohl für Gmail als auch für Strato und da ging es reibungslos. 

Was könnte das Problem sein?

Viele Grüße
Roman

Jetzt noch mehr Merkwürdigkeit: keine Connect durch sendemal, aber es gibt Connect mit telnet.

[rreimche@mysrv ~]$ sendemail -l email.log \
> -f "from_email@gmail.com" \
> -u "Email Subject 1" \
> -t "to_email@gmail.com" \
> -s "smtp.gmail.com:587" \
> -o tls=yes \
> -xu "from_email@gmail.com" \
> -xp "mypasswort" \
> -m "Test"

May 24 16:15:26 frontsignparts sendemail[22723]: ERROR => Timeout while connecting to smtp.gmail.com:587 There was no response after 60 seconds.
NOTICE: The log file [email.log] does not exist. Creating it now with mode [0600].

[rreimche@mysrv ~]$ ping smtp.gmail.com
PING gmail-smtp-msa.l.google.com (173.194.76.108) 56(84) bytes of data.
64 bytes from ws-in-f108.1e100.net (173.194.76.108): icmp_seq=1 ttl=48 time=7.92 ms
64 bytes from ws-in-f108.1e100.net (173.194.76.108): icmp_seq=2 ttl=48 time=7.42 ms
64 bytes from ws-in-f108.1e100.net (173.194.76.108): icmp_seq=3 ttl=48 time=7.38 ms
64 bytes from ws-in-f108.1e100.net (173.194.76.108): icmp_seq=4 ttl=48 time=7.36 ms

[rreimche@mysrv ~]$ telnet smtp.gmail.com 587
Trying 2a00:1450:400c:c00::6c...
telnet: connect to address 2a00:1450:400c:c00::6c: Connection timed out
Trying 173.194.76.109...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP n3-v6sm17204845wrp.14 - gsmtp

Und von meinem Laptop wieder reibungslos:

 

 broadcast_algorithms git:(ex2) sendemail -f "from_email@gmail.com" -u "Test" -t "to_email@gmail.com" -s "smtp.gmail.com:587" -o tls=yes -xu "from_email@gmail.com" -xp "passwort" -m "Test"
May 24 16:27:20 eduroam-ipv4-5-0856 sendemail[4972]: Email was sent successfully!

 

Das Problem war, dass mein Hoster die ausgehened SMTP-Verbindungen durch IPv6 blockiert. Darüber gibt es einen Artikel in cloudsupport namens “My outgoing mail seems to be blocked, what can I do?”.

Die Lösung: In /etc/gai.conf muss “precedence ::ffff:0:0/96 100” hinzugefügt/abkommentiert werden, damit IPv4-Verbindungen bevorzugt werden.

Leider werden jetzt Email problemlos durch Kommandozeile versandt, aber noch nicht durch Shopware:

[rreimche@myserv ~]$ sendemail -f "email_from@gmail.com" -u "Test" -t "email_to@gmail.com" -s "smtp.gmail.com:587" -o tls=yes -xu "email_from@gmail.com" -xp "passwort" -m "Test"
*******************************************************************
 Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
 is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
 possibly with SSL_ca_file|SSL_ca_path for verification.
 If you really don't want to verify the certificate and keep the
 connection open to Man-In-The-Middle attacks please set
 SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
  at /usr/bin/sendemail line 1933.
May 24 16:42:50 frontsignparts sendemail[22903]: Email was sent successfully!

[rreimche@frontsignparts ~]$ sendemail -f "no-reply@myserv.de" -u "Test" -t "email_to@gmail.com" -s "smtp.strato.de:587" -o tls=yes -xu "no-reply@myserv.de" -xp "passwort" -m "Test"
*******************************************************************
 Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
 is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
 possibly with SSL_ca_file|SSL_ca_path for verification.
 If you really don't want to verify the certificate and keep the
 connection open to Man-In-The-Middle attacks please set
 SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.
*******************************************************************
  at /usr/bin/sendemail line 1933.
May 24 16:57:49 frontsignparts sendemail[22976]: Email was sent successfully!

Kann’s irgendwie möglich sein, dass Shopware trotz der Zeile in /etc/gai.conf durch IPv6 Emails versendet?