Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you specify the FQDN (Host and Domain Name) that a mail server presents itself as in HELO/EHLO when sending outgoing email with sendmail?

share|improve this question
up vote 10 down vote accepted

I added the following in sendmail.mc:

define(`confDOMAIN_NAME', `mail.foo.com')dnl

and then:

m4 sendmail.mc > sendmail.cf
service sendmail restart

I also verified that this worked with the email verifier service at http://www.port25.com/domainkeys/ (auth-results@verifier.port25.com). Neat service, you send it an email and it replies to the from header with information about your SPF, Domain Keys, etc...

share|improve this answer
    
Word of caution (perhaps common sense but I'll mention it anyway). The value for confDOMAIN_NAME should NOT be an email domain. Setting it to that will cause sendmail to reject messages because it thinks the mailboxes are (or should be) local. – Mike B Jul 7 at 17:29

For completeness - one can also use

define(confHELO_NAME,`something.not.the.same.as.the.domain.name')

if one needs more absolute control (e.g. in a freeb-bsd jail it may be desirable to have the confDOMAIN_NAME and MASQUERADE_AS set very different than the HELO/EHLO names.

Dw.

share|improve this answer

define(confSMTP_LOGIN_MSG',$j; $b')dnl

Also configure /etc/hosts like below

xxx.xxx.xxx.xxx server server.yourdomain.com server 127.0.0.1 server server.yourdomain.com server

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.