View previous topic :: View next topic |
Author |
Message |
cybernaut n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/13711325223f52a5c1e50bf.gif)
Joined: 01 Sep 2003 Posts: 6
|
Posted: Mon Sep 01, 2003 12:16 am Post subject: Hacking sendmail |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
cybernaut n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/13711325223f52a5c1e50bf.gif)
Joined: 01 Sep 2003 Posts: 6
|
Posted: Thu Sep 04, 2003 8:52 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
cuban Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/190766921344a29f7f3b808.png)
Joined: 23 Aug 2003 Posts: 448 Location: Houston, TX
|
Posted: Mon Jan 03, 2005 9:27 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
spinez n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Mar 2003 Posts: 58
|
Posted: Wed Jan 05, 2005 3:13 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
bone Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/BaldursGate/baldursgate2_anomen.gif)
Joined: 07 Jun 2002 Posts: 255 Location: Midwest, USA
|
Posted: Fri Jan 07, 2005 12:26 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|
|
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
|
|