Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hacking sendmail
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cybernaut
n00b
n00b


Joined: 01 Sep 2003
Posts: 6

PostPosted: Mon Sep 01, 2003 12:16 am    Post subject: Hacking sendmail Reply with quote

For the sendmail gurus....
How do I make sendmail rewrite the outgoing mail address from user@mailserver.somedomain.net to just user@somedomain.net? I would like all of the e-mails sent through my mail server to look like they come from the domain rather than the internal hosts.

Here's my sendmail.mc ATT:

Code:
divert(-1)
#
#
divert(0)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc,v 1.2 2002/07/04 04:55:29 g2boojum Exp $')dnl
OSTYPE(linux)dnl
DOMAIN(generic)dnl
define(`confDEF_USER_ID',``8:12'')dnl
define(`confPRIVACY_FLAGS', `authwarnings,needmailhelo,noexpn,novrfy')dnl
define(`confSMTP_LOGIN_MSG', `Mail Server 1.0')dnl
define(`LOCAL_MAILER_PATH',
        ifelse(defn(`_ARG_'), `',
                ifdef(`PROCMAIL_MAILER_PATH',
                        PROCMAIL_MAILER_PATH,
                        `/usr/local/bin/procmail'),
                _ARG_))
define(`LOCAL_MAILER_ARGS',
        ifelse(len(X`'_ARG2_), `1', `procmail -Y -a $h -z', _ARG2_))
define(`LOCAL_MAILER_FLAGS',
        ifelse(len(X`'_ARG3_), `1', `PSXhmnz9', _ARG3_))
define(`LOCAL_MAILER_DSN_DIAGNOSTIC_CODE', `SMTP')
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`confTO_IDENT', 0s)
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
FEATURE(nouucp, `reject')
FEATURE(`mailertable', `hash /etc/mail/mailertable')dnl
FEATURE(`virtusertable', `hash /etc/mail/virtusertable')dnl
FEATURE(`access_db')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
MASQUERADE_AS(`somedomain.net')dnl
MASQUERADE_DOMAIN(`localhost')dnl
MASQUERADE_DOMAIN(`somedomain.net')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
MAILER(local)dnl
MAILER(smtp)dnl


Everything else works fine. I not afraid the hack the sendmail.cf if I have to, but if there's a way to do it through the sendmail.mc, I'd prefer it. I've already hacked the source code and the sendmail.cf file to strip the outbound header between the client and the mailserver.

Thanks
Cybernaut
Back to top
View user's profile Send private message
cybernaut
n00b
n00b


Joined: 01 Sep 2003
Posts: 6

PostPosted: Thu Sep 04, 2003 8:52 pm    Post subject: Reply with quote

I found my own fix after a lot of digging...

Edit the sendmail.mc and add:
Code:
define(`confDOMAIN_NAME', `$m')dnl


This forces all outgoing headers to show user@somedomain.net
Back to top
View user's profile Send private message
cuban
Guru
Guru


Joined: 23 Aug 2003
Posts: 448
Location: Houston, TX

PostPosted: Mon Jan 03, 2005 9:27 pm    Post subject: Reply with quote

This isn't working. Is there something else I need to do besides restarting sendmail?
_________________
Tell your ISP to support SPF/SASL AUTH (http://spf.pobox.com) today!
Back to top
View user's profile Send private message
spinez
n00b
n00b


Joined: 30 Mar 2003
Posts: 58

PostPosted: Wed Jan 05, 2005 3:13 pm    Post subject: Reply with quote

hrm, im by no means a sendmail guru, but in my sendmail.mc file, i have the following:

Code:
MASQUERADE_AS(domain.com)dnl

which i believe does the trick for me.
Back to top
View user's profile Send private message
bone
Apprentice
Apprentice


Joined: 07 Jun 2002
Posts: 255
Location: Midwest, USA

PostPosted: Fri Jan 07, 2005 12:26 am    Post subject: Reply with quote

spinez wrote:
hrm, im by no means a sendmail guru, but in my sendmail.mc file, i have the following:

Code:
MASQUERADE_AS(domain.com)dnl

which i believe does the trick for me.


Also note, that by default. this will not masq the domain of root unless you muck with the sendmail.cf a tad bit further and comment out the following line
C{E} root

The reason I state this is I did not think my masq was working correctly because i was testing from user root.

jt
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum