Problem
I would like to hide the hostname in the origin (From:) line of my mail address using sendmail.
Solution
As root, edit the file /usr/lib/sendmail.cf. Search for an
entry that looks similar to the following:Mlocal, P=/usr/bin/lmail, F=lsFDMPuhCE, S=10, R=20, A=lmail $uLook for the symbol S= in this line. The number to the
right of the "=" refers to the ruleset used to rewrite
the sender address. Now search for the ruleset specified
to the right of the "=" sign (in this case 10). Add the
following lines to the beginning of the specified ruleset
so that it looks similar to the following:S10
R<$*@$*.$D> $:<$1@$D>
R$*@$*.$D $:$1@$DNow, search for an entry that looks similar to the following:
Mtcp, P=[IPC], F=msDFMuCXP, S=14, R=20, A=IPC $h, E=\r\nOnce again, look for the symbol S= in this line. The S=
tells sendmail to rewrite the sender address with the ruleset
specified on the right side. Now search for that ruleset
(in this case 14) and add the following line to the beginning
of the ruleset so it looks similar to the following:S14
R$*@$*.$D $:$1@$DSave and exit this file. You must restart the sendmail
daemon for these changes to take effect. See also
sendmail(ADMN), mail(C)