<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>JackKozik.com &#187; sendmail</title> <atom:link href="http://jackkozik.com/tag/sendmail/feed" rel="self" type="application/rss+xml" /><link>http://jackkozik.com</link> <description>Web Programming, Home Networking and Personal Travel</description> <lastBuildDate>Mon, 04 Sep 2023 14:26:56 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.9.2</generator> <item><title>Fedora sendmail setup. Tips for hosts/domains and masquerading.</title><link>http://jackkozik.com/fedora-sendmail-setup/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fedora-sendmail-setup</link> <comments>http://jackkozik.com/fedora-sendmail-setup/#comments</comments> <pubDate>Mon, 26 Nov 2012 02:48:22 +0000</pubDate> <dc:creator><![CDATA[Jack Kozik]]></dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[Web Programming]]></category> <category><![CDATA[fedora]]></category> <category><![CDATA[sendmail]]></category><guid isPermaLink="false">http://jackkozik.com/?p=161</guid> <description><![CDATA[<p>Notes on my fedora sendmail setup.  I have had my fedora linux server setup for a couple of years with no email &#8212;  on purpose, to avoid spam hassles.  But to help my blog work better with plugins I decided to get this machine running sendmail. I&#8217;ve done fedora sendmail setup before on another one [&#8230;]</p><p>The post <a rel="nofollow" href="http://jackkozik.com/fedora-sendmail-setup/">Fedora sendmail setup. Tips for hosts/domains and masquerading.</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Notes on my fedora sendmail setup.  I have had my fedora linux server setup for a couple of years with no email &#8212;  on purpose, to avoid spam hassles.  But to help my blog work better with plugins I decided to get this machine running <a href="http://www.sendmail.com/sm/open_source/">sendmail</a>.</p><p>I&#8217;ve done fedora sendmail setup before on another one of my servers, but it had been so long, I had to start from scratch.  I started by finding a good general setup guide.  <a href="https://fedoraproject.org/wiki/Archive:Docs/Drafts/AdministrationGuide/Servers/MailServer/Sendmail?rd=Docs/Drafts/AdministrationGuide/Servers/MailServer/Sendmail">This one on the fedora wiki</a> was most worthy.</p><p>So the instructions were pretty straight forward.  Since I own my domain name and have a static IP address, the setup is easy.  So I followed the instructions and, well, it didn&#8217;t work. My first problem:</p><h2>Fedora Sendmail setup emails bounced, because email is from user@localhost</h2><p>So my first couple of test emails sent to my web account bounced back to me, they looked like this:</p><pre>----- Transcript of session follows -----
... while talking to mx0.gmx.com.:
&gt;&gt;&gt; MAIL From:&lt;root@localhost.localdomain&gt; SIZE=665
&lt;&lt;&lt; 550 5.1.8 Cannot resolve your domain {mx-us004}
554 5.0.0 Service unavailable</pre><p>So I had to figure out why my server was putting userid@localhost.localdomain.  I learned that my /etc/hosts file was setup wrong.  There&#8217;s lots of fedora tips on how to setup your hosts file <a href="http://www.linuxquestions.org/questions/linux-software-2/sendmail-changing-domain-from-localhost-localdomain-409714/">(here&#8217;s a related posting)</a>, mine was setup wrong.  One tip, use the sendmail diagnostic tool, as follows:</p><pre># sendmail -d0.1 -bv root
[...]
 SYSTEM IDENTITY (after readcf) (short domain name) $w = myserver
(canonical domain name) $j = myserver.mydomain.net
       (subdomain name) $m = mydomain.net
            (node name) $k = myserver.mydomain.net
[...]</pre><p>The above is good. Before I debugged my localhost problems, this command showed localhost in each of the domain name lines.  Also, for debugging, I recommend using the mail -vv (two v&#8217;s) command line option.  It&#8217;s easier than looking in the /var/log/maillog file.</p><h2>Next problem: the emails were addressed user@myserver.mydomain.net</h2><p>The emails were working, but the From line should say user@mydomain.net.  I had to relearn how sendmail masquerading worked.  I had to setup the key parameters in the sendmail.mc file, as follows:</p><pre>MASQUERADE_AS(`mydomain.net')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(myserver.mydomain.net)dnl</pre><p>But the masquerading wasn&#8217;t working.  When I went to the<a href="http://www.sendmail.com/sm/open_source/docs/m4/masquerading.html"> official sendmail man page for masquerade</a>, it talked about the EXPOSED_USER option.  By default, sendmail assumes the root user never wants to be masqueraded.  Of course, I was troubleshooting my sendmail setup from the root login, so this option had me thinking something was wrong.  I turned of this option, and finally my fedorda sendmail setup was finished.  It took way longer than I thought it would and I felt it was worth writing up.</p><p>For reference, here&#8217;s what I changed in my sendmail.mc file:</p><pre>define(`confLOG_LEVEL', `9')dnl
dnl EXPOSED_USER(`root')dnl
MASQUERADE_AS(`kozikfamily.net')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(allmasquerade)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MASQUERADE_DOMAIN(kozik2.kozikfamily.net)dnl</pre><p>The post <a rel="nofollow" href="http://jackkozik.com/fedora-sendmail-setup/">Fedora sendmail setup. Tips for hosts/domains and masquerading.</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></content:encoded> <wfw:commentRss>http://jackkozik.com/fedora-sendmail-setup/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>