1752810 Members
5972 Online
108789 Solutions
New Discussion юеВ

Sendmail Question

 
SOLVED
Go to solution
Pete G
Advisor

Sendmail Question

Hi all,

I am trying to make a system account generated email seem to come from a DL in outlook. For example, the email sends as bot@FQDN and I am trying to make it send as list.something@company.com. The company.com part is easy. I even set up userdb to alias bot to list.something. The problem is even in the header, if you follow the submission, you can still see bot@company.com. When I send send using sendmail -f list.something@company.com it works flawlessly. So my question is really what am I doing wrong and how can I make what I do with the -f switch in sendmail permanent on the host to ensure the mail is sent as I want it?

Any help, as always, is greatly appreciated. The hosts are mostly HP-UX and some Solaris 10.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Sendmail Question

Shalom,

This is merely a configuration and m4 compile of the sendmail.cf file. The documentation for this is on http://www.sendmail.org

Search for masquerade and such.

sendmail works in a little bit of a non-standard way with HP-UX.

http://www.hpux.ws/buildmail.hpux.text

That is a good script to show how to compile your changes.

Making this work is pretty simple.

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
Pete G
Advisor

Re: Sendmail Question

I neglected to mention i did an m4 rebuild so that I could use the generics table. I tried with userdb and generics. Put the new sendmail.cf in place, stop/started but still no workie. Thanks.
Mel Burslan
Honored Contributor

Re: Sendmail Question

When you say system account generated email, does this mean root or some other non-administrative account ? If you are dealing with root generated messages, did you check the CE section of the sendmail.cf ? Is the account you are sending the mail from, located in this section ? If so, it can explain why the masquerading is not working.
________________________________
UNIX because I majored in cryptology...
Pete G
Advisor

Re: Sendmail Question

The one I am working on currently is not for root. I will be dealing with those shortly and I believe they have a default I need to overide. Thanks.
Doug O'Leary
Honored Contributor
Solution

Re: Sendmail Question

Hey;

The problem with masquerading is that it will masquerade *everything*. If that's what you want, then have at it.

The generics table is used to rewrite the sender's address. The format is pretty simple:

# cat genericstable
root rootusr3db16@myco.com

Any email coming off that system as root will be rewritten to rootusr3db16@myco.com

(Don't ask; it's a long story on why I have to rewrite root's email...)

Run "grep generic /etc/mail/sendmail.cf"; if you see

Kgenerics hash /etc/mail/genericstable

sendmail is already configured to use the generics table. If not, you will have to generate a new sendmail config file using the m4 command

FEATURE(`genericstable')dnl

Once configured, edit the generics table as described above, then execute:

makemap hash genericstabe < genericstable

while in the /etc/mail directory.

You shouldn't have to restart sendmail. Once done, using the example above:

sendmail -v oleary@myco.com << eof
Subject: testing
eof

[[ connect string snipped ]]

250 2.0.0 Verbose mode
>>> MAIL From: SIZE=17
250 2.1.0 ... Sender ok
>>> RCPT To:
>>> DATA
250 2.1.5 ... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .

And you should be set.

HTH;

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html