How to instruct sendmail not to prepend email addresses with the local user's name?
1
vote
0
answers
43
views
Having installed
sendmail
, I added
define(MAIL_HUB',
mydomain.com.')dnl
define(LOCAL_RELAY',
mydomain.com.')dnl
to .mc
and recompiled. Now the delivery to myself@mydomain.com
fails because sendmail
prepends the address with my local Linux user name. It adds myusername@
and on the 1st attempt it tries to deliver to myusername@myself@mydomain.com
, and on the 2nd attempt it tries myusername@mydomain.com
.
What settings do I have to add, to instruct it to send to whatever email address I need to?
The purpose of this is to only ever send to this one address/domain because this is a web server box whose sole purpose is to deliver 2FA emails to admin of the site that it hosts and to nowhere and no one else, all on my LAN. I presume that when PHP will begin to send those emails addresses would be prepended with www-data@
. In theory it is probably possible to set that up as an alias to myself, on the SMTP server, but I am not sure the web site will allow me to enter just mydomain.com
for the admin's email address. It will probably prevent me from doing it by validating against some email regex.
Asked by SuperAl
(151 rep)
Apr 15, 2025, 11:20 PM