Relay access denied

Your software
My Mautic version is: 3.3.2

Your problem
I cant send email in a new and fresh installation.
When I try the test button in configurations I obtain SUCCESS, if I try SEND TEST EMAIL button I obtain SUCCESS, if I try to send an email or an example email I obtain this error in the log:

mautic.ERROR: [MAIL ERROR] Expected response code 354 but got code “554”, with message "554 5.5.1 Error: no valid recipients " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 my.smtp.it ESMTP Postfix (Ubuntu) >> EHLO my.domain.it << my.smtp.it 250-PIPELINING 250-SIZE 30720000 250-ETRN 250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: >> RCPT TO: >> DATA << 250 2.1.0 Ok << 454 4.7.1 : Relay access denied !! Expected response code 250/251/252 but got code “454”, with message "454 4.7.1 : Relay access denied " (code: 454) << 554 5.5.1 Error: no valid recipients !!

If I use the same configuration with a client I can send email without any problem.

Steps I have tried to fix the problem:
I tryed with SSL, TSL on plain and login but nothing change.
Thanks a lot

Hi Antonio,

Sounds like you are using a mailhost (aka SMTP Server, aka Smarthost, aka Mailhub, …) that is set up to receive email for your own domain (and the test mail goes to your own domain).
You will need a mailhost that allows relaying from your Mautic’s IP address (or authentication).

If I use the same configuration with a client I can send email without any problem.
What authentication is that client set up to use?

Best,
Ekke

Thank you Ekke it’s the same host, we are using postfix. My technical had open relay on all nets and it doesn’t work anymore. Any ideas? I paste the complete error if it could be more useful:

[2021-04-30 10:07:32] mautic.ERROR: [MAIL ERROR] Expected response code 354 but got code “554”, with message "554 5.5.1 Error: no valid recipients " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 vps.domain.it ESMTP Postfix (Ubuntu) >> EHLO news.domain.it << 250-vps.domain.it 250-PIPELINING 250-SIZE 30720000 250-ETRN 250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: >> RCPT TO: >> DATA << 250 2.1.0 Ok << 454 4.7.1 : Relay access denied !! Expected response code 250/251/252 but got code “454”, with message "454 4.7.1 : Relay access denied " (code: 454) << 554 5.5.1 Error: no valid recipients !! Expected response code 354 but got code “554”, with message "554 5.5.1 Error: no valid recipients " (code: 554) Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 vps.domain.it ESMTP Postfix (Ubuntu) >> EHLO news.domain.it << 250-vps.domain.it 250-PIPELINING 250-SIZE 30720000 250-ETRN 250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: >> RCPT TO: >> DATA << 250 2.1.0 Ok << 454 4.7.1 : Relay access denied !! Expected response code 250/251/252 but got code “454”, with message "454 4.7.1 : Relay access denied " (code: 454) << 554 5.5.1 Error: no valid recipients !! Expected response code 354 but got code “554”, with message "554 5.5.1 Error: no valid recipients " (code: 554) !! Expected response code 354 but got code “554”, with message "554 5.5.1 Error: no valid recipients " Log data: ++ Starting Swift_Transport_EsmtpTransport << 220 vps.domain.it ESMTP Postfix (Ubuntu) >> EHLO news.domain.it << 250-vps.domain.it 250-PIPELINING 250-SIZE 30720000 250-ETRN 250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250-SMTPUTF8 250 CHUNKING ++ Swift_Transport_EsmtpTransport started >> MAIL FROM: >> RCPT TO: >> DATA << 250 2.1.0 Ok << 454 4.7.1 : Relay access denied !! Expected response code 250/251/252 but got code “454”, with message “454 4.7.1 : Relay access denied " (code: 454) << 554 5.5.1 Error: no valid recipients !! Expected response code 354 but got code “554”, with message “554 5.5.1 Error: no valid recipients " (code: 554) (code: 554) (send); tonino.lazzari@gmail.com {“exception”:”[object] (Swift_TransportException(code: 554): Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 vps.domain.it ESMTP Postfix (Ubuntu)\r\n\n>> EHLO news.domain.it\r\n\n<< 250-vps.domain.it\r\n250-PIPELINING\r\n250-SIZE 30720000\r\n250-ETRN\r\n250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT\r\n250-ENHANCEDSTATUSCODES\r\n250-8BITMIME\r\n250-DSN\r\n250-SMTPUTF8\r\n250 CHUNKING\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n>> RCPT TO:\r\n\n>> DATA\r\n\n<< 250 2.1.0 Ok\r\n\n<< 454 4.7.1 : Relay access denied\r\n\n!! Expected response code 250/251/252 but got code "454", with message "454 4.7.1 : Relay access denied\r\n" (code: 454)\n<< 554 5.5.1 Error: no valid recipients\r\n\n!! Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n" (code: 554)\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 vps.domain.it ESMTP Postfix (Ubuntu)\r\n\n>> EHLO news.domain.it\r\n\n<< 250-vps.domain.it\r\n250-PIPELINING\r\n250-SIZE 30720000\r\n250-ETRN\r\n250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT\r\n250-ENHANCEDSTATUSCODES\r\n250-8BITMIME\r\n250-DSN\r\n250-SMTPUTF8\r\n250 CHUNKING\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n>> RCPT TO:\r\n\n>> DATA\r\n\n<< 250 2.1.0 Ok\r\n\n<< 454 4.7.1 : Relay access denied\r\n\n!! Expected response code 250/251/252 but got code "454", with message "454 4.7.1 : Relay access denied\r\n" (code: 454)\n<< 554 5.5.1 Error: no valid recipients\r\n\n!! Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n" (code: 554)\n!! Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n"\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n<< 220 vps.domain.it ESMTP Postfix (Ubuntu)\r\n\n>> EHLO news.domain.it\r\n\n<< 250-vps.domain.it\r\n250-PIPELINING\r\n250-SIZE 30720000\r\n250-ETRN\r\n250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT\r\n250-ENHANCEDSTATUSCODES\r\n250-8BITMIME\r\n250-DSN\r\n250-SMTPUTF8\r\n250 CHUNKING\r\n\n++ Swift_Transport_EsmtpTransport started\n>> MAIL FROM:\r\n\n>> RCPT TO:\r\n\n>> DATA\r\n\n<< 250 2.1.0 Ok\r\n\n<< 454 4.7.1 : Relay access denied\r\n\n!! Expected response code 250/251/252 but got code "454", with message "454 4.7.1 : Relay access denied\r\n" (code: 454)\n<< 554 5.5.1 Error: no valid recipients\r\n\n!! Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients\r\n" (code: 554) (code: 554) at /var/www/vhosts/domain.it/news.domain.it/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)”}

Indeed, you don’t want an open relay for the outside world.
So what they need to do is allow relaying from your Mautic system (probably 127.0.0.1, or the local IP anway).

postfix allow relay from localhost - Google Search :

smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
mynetworks = 127.0.0.0/8, [::1]/128

hope this helps :slight_smile:

1 Like