Following the advice in this answer and the steps listed here, I've added the following to my /etc/mail/sendmail.mc
file and compiled it with m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
. The end of.mc file itself:
dnl # Default Mailer setup
dnl # Masquerading options
FEATURE(`always_add_domain')dnl
MASQUERADE_AS(`debian')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
I created the /etc/mail/generics-domains
file with:
mylinodeboxdomain.com
avirtualdomain.com
And created the /etc/mail/genericstable
file with:
virtualuser noreply@avirtualdomain.com
And restarted the sendmail service. Despite that, emails sent by virtualuser
still seem to be coming from virtualuser@localhost
rather than the desired noreply@avirtualdomain.com
:
Received: from www.avirtualdomain.com (virtualuser@localhost)
by mylinodeboxdomain.com (8.15.2/8.15.2/Submit) with SMTP id x6QIOIYY002415
for ; Fri, 26 Jul 2019 14:24:18 -0400
I'm guessing my config is messed up, but as this is all new to me, I'm unsure what to change/remove.
No comments:
Post a Comment