# email default domain



## Akira (May 9, 2011)

I have a very odd problem with sendmail on a FreeBSD box. I changed the hostname of the aforementioned server and sendmail doesn't use the new
hostname as a default domain for the emails, it keeps using the old one. The interesting thing is that banner and header use the new
hostname! I even had to add the old domain in the local-host-names because sendmail was complaining of the fact it did not exist! This
thing is driving me crazy, can anyone help me?

Sendmail configuration file.


```
dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')

dnl Enable for both IPv4 and IPv6 (optional)
DAEMON_OPTIONS(`Name=IPv4, Family=inet')
DAEMON_OPTIONS(`Name=IPv6, Family=inet6, Modifiers=O')

define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')

dnl set SASL options
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN')dnl

define(`confTO_QUEUERETURN', `1d')dnl
define(`confTO_QUEUERETURN_NORMAL', `1d')dnl
define(`confTO_QUEUERETURN_URGENT', `6h')dnl
define(`confTO_QUEUERETURN_NONURGENT', `15d')dnl
define(`confTO_QUEUERETURN_DSN', `6h')dnl
define(`confTO_QUEUEWARN', `6h')dnl
define(`confTO_QUEUEWARN_NORMAL', `6h')dnl
define(`confTO_QUEUEWARN_URGENT', `1h')dnl
define(`confTO_QUEUEWARN_NONURGENT', `1d')dnl
define(`confTO_QUEUEWARN_DSN', `1d')dnl

define(`confMAX_MESSAGE_SIZE',20971520 )

dnl FEATURE(accept_unresolvable_domains)dnl
FEATURE(`greet_pause', `0')dnl

dnl FEATURE(`masquerade_envelope')dnl
dnl FEATURE(`masquerade_entire_domain')dnl
dnl MASQUERADE_AS(`bender.mydomain.com')dnl
dnl MASQUERADE_DOMAIN(`bender.mydomain.com')dnl

dnl FEATURE(local_procmail)dnl
dnl FEATURE(`local_procmail', `/usr/local/bin/procmail',
`/usr/local/bin/procmail -d $u')dnl
dnl MODIFY_MAILER_FLAGS(`LOCAL', `-f')
FEATURE(`local_procmail', `/usr/local/bin/maildrop_wrapper',
`/usr/local/bin/maildrop_wrapper -w 90 -d $u')dnl
dnl MAILER(procmail)dnl

MAILER(local)
MAILER(smtp)

define(`CERT_DIR', `/etc/ssl/certs')dnl
define(`confCACERT_PATH', `CERT_DIR')dnl
define(`confCACERT', `CERT_DIR/mail.mydomain.com.cer.pem')dnl
define(`confSERVER_CERT', `CERT_DIR/mail.mydomain.com.cer.pem')dnl
define(`confSERVER_KEY', `CERT_DIR/mail.mydomain.com.pem')dnl
define(`confCLIENT_CERT', `CERT_DIR/mail.mydomain.com.cer.pem')dnl
define(`confCLIENT_KEY', `CERT_DIR/mail.mydomain.com.pem')dnl
dnl DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl

define(`confMILTER_MACROS_HELO', confMILTER_MACROS_HELO`, {verify}')dnl
INPUT_MAIL_FILTER(`smfsav', `S=unix:/var/run/smfsav/smfsav.sock,
T=S:30s;R:4m')dnl
```


----------



## Akira (May 9, 2011)

LOL. The problem was that the new host was a CNAME of the old A record. Erased the CNAME, created the A record and all worked like a charm.


----------

