# Relay access denied

**URL:** <https://forum.mautic.org/t/relay-access-denied/19272>\
**Category:** Product Support\
**Created:** [April 29, 2021, 1:12pm UTC](https://forum.mautic.org/t/relay-access-denied/19272 "2021-04-29T13:12:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio-lazzari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/antonio-lazzari/32/737_2.png) [@antonio-lazzari](https://forum.mautic.org/u/antonio-lazzari)\
**Post date:** [April 29, 2021, 1:12pm UTC](https://forum.mautic.org/t/relay-access-denied/19272/1 "2021-04-29T13:12:46Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [April 29, 2021, 2:51pm UTC](https://forum.mautic.org/t/relay-access-denied/19272/2 "2021-04-29T14:51:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![antonio-lazzari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/antonio-lazzari/32/737_2.png) [@antonio-lazzari](https://forum.mautic.org/u/antonio-lazzari)\
**Post date:** [April 30, 2021, 8:12am UTC](https://forum.mautic.org/t/relay-access-denied/19272/3 "2021-04-30T08:12:01Z")

</div>

> [@ekke](#):
>
> 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).

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](mailto: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)”}

---

<div class="post-metadata">

**Author:** ![ekke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ekke/32/296_2.png) [@ekke](https://forum.mautic.org/u/ekke)\
**Post date:** [April 30, 2021, 9:33am UTC](https://forum.mautic.org/t/relay-access-denied/19272/4 "2021-04-30T09:33:37Z")

</div>

> [@antonio-lazzari](#):
>
> My technical had open relay on all nets

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](https://www.google.com/search?q=postfix+allow+relay+from+localhost) :

```auto
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination

```

```auto
mynetworks = 127.0.0.0/8, [::1]/128

```

hope this helps 🙂
