Kategorien
IT

Shopware 5, sendmail and a Strato smtp servers

We just moved from another mail provider to strato, with one of our companies.

As we are running several online shops based on shopware with this company, we also had so re-setup the mailing stuff, and I just wanted to document that here – none the less for my self documentation. We are running on an AWS Ubuntu 14.04.5 LTS environment

These are the settings within Shopware 5 for Strato Mailservers:

strato-mailsettings

  1. email@domain.com of course is the emailadress, which can authenticate with strato.
  2. That is NOT the Email adress, you want to have the email sent „from“. You can configure that bit in the shopware backend at: Configuration -> Shop settings -> Basic information -> Shop owner Email.

In the first place I was not able to send emails (in shopware 5 you can send testmails by clicking „send testmail to shop owner“ at Configuration -> Email Templates -> System emails -> sOrder -> Send test mail to shop owner)

send-test-mail

 

I did a „tail -f /var/log/mail“ on the server, so examine why we were not able to send via sendmail to the smtp, and all I got was a lousy: DSN Service unavailable.

Sep  2 18:19:26 (none) sendmail[17696]: u82IJQ4j017696: from=www-data, size=1467, class=0, nrcpts=1, msgid=<201609021819.u82IJQ4j017696@(none)>, relay=www-data@localhost

Sep  2 18:19:26 (none) sm-mta[17697]: u82IJQBv017697: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v4

Sep  2 18:19:26 (none) sendmail[17696]: u82IJQ4j017696: to=bestellung@theshopname.com, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31467, relay=[127.0.0.1] [127.0.0.1], dsn=5.0.0, stat=Service unavailable

Sep  2 18:19:26 (none) sendmail[17696]: u82IJQ4j017696: u82IJQ4k017696: DSN: Service unavailable

So I did two things and they fixed my problem.

  1. adding a hostname (no, there wasn’t one): hostname myshopdomain.com
  2. editing /etc/hosts PUBLICIPADDRESS myshopdomain.com
  3. service sendmaol restart

Voila – sending mail works flawlessly.