LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   configure sendmail to send using mydomain.com (http://www.linuxquestions.org/questions/%2Absd-17/configure-sendmail-to-send-using-mydomain-com-743782/)

speederpro 07-29-2009 05:53 PM

configure sendmail to send using mydomain.com
 
Hello all,

I want to configure sendmail to send mail as username@mydomain.com on my new freebsd.

When I send an email from command line, the recipient receive the email from username@host.mydomain.com instead of username@mydomain.com

What do I need to change to make the "from" appear as username@mydomain.com?

Thanks in advance.

speederpro 07-31-2009 04:13 PM

Yeah, I found the solution.

For those who are looking for the same solution as me.

# cd /etc/mail
# make
# vi host.mydomain.com.mc

Change From: DOMAIN(generic)

Change To: DOMAIN(`mydomain.com')dnl

# cd /usr/share/sendmail/cf/domain
# cp generic.m4 mydomain.com.m4
# vi mydomain.com.m4
# echo "FEATURE(`masquerade_entire_domain')dnl" >> mydomain.com.m4
# echo "FEATURE(`masquerade_envelope')dnl" >> mydomain.com.m4
# cd ../feature
# echo "MASQUERADE_AS(`westsideweekly.com')dnl" >> masquerade_entire_domain.m4
# cd /etc/mail
# make
# make install
# make restart

Voila. You are done. Any mail sent via command line will appear as from username@mydomain.com.

cheers,


All times are GMT -5. The time now is 05:07 PM.