1

I'm attempting to use Google G Suite to host some email addresses but not all.

I currently have a server hosting my domain and the MX server for this domain. There are no local email account, everything is forwarded to other email addresses via virtusertable.

What I'd like is for the MX entry to remain the same, but the mail to [email protected] be forwarded to gmail's [email protected] address.

G Suite has an entry on how this could be done there: https://support.google.com/a/answer/60730?hl=en

The most useful description however is "Configure the inbound mail gateway server to deliver mail to the G Suite mail servers. The configuration steps differ depending on the gateway server."

So I'd like to do this with sendmail (sorry all habits, I've been carrying that config for close to two decades, and I can't be bothered learning another MTA)

Something like in the virtusertable like: [email protected] MX:[email protected]@GOOGLE_SMTP_SERVER_IP

Any ideas on how this could be done, and if it can be done with sendmail?

thank you

2
  • You want to forward messages addressed [email protected] to GOOGLE_SMTP_SERVER_IP without changing envelope recipient (RCPT TO: in SMTP session), don't you?
    – AnFi
    Jul 26, 2017 at 12:30
  • That's exacly right. The G sync recipient address being the same as the one the MX entry getting.
    – jyavenard
    Jul 26, 2017 at 13:42

1 Answer 1

1

Sendmail: Redirect SOME addresses in the domain to another host without changing envelope recipient

You may use FEATURE(ldap_routing).
It may be used without ldap lookups. It can use standard sendmail maps (hash/btree/...) instead.

sendmail.mc fixes (compile it into sendmail.cf and restart or HUP sendmail daemon):

LDAPROUTE_DOMAIN(`example.com')dnl
FEATURE(`ldap_routing',`hash /etc/mail/mailhost',`null')dnl

null map returns always "not found" - I have used as map rewriting recipient address

/etc/mail/mailhost file (requires compilation with makemap hash mailhost):

[email protected]  [GOOGLE_SMTP_SERVER_IP]

[] around IP address turn off lokkup for MX records.


Testing

It should be conducted by root in typical sendmail installation.

# check where sendmail would deliver emails for [email protected] 
sendmail -bv [email protected]
# as above but with tracking map lookups including mailhost map
sendmail -d60.5 -bv [email protected]
# worst case debug procedure - tracking R lines processing in sendmail.cf
echo '3,0 [email protected]' | sendmail -d60.5 -d21.12 -bt
1
  • Absolutely awesome. Worked first go. I owe you a beer !
    – jyavenard
    Jul 26, 2017 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .