Google Mail 550 5.7.1 Blocking delivery of all email from server

I have been receiving the following response to any email I send to any Google mail server (g-suite or gmail) which originates from my virtualmin server.

<xxx@gmail.com>: host
    gmail-smtp-in.l.google.com[2a00:1450:400c:c00::1b] said: 550-5.7.1
    [2a02:c205:2010:3724::1      12] Our system has detected that this
    550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam
    sent 550-5.7.1 to Gmail, this message has been blocked. Please visit
    550-5.7.1  https://support.google.com/mail/?p=UnsolicitedMessageError 550
    5.7.1  for more information. p9si4077583wmc.109 - gsmtp (in reply to end of
    DATA command)

This started after I had an issue with a customers shared server where the customer moved their hosting to Shopify but retained their shared hosting account on my server for email. Somehow one of their email addresses got compromised and thousands of spam emails were being sent via my server. I tried various options to block the spam but eventually I had to move the customer to G-Suite. I then disabled mail delivery on the virtual server and spam emails since stopped.

However my server IP was listed on various blacklists, most of them have since been removed and my server IP reputation has improved significantly although not perfect yet. As a result I have added a second IP address for my server.

I would like to switch to this different IP address for email delivery for all virtual servers. What options do I need to change on Virtualmin / Postfix to do switch of IP address?

Edit: I realize my post may seem as if I have not done any research on this. I have indeed searched other issues but I am yet to find any posts where someone has wanted to add a 2nd IP, configure postfix to use it and modify all virtual servers to send mail using this modified setup. It is possible that just adding the 2nd IP and modifying Postfix is all I need to do, if so, please confirm it is so.

Other similar issues researched:

https://virtualmin.com/node/38134 https://virtualmin.com/node/43462 https://virtualmin.com/node/24353

SPF: checked and all is correct DKIM: checked and all correct rDNS: checked and all correct Spam: IP address not Blacklisted mail-tester.com score: 10/10

Status: 
Closed (fixed)

Comments

Howdy -- thanks for contacting us!

If you'd like to use a different IP address for sending emails, while Virtualmin doesn't have a simple way to configure this for you, you can do it by changing the outgoing IP address in Postfix.

You can do that by editing /etc/postfix/main.cf, and adding a line such as this:

smtp_bind_address = x.x.x.x

Then, restart Postfix with "service postfix restart".

After that, any newly sent mail would go out through that new IP. Note that at that point, you'd need to adjust the IP's used in any of your SPF records.

The problem was eventually resolved without the above step. But I did the above anyway. Thanks for the assistance.

resolved itself