Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selective relay with Alias

Status
Not open for further replies.

JeffinTx

IS-IT--Management
Sep 13, 2023
1
US
I have an issue that I imagine others might share. I'll appreciate any insights from the group here!

I have an instance of Postfix and Dovecot up and running just fine. It receives email from outside, including email to Virtual Users and Virtual Alias Users. The Virtual Alias Users forward correctly to either Virtual Users or outside accounts as appropriate. All good!

Like many others, I have discovered that some email systems (most notably Gmail and Outlook but certainly others as well) will not accept email from my system because its IP is a home account, even though it is mapped correctly in MX records and updated with DDNS. So, I have included a REGEX in my Transport Maps to route selected recipient domains through an SMTP Relay provider (Sendgrid in my case). I don't want everything going through the relay, only things that need to per my Transport Map.

google.com smtp:[smtp.sendgrid.net]:587
.google.com smtp:[smtp.sendgrid.net]:587
*@gmail.* smtps:[smtp.sendgrid.net]:465
/.*@gmail.*/i smtps:[smtp.sendgrid.net]:465​

As this only affects outgoing mail, I tested several scenarios and found that only some work.

+Good :) Virtual Users sending to an external google.com or gmail.com correctly route through the relay provider.
-No Good :) Virtual Users sending to a Virtual Alias User, whose real email forwards to google.com or gmail.com DO NOT route correctly.​

I suspect that the Transport Map process is looking only at the Virtual Alias User address, which is not google.com or gmail.com. My regex in the above examples may not be great, but that shouldn't make a difference in routing, should it?

Any ideas from anyone on how I could fix this or handle it differently?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top