Sendmail sending as host.domain.com, I want it to be from just domain.com, How do I configure?

Posted by Jiltin     25 June, 2009    1,773 views   

Currently, after I setup the sendmail, the emails are going as user@host.domain.tld (or user@host.domain.com) instead of user@domain.tld (or user@domain.com). How do I configure the sendmail so that the mails reach as user@domain.tld?

Answer:

Edit /etc/mail/local-host-names or create a /etc/mail/local-host-names if you do not have one

Add yourdomain.com like this as your first entry and have the other hosts from the next lines

# local-host-names – include all aliases for your machine here.
notesbit.com
deep.notesbit.com
www.notesbit.com
win.notesbit.com
mail.notesbit.com

This is not sufficient. You need to check and entry in /etc/hosts that the first entry yourdomain.com (notesbit.com) with 127.0.0.1 and other entries afterwords.

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 notesbit.com master.notesbit.com master www.notesbit.com deep.notesbit.com win.notesbit.com mail.notesbit.com localhost.localdomain localhost

Restart Sendmail

#service sendmail restart

check the system with sample email

#mail -s “test sendmail” webmaster@notesbit.com < /etc/mail/local-host-names

Or wherever you want to test the email

References:
http://www.faqs.org/docs/securing/chap22sec180.html
http://www.freebsd.org/doc/en/books/handbook/sendmail.html
http://www.linuxquestions.org/questions/linux-software-2/sendmail-sending-as-host.domain.com-i-want-it-to-be-from-just-domain.com.-177447/

Following Google Searches Lead To This Post:
how to check sendmail on linux host

Following Google Searches Lead To This Post: POST _FILES check

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Unix, Web & Scripts Tags :

Comments

No comments yet.


Leave a comment

(required)

(required)