LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 09-06-2007, 11:24 AM   #1
prn
Member
 
Registered: Apr 2005
Location: Muncie, IN, USA
Posts: 58

Rep: Reputation: 16
Generating sendmail.cf from sendmail.mc


Hi folks,

Sorry for the long question, but after all, it's sendmail.

I'm trying to set up sendmail to masquerade my workstation as my domain. That is, I am prn@foo.bar.com (actual addresses obviously changed for spam protection ) and I want my mail to go out as prn@bar.com. So far that seems like a fairly standard thing to do. In fact, I have done it successfully with other (Solaris) systems.

With sendmail version 8.3.8-2 on FC6, I have edited my sendmail.mc file to include the lines:

Code:
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`bar.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(bar.com)dnl
Now I run m4 with the command:
Code:
m4 sendmail.mc >sendmail.cf
and it does create a new sendmail.cf file for me, but there is no
DMbar.com
line, and certainly no other lines relating to masquerading.

I DO have the sendmail-cf package, viz:
Code:
# rpm -qa | grep sendmail
sendmail-cf-8.13.8-2
sendmail-8.13.8-2
I have also tried to add the line:
Code:
DMbar.com
directly into my sendmail.cf and then I have restarted sendmail (with "/etc/init.d/sendmail restart"). My only "exposed user" is root, either in the .mc file or in the .cf file, but my test messages still arrive as being from prn@foo.bar.com instead of prn@bar.com. I presume that the other features may have something to do with this, but I'm not sure how to add things like "masquerade_envelope" or "masquerade_entire_domain" to the sendmail.cf file directly.

The "headers" in sendmail.cf that show which files from /usr/share/sendmail-cf/feature have been included in the processing list things like mailertable.m4 and redirect.m4, but do not include masquerade_entire_domain.m4 or masquerade_envelope.m4 (which seems somewhat logical since it perversely doesn't seem to be doing the basic masquerading at all).

Ideally, of course, I'd much rather edit sendmail.mc (as the headers of sendmail.cf say I should) and let m4 do the heavy lifting, but in a less than ideal world I may have to be satisfied with editing sendmail.cf if that can be made to work. But the basic question is why m4 is ignoring the "MASQUERADE_AS" line in the first place.

Any clues gratefully accepted.
Thanks,
Paul
 
Old 09-06-2007, 11:32 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
The header for my sendmail.mc in FC6 says:

Quote:
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # make -C /etc/mail
dnl #
Why don't you give that a try?
 
Old 09-06-2007, 11:58 AM   #3
prn
Member
 
Registered: Apr 2005
Location: Muncie, IN, USA
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by macemoneta View Post
The header for my sendmail.mc in FC6 says:

Code:
dnl # make -C /etc/mail
Why don't you give that a try?
I forgot to mention that I had tried that also. It does the same thing, i.e., making sendmail.cf from sendmail.mc with the same command. (The Makefile obviously does some other things too, but that's the relevant one.)

So, no luck.

Thanks anyway.

Best Regards,
Paul
 
Old 09-06-2007, 12:06 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
You'll also need:

Code:
define(`SMART_HOST',`mail.bar.com')dnl
(or whatever your upstream email server is called).
 
Old 09-06-2007, 12:29 PM   #5
prn
Member
 
Registered: Apr 2005
Location: Muncie, IN, USA
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by macemoneta View Post
You'll also need:

Code:
define(`SMART_HOST',`mail.bar.com')dnl
(or whatever your upstream email server is called).
Are you sure I need that? I don't want an upstream server getting into the act here. I just want to send the mail directly from the Linux box, not through the exchange server.

As a matter of fact, another (Solaris) box that seems to do the right thing definitely does not have SMART_HOST defined. Its sendmail.cf has:
Code:
# "Smart" relay host (may be null)
DS
In any case, I know that the Linux box can send email, it's just not masquerading.

Thanks,
Paul
 
Old 09-06-2007, 09:56 PM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
You don't need the smart_host if you have no upstream email server. I just noticed that you have the required statement commented out:

Code:
dnl MASQUERADE_AS(`bar.com')dnl
should be:

Code:
MASQUERADE_AS(`bar.com')dnl
 
Old 09-07-2007, 07:23 AM   #7
prn
Member
 
Registered: Apr 2005
Location: Muncie, IN, USA
Posts: 58

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by macemoneta View Post
I just noticed that you have the required statement commented out:

Code:
dnl MASQUERADE_AS(`bar.com')dnl
should be:

Code:
MASQUERADE_AS(`bar.com')dnl
DOH! Of course! I completely spaced out on that! I was thinking of and questioning everything but the obvious.

Thanks,
Paul
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail config questions + Sendmail not reflecting changes to access db wbuik Linux - Networking 2 03-26-2009 05:02 AM
Sendmail ignores my sendmail smarthost entry Paul_assheton Linux - General 1 03-17-2009 07:55 AM
sendmail is not working & on $prompt the cmd sendmail hangs Pavan mahoorker Linux - Software 1 04-04-2006 03:57 PM
php+ sendmail no good - python + sendmail ok nephish Linux - Networking 1 10-07-2005 01:19 PM
Sendmail - RunAsUser=sendmail:mail/What files to i have to change ForumKid Linux - Security 45 01-18-2002 11:47 AM


All times are GMT -5. The time now is 01:16 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration