<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tyk.wiki/index.php?action=history&amp;feed=atom&amp;title=Masquerading_domains_with_Sendmail</id>
	<title>Masquerading domains with Sendmail - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tyk.wiki/index.php?action=history&amp;feed=atom&amp;title=Masquerading_domains_with_Sendmail"/>
	<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;action=history"/>
	<updated>2026-05-10T14:24:39Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=83&amp;oldid=prev</id>
		<title>Tykling: /* Make a new .mc file */</title>
		<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=83&amp;oldid=prev"/>
		<updated>2009-07-07T16:26:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Make a new .mc file&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:26, 7 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l13&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ sudo cp /usr/src/etc/sendmail/freebsd.mc /usr/src/etc/sendmail/freebsd-masq.mc&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ sudo cp /usr/src/etc/sendmail/freebsd.mc /usr/src/etc/sendmail/freebsd-masq.mc&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&#039;&#039;Note: If you already have a non-standard .mc file that your current sendmail.cf file is built from, you need to add the new line to that .mc file and not a copy of the default .mc file, or you will loose your other changes!&#039;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It doesn&amp;#039;t matter what you call the new .mc file. Open it up in an editor and add the following lines in the bottom (replacing &amp;#039;&amp;#039;example.com&amp;#039;&amp;#039; with your own domain, of course):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It doesn&amp;#039;t matter what you call the new .mc file. Open it up in an editor and add the following lines in the bottom (replacing &amp;#039;&amp;#039;example.com&amp;#039;&amp;#039; with your own domain, of course):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tykling</name></author>
	</entry>
	<entry>
		<id>https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=80&amp;oldid=prev</id>
		<title>Tykling: /* Compiling the new sendmail.cf file */</title>
		<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=80&amp;oldid=prev"/>
		<updated>2009-07-07T15:26:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Compiling the new sendmail.cf file&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:26, 7 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot;&gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To compile the new configuration file, enter the following command while still in &amp;#039;&amp;#039;/usr/src/etc/sendmail&amp;#039;&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To compile the new configuration file, enter the following command while still in &amp;#039;&amp;#039;/usr/src/etc/sendmail&amp;#039;&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$ pwd&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/usr/src/etc/sendmail&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ sudo make freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$ sudo make freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rm -f freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;rm -f freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;m4 -D_CF_DIR_=/usr/src/etc/sendmail/../../contrib/sendmail/cf/   /usr/src/etc/sendmail/../../contrib/sendmail/cf/m4/cf.m4 /usr/src/etc/sendmail/freebsd-masq.mc &amp;gt; freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;m4 -D_CF_DIR_=/usr/src/etc/sendmail/../../contrib/sendmail/cf/   /usr/src/etc/sendmail/../../contrib/sendmail/cf/m4/cf.m4 /usr/src/etc/sendmail/freebsd-masq.mc &amp;gt; freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;chmod 444 freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;chmod 444 freebsd-masq.cf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tykling</name></author>
	</entry>
	<entry>
		<id>https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=79&amp;oldid=prev</id>
		<title>Tykling at 15:23, 7 July 2009</title>
		<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=79&amp;oldid=prev"/>
		<updated>2009-07-07T15:23:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:23, 7 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:sendmail]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:sendmail]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This article outlines the method I used to get sendmail to rewrite the sender domain, in order to get around the classic problem where a server has a local hostname and has to deliver mail to a real-world recipient domain. The server in this example is called &#039;&#039;ildipiben.tyknet.cn.dom&#039;&#039; and all mail for root is forwarded to my real-world reachable email address &#039;&#039;thomas@example.com&#039;&#039;. That means that I receive mail from the not-resolvable address &#039;&#039;root@ildipiben.tyknet.cn.dom&#039;&#039; which can be a problem if the receiving server uses anti-spam measures, like checking if the sender domain is real.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This article outlines the method I used to get sendmail to rewrite the sender domain, in order to get around the classic problem where a server has a local hostname and has to deliver mail to a real-world recipient domain. The server in this example is called &#039;&#039;ildipiben.tyknet.cn.dom&#039;&#039; and all mail for root is forwarded to my real-world reachable email address &#039;&#039;thomas@example.com&#039;&#039;. That means that I receive mail from the not-resolvable &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sender &lt;/ins&gt;address &#039;&#039;root@ildipiben.tyknet.cn.dom&#039;&#039; which can be a problem if the receiving server uses anti-spam measures, like checking if the sender domain is real.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I only use mail from the server &amp;#039;&amp;#039;ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; for system messages from crontab and the like, but it could easily be a server running some sort of application that sends mail through sendmail.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I only use mail from the server &amp;#039;&amp;#039;ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; for system messages from crontab and the like, but it could easily be a server running some sort of application that sends mail through sendmail.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tykling</name></author>
	</entry>
	<entry>
		<id>https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=77&amp;oldid=prev</id>
		<title>Tykling: New page: category:sendmail This article outlines the method I used to get sendmail to rewrite the sender domain, in order to get around the classic problem where a server has a local hostname a...</title>
		<link rel="alternate" type="text/html" href="https://tyk.wiki/index.php?title=Masquerading_domains_with_Sendmail&amp;diff=77&amp;oldid=prev"/>
		<updated>2009-07-07T15:20:33Z</updated>

		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/Category:Sendmail&quot; title=&quot;Category:Sendmail&quot;&gt;category:sendmail&lt;/a&gt; This article outlines the method I used to get sendmail to rewrite the sender domain, in order to get around the classic problem where a server has a local hostname a...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[category:sendmail]]&lt;br /&gt;
This article outlines the method I used to get sendmail to rewrite the sender domain, in order to get around the classic problem where a server has a local hostname and has to deliver mail to a real-world recipient domain. The server in this example is called &amp;#039;&amp;#039;ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; and all mail for root is forwarded to my real-world reachable email address &amp;#039;&amp;#039;thomas@example.com&amp;#039;&amp;#039;. That means that I receive mail from the not-resolvable address &amp;#039;&amp;#039;root@ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; which can be a problem if the receiving server uses anti-spam measures, like checking if the sender domain is real. &lt;br /&gt;
&lt;br /&gt;
I only use mail from the server &amp;#039;&amp;#039;ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; for system messages from crontab and the like, but it could easily be a server running some sort of application that sends mail through sendmail.&lt;br /&gt;
&lt;br /&gt;
== Configuring Masquerading ==&lt;br /&gt;
Sendmail calls the rewriting of the sender domain to something other than the machines hostname &amp;#039;&amp;#039;masquerading&amp;#039;&amp;#039;. You cannot just write a couple of lines in &amp;#039;&amp;#039;/etc/mail/sendmail.cf&amp;#039;&amp;#039; which is the main sendmail configuration file. To know why you just have to look inside the file, the syntax is so retarded you have to wonder who thought it up. Anyway, masquerading is something you have to configure in a .mc file, then you compile a new sendmail.cf which you copy to /etc/mail/sendmail.cf and overwrite the existing one.&lt;br /&gt;
&lt;br /&gt;
=== Make a new .mc file ===&lt;br /&gt;
First make a copy of the default &amp;#039;&amp;#039;freebsd.mc&amp;#039;&amp;#039; file by running the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo cp /usr/src/etc/sendmail/freebsd.mc /usr/src/etc/sendmail/freebsd-masq.mc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It doesn&amp;#039;t matter what you call the new .mc file. Open it up in an editor and add the following lines in the bottom (replacing &amp;#039;&amp;#039;example.com&amp;#039;&amp;#039; with your own domain, of course):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MASQUERADE_AS(example.com)&lt;br /&gt;
FEATURE(masquerade_envelope)&lt;br /&gt;
FEATURE(`masquerade_entire_domain&amp;#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will make the following changes to sendmail behaviour:&lt;br /&gt;
# &amp;#039;&amp;#039;MASQUERADE_AS&amp;#039;&amp;#039; will rewrite the sender domain if it is the same as the servers hostname: &amp;#039;&amp;#039;root@ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; becomes &amp;#039;&amp;#039;root@example.com&amp;#039;&amp;#039;&lt;br /&gt;
# &amp;#039;&amp;#039;masquerade_envelope&amp;#039;&amp;#039; will rewrite the envelope sender as well as the header. This is required for my purposes at least.&lt;br /&gt;
# &amp;#039;&amp;#039;masquerade_entire_domain&amp;#039;&amp;#039; will rewrite the sender domain to &amp;#039;&amp;#039;example.com&amp;#039;&amp;#039; if it is a subdomain of the servers hostname: &amp;#039;&amp;#039;root@jail1.ildipiben.tyknet.cn.dom&amp;#039;&amp;#039; also becomes &amp;#039;&amp;#039;root@example.com&amp;#039;&amp;#039;. This can be left out if you have no subdomains of the hostname of the server.&lt;br /&gt;
&lt;br /&gt;
You are now ready to compile a new sendmail.cf configuration file, using the .mc file you just created as a basis.&lt;br /&gt;
&lt;br /&gt;
=== Compiling the new sendmail.cf file ===&lt;br /&gt;
To compile the new configuration file, enter the following command while still in &amp;#039;&amp;#039;/usr/src/etc/sendmail&amp;#039;&amp;#039;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo make freebsd-masq.cf&lt;br /&gt;
rm -f freebsd-masq.cf&lt;br /&gt;
m4 -D_CF_DIR_=/usr/src/etc/sendmail/../../contrib/sendmail/cf/   /usr/src/etc/sendmail/../../contrib/sendmail/cf/m4/cf.m4 /usr/src/etc/sendmail/freebsd-masq.mc &amp;gt; freebsd-masq.cf&lt;br /&gt;
chmod 444 freebsd-masq.cf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There should be a new file in the current directory called &amp;#039;&amp;#039;freebsd-masq.cf&amp;#039;&amp;#039; that you can now copy to /etc/mail/sendmail.cf (backup the exising one before you overwrite it). Then restart sendmail and try sending a mail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.orig&lt;br /&gt;
$ sudo cp /usr/src/etc/sendmail/freebsd-masq.cf /etc/mail/sendmail.cf&lt;br /&gt;
$ sudo /etc/rc.d/sendmail restart&lt;br /&gt;
Stopping sendmail_submit.&lt;br /&gt;
$ echo &amp;quot;testing 1 2 3&amp;quot; | mail -s &amp;quot;testing sender masquerading in sendmail&amp;quot; thomas@example.com&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Obviously you need to replace my email address with your own. Then go see if you received a mail, and if not, check &amp;#039;&amp;#039;/var/log/maillog&amp;#039;&amp;#039; to see what&amp;#039;s going on.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tykling|Tykling]] 15:20, 7 July 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Tykling</name></author>
	</entry>
</feed>