Operating System - HP-UX
1752793 Members
5963 Online
108789 Solutions
New Discussion юеВ

Re: Problem with masquerading, sendmail -f, and Cw

 
Luis Toro
Regular Advisor

Problem with masquerading, sendmail -f, and Cw

We have a unix application that uses the '-f' option of sendmail to set to a valid exchange email account. On the exchange side, the domain is setup to forward replies back to the unix server, and the unix server treats them as a local since there is a corresponding Cw line for the domain. Example:
Server Zeus is on domain: mycom.com. Email goes out as follows from Zeus:
sendmail -f myunixid@dummydomain.com user@yahoo.com < /file. In the event 'user' no longer exists, email gets routed back to mycom.com, which forwards to Zeus, based on the sender address of myid@dummydomain.com. Since there is a line: Cwdummydomain.com on Zeus, the email gets routed locally to myunixid on thor.
I recently had to modify DM to DMmycom.com, so that other outbound emails reach their destination, and what happened was that the emails from the app now had a sender of "myunixid@mycom.com", which is not a valid exchange account. How can I get around this ?
Thanks
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Problem with masquerading, sendmail -f, and Cw

Shalom Luis,

You say:
I recently had to modify DM to DMmycom.com

I'd like to know why? There may be a better way of accomplishing the goal, save blowing up your configuration as the DM directive does.

Suggestions:

If you use a sendmail macro, take the always add domain option out.

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
Luis Toro
Regular Advisor

Re: Problem with masquerading, sendmail -f, and Cw

Steve,
I modified the DM on all my UNIX servers because emails sent to external accounts were getting rejected due to the invalid domain (ie., @unixservername.mycom.com) in the header. So I updated the DM to masquerade to @mycom.com. (note: on the unix side we're only allowed to send, and not receive external emails, except for this specific example). For this server, if I use the DM, anything sent to domains listed in Cw, get replaced with the DM domain, thereby hosing the app. If I don't use the DM, anything sent externally outside the app, may get rejected due to an invalid domain.
Ivan Ferreira
Honored Contributor

Re: Problem with masquerading, sendmail -f, and Cw

I tried with a test system and changed DM does not affects to sendmail -f, I still can send mails with any domain I want. Try using sendmail -f -C to specify an alternate configuration file.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Luis Toro
Regular Advisor

Re: Problem with masquerading, sendmail -f, and Cw

Ivan,
Try this:
update DM with some domain.
have a Cw line specifying a different domain. Stop/start sendmail (if its running). Then send yourself 2 emails: 1 using the "-f" to set the 'from' address to a 3rd domain name, and for the other use -f to change the the sender address to mimic the domain you specified in the Cw line. From my testing, the first email will look like its coming from the 3rd domain (ie., whatever was entered after the -f). The second email [should] take on the domain from the DM.
Luis Toro
Regular Advisor

Re: Problem with masquerading, sendmail -f, and Cw

I've attached a copy of my sendmail.cf file.
All the updated ar preceeded with a series of #'s and UPDATED (in caps) :
########## UPDATED #########
Thanks
Luis Toro
Regular Advisor

Re: Problem with masquerading, sendmail -f, and Cw

I think I found the solution by utilizing the "class N" (domains that should not be converted to $M). I basically listed the same domains after CN as I had listed in the Cw class, while maintaining the DM definition, and that yielded the proper results.
Thanks to all that replied.