Gmail is blocking forwarded email from Expedia through my Server. How to fix?

I’ve been running my VestaCP, and now, my HestiaCP server for the past 7 years in this way. I have all my domains forward from various aliases to multiple gmail accounts. I then use Gmail to send outbound email through my SMTP server on my HestiaCP server.

It works and I have never had an issue with blocked email, until today. I’m trying to receive an automated email from Expedia to confirm my new user setup, but I can’t receive the email because Gmail is blocking it. I had to check the Exim4 mainlog file to figure this out.

Here is a copy/paste from the log file. Any idea how to fix this? Is the block related to the “SMTP error from remote mail server after pipelined end of data” message? Any help would be much appreciated.

2021-08-13 00:41:51 1mERp4-000CuX-UJ <= [email protected]il-affiliates.expediagroup.com H=a8-41.smtp-out.amazonses.com [54.240.8.41] P=esmtps X=TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_128_CBC__SHA1:128 CV=no SNI="mail.mydomain.com" S=6314 DKIM=amazonses.com [email protected]email.amazonses.com
2021-08-13 00:41:51 1mERp4-000CuX-UJ => Me <[email protected]> R=localuser_fwd_only T=devnull
2021-08-13 00:41:52 1mERp4-000CuX-UJ ** [email protected] <[email protected]> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [108.177.111.26] X=TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256 CV=yes: SMTP error from remote mail server after pipelined end of data: 550-5.7.1 [xxx.xxx.xxx.xxx      12] Our system has detected that this message is\n550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,\n550-5.7.1 this message has been blocked. Please visit\n550-5.7.1  https://support.google.com/mail/?p=UnsolicitedMessageError\n550 5.7.1  for more information. h10si814001ioe.21 - gsmtp
2021-08-13 00:41:52 1mERpA-000Cuf-8w <= <> R=1mERp4-000CuX-UJ U=Debian-exim P=local S=8803
2021-08-13 00:41:52 1mERp4-000CuX-UJ Completed
2021-08-13 00:41:53 1mERpA-000Cuf-8w => [email protected]il-affiliates.expediagroup.com R=dnslookup T=remote_smtp H=feedback-smtp.us-east-1.amazonses.com [34.192.233.193] X=TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256 CV=yes C="250 Ok Sr0ONH1pNm2ivje9WB3g-1"
2021-08-13 00:41:53 1mERpA-000Cuf-8w Completed
2021-08-13 00:41:57 1mERpB-000Cul-MN <= [email protected]il-affiliates.expediagroup.com H=a48-117.smtp-out.amazonses.com [54.240.48.117] P=esmtps X=TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_128_CBC__SHA1:128 CV=no SNI="mail.mydomain.com" S=6322 DKIM=amazonses.com [email protected]email.amazonses.com
2021-08-13 00:41:57 1mERpB-000Cul-MN => Me <[email protected]> R=localuser_fwd_only T=devnull
2021-08-13 00:41:57 1mERpB-000Cul-MN ** [email protected] <[email protected]> R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [108.177.111.26] X=TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256 CV=yes: SMTP error from remote mail server after pipelined end of data: 550-5.7.1 [xxx.xxx.xxx.xxx      12] Our system has detected that this message is\n550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail,\n550-5.7.1 this message has been blocked. Please visit\n550-5.7.1  https://support.google.com/mail/?p=UnsolicitedMessageError\n550 5.7.1  for more information. x7si880603ilu.63 - gsmtp
2021-08-13 00:41:57 1mERpF-000Cuu-Rs <= <> R=1mERpB-000Cul-MN U=Debian-exim P=local S=8804
2021-08-13 00:41:57 1mERpB-000Cul-MN Completed
2021-08-13 00:41:59 1mERpF-000Cuu-Rs => [email protected]il-affiliates.expediagroup.com R=dnslookup T=remote_smtp H=feedback-smtp.us-east-1.amazonses.com [18.235.76.96] X=TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256 CV=yes C="250 Ok Wu1PhkFLRTQSqrl4XV0w-1"
2021-08-13 00:41:59 1mERpF-000Cuu-Rs Completed```

Not sure is related, but did you check on Google settings “less secure apps” feature?

https://myaccount.google.com/lesssecureapps

How about you configure Gmail to get the messages via IMAP instead of pushing the emails to Gmail via SMTP

I know this is one option, but I want to limit the resources of the server to handle this kind of thing. I have had the server configured like this for years with no problem and I have it configured based on the way Google has outlined in their knowledge docs.

Some of this started when I rebuilt the server on Ubuntu 20 on DigitalOcean and got a new IP address assigned to my instance. So I’m not sure if it’s related to the new IP address or moving to HestiaCP. But the rate limiting and now this issue started after this change.

I don’t mind the rate limiting issue, as those only happen to pure spam/junk mail that is being sent through, so I could care less as google will simply put that in the spam folder anyway.

Literally this email from Expedia is the only time I have had an issue receiving legitimate email. And the reason I thought to ask her was because I recently upgraded HestiaCP, so I wanted to check to see if there is something to do with this “SMTP error from remote mail server after pipelined end of data”.

I haven’t seen this message before, so I’m wondering if it has something to do with how the email is being forwarded from HestiaCP to gmail and it’s losing some data, causing this error?

I’m not sure, so looking for any advice/insight from someone with more experience than I on this.

Thanks!

Thanks for the idea. I can check into this, but not sure how it’s related. And actually for accounts using two factor, you can’t use this feature anyway.

Is that your real sender?

Forwarding email to a gmail / outlook is conspired a bad practice. It is better to pull email via pop3/imap from your server to gmail See gmail docs how to…

1 Like

No, I just sanitized the log entries to mask the personal information. I wanted to keep the log intact so that others could understand what was happening, but did not want to include the personal information.

Thanks for the comment Eris and I fully understand your position, but there are many people that configure their server in the way I am describing. In fact, Google itself has several articles explaining best practices on how to configure 3rd party mail servers which forward all emails to Google (here is an example of one: Best practices for forwarding email to Gmail - Google Workspace Admin Help).

I know it’s something that the Hestia team seems to be very much against, but I’m simply looking for some help/guidance from anyone on this forum that uses the Hestia control panel that may know what’s causing this issue and/or how to resolve it.

As I mentioned, it’s one domain/incident out of literally thousands of emails and domains that my server processes, so I’m just trying to figure out why this one is having issues and hopefully how to resolve it.

I would love to help but I do it the other way around.

List everything that could be the cause and start sorting it out.

  • IP reputation
  • domain reputation
  • DNS: SPF dkim, etc.
  • messages from Expedia flagged as spam by other users in Gmail
  • SMTP error response from Google if there is one then fix if there isn’t, check that messages are indeed being forwarded if they are, then Google thinks you’re a spammer and doesn’t talk to your server.
  • email envelope

Thanks! I’ve already started looking into several of these and so far everything checks out fine (no blacklist listings, SPF, DKIM, and DMARC set correctly, etc.).

I’m trying to focus my investigation on this error code, as I’m not familiar with it or what is means (even after doing a google search). If anyone has expertise on this particularly, it would be very helpful to understand what this means and why it’s happening…

SMTP error from remote mail server after pipelined end of data

Yes true but mainly for a reason.

Thanks to the world of a few major big parties and the fact that senders of email is faked easily and a lot spammers and phishers forwarding email is almost impossible unless it on the same domain / server. And Experia has there spf records probably set up.

https://help.directadmin.com/item.php?id=471

And so on…

Option might be setting up:

If you have solved the issue feel free to submit a pull request but I think it will be hard to solve.

Thanks for the articles Eris. Some good reading in there. I’m not sure how to interpret the SRS document though. Obviously the best approach is just to pay google their $6/user to host the email/domain through them and then completely shutdown the mail server all together on my hestiacp server, which is probably the direction I will go. But that also requires a lot of legwork and learning google’s workspace admin center, updating DNS, testing and other. It’s on my list of to-dos, just not something I want to do (can do) right now.

Unlike the user in the serverfault example, I’m not having this issue with 99.999% of emails being forwarded. Gmail is having no problem passing along all the various emails from different sources (including some spam and junk emails) through my server/IP to my email accounts of myself and several other users I have configured on the server. It’s just this one particular email from Expedia. So I’m just trying to figure out why this one domain/email is having an issue, so that I can go back to using this server as-is, until I just move away from using the mail server completely (which I of course want to do, as it will dramatically reduce the load on the server and resources).

In fact, I have already worked around the issue of receiving the email from Expedia by just using my gmail address to create the account, but it hasn’t solved the issue or identified why it was an issue in the first place, so I would like to solve that, not only for myself, but anyone else that comes across this thread with the same issue.