Sendmail, configure for no hostname in from.
Hi, we have a big problem at our site. The folks that handle the smtp gateway set it up so that it rejects email from an unknown domain.i.e. root@hostname.domain. The gateway does not recognize hostname.domain. If I could configure sendmail on our unix servers to send only user@domain, then the mail would go through.
Question: how can I configure send mail to not use the hostname when it sends mail? Also, how can I configure it to point to a specific relay server?
Thanks, Mike michael.parry.ctr@edwards.af.mil
[533 byte] By [
parrym] at [2007-11-26 10:47:31]

# 6
Rober, thanks for your inputs. Here's what I have come up with that seems to work.
Description:
This is the fix for sendmail that will allow the following functionality:
1. Send mail only, not receive (security stuff)
2. Send the domain name only for both root and other accounts. i.e. not root@myserver.bob.com, but
root@bob.com.
3. Send mail specifically to a defined relay, in this case peter.bob.com, which is the firewall.
Fix:
Create and mod a new mc file.
cd /usr/lib/mail/cf
cp main.mc mymain.mc
vi mymain.mc, add the following lines:
DOMAIN(`mydomain')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
define(`SMART_HOST',peter.bob.com)
MASQUERADE_AS(bob.com)
FEATURE(`allmasquerade')
FEATURE(`masquerade_envelope')
Make sure you change the DOMAIN to mydomain from solaris-generic.
mymain.mc should look like this:
divert(0)dnl
VERSIONID(`@(#)main.mc 1.5 (Sun) 08/10/00')
OSTYPE(`solaris8')dnl
DOMAIN(`mydomain')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
define(`SMART_HOST',peter.bob.com)
MASQUERADE_AS(bob.com)
FEATURE(`allmasquerade')
FEATURE(`masquerade_envelope')
MAILER(`local')dnl
MAILER(`smtp')dnl
Remove the EXPOSED_USER root.
cd /usr/lib/mail/domain
cp generic.m4 mydomain.m4
vi mydomain.m4 and delete the EXPOSED_USER(`root') line.
mydomain.m4 will look like this:
divert(0)
VERSIONID(`$Id: generic.m4,v 8.15 1999/04/04 00:51:09 ca Exp $')
define(`confFORWARD_PATH', `$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z/.forward')dnl
define(`confMAX_HEADERS_LENGTH', `32768')dnl
FEATURE(`redirect')dnl
FEATURE(`use_cw_file')dnl
cd /usr/lib/mail/cf
Make a new cf file.
/usr/ccs/bin/make mymain.cf
cp mymain.cf /etc/mail/sendmail.cf
Stop and start sendmail.
/etc/init.d/sendmail stop
/etc/init.d/sendmail start
Test
mailx -v -s"test" yourname@bob.com < /dev/null