Operating System - Linux
1838725 Members
6565 Online
110129 Solutions
New Discussion

Sendmail: Changing From field based on user

 
Chris H_3
Advisor

Sendmail: Changing From field based on user

Hi all,

Is there a way to change who a message appears to be coming from? I have two sendmail servers internally, one is our main and the other just receives mail for certain distributions and webmail users. For an incoming mail on the distribution server (version 8.12.11), I'd like to change the From field to something else for a couple admin users when they send from our main server (version 8.12.8). Is this possible? I remember reading something like this a while ago but can't seem to find anything at the moment, or am not understanding what I'm reading, which is most likely the case :)

I guess in a nutshell, all I want to do is change what the recipient (on distro server) sees in the From field to 'User X' instead of it showing 'User Y', the actual sender.

Thanks for any tips!
CH
1 REPLY 1
Steven E. Protter
Exalted Contributor

Re: Sendmail: Changing From field based on user

There are several ways.

You can put an entry in the /etc/aliases file

localuser: someone@some.net


You can create alias users in the /etc/mail/virtusertable and /etc/mail/genericstable and build databases that handle it.

You can even script it like the spammers(and sysadmins that have a real need) do and just say from:userX and the mail will appear to come from that user, wheter or not the user exists.

The reasoning and knowledge behind these concepts is at http://www.sendmail.org

To do /etc/aliases or the virtuser thing you need to compile macro database and rebuild the sendmail.cf file. The compile is based on the sendmail.mc file, concept again explained at sendmail.org.

I am attaching an overly complex example of my antispam sendmail.mc macro build script, but the essentials are there. It may be easier to hunt one down at the sendmail site, your choice.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com