<?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>Endersys Blog &#187; smtp auth</title>
	<atom:link href="http://blog.endersys.com/tag/smtp-auth/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.endersys.com</link>
	<description>Üst Düzey Çözümler</description>
	<lastBuildDate>Sun, 15 Jan 2012 19:26:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>qmail from address and SMTP-AUTH username check patch</title>
		<link>http://blog.endersys.com/2009/12/qmail-from-address-and-smtp-auth-username-check-patch/</link>
		<comments>http://blog.endersys.com/2009/12/qmail-from-address-and-smtp-auth-username-check-patch/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 22:40:09 +0000</pubDate>
		<dc:creator>ismail.yenigul</dc:creator>
				<category><![CDATA[Duyuru]]></category>
		<category><![CDATA[E-mail]]></category>
		<category><![CDATA[Yazılım]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[qmail]]></category>
		<category><![CDATA[smtp auth]]></category>
		<category><![CDATA[vpopmail]]></category>

		<guid isPermaLink="false">http://blog.endersys.com/?p=414</guid>
		<description><![CDATA[qmail SMTP-AUTH control mechanism is very good way to stop spams and give flexibility user to send email from anywere in the world. But current SMTP-AUTH patches do not check whether from address and SMTP-AUTH username is same. The following patch will simply reject the mail if the SMTP-AUTH username does not match with the [...]
Related posts:<ol>
<li><a href='http://blog.endersys.com/2009/12/qmail-canonicalised-recipient-logging-and-more-patch/' rel='bookmark' title='qmail canonicalised recipient logging and more patch'>qmail canonicalised recipient logging and more patch</a></li>
<li><a href='http://blog.endersys.com/2009/09/qmailde-hotmailden-mail-alamama-sorunu/' rel='bookmark' title='qmail&#8217;de Hotmail&#8217;den mail alamama sorunu'>qmail&#8217;de Hotmail&#8217;den mail alamama sorunu</a></li>
<li><a href='http://blog.endersys.com/2009/12/qmail-multilog-localtime-patch-for-daemontools-0-76/' rel='bookmark' title='qmail multilog localtime patch for daemontools-0.76'>qmail multilog localtime patch for daemontools-0.76</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>qmail SMTP-AUTH control mechanism is very good way to stop spams and give flexibility user to send email from anywere in the world. But current SMTP-AUTH patches do not check whether from address and SMTP-AUTH username is same.</p>
<p>The following patch will simply reject the mail if the SMTP-AUTH username does not match with the from address.<br />
To be enable use this patch SMTP-AUTH username must be in email address format (user@domain.com). This can be<br />
possible only in qmail+vpopmail  or qmail-ldap (if the uid is in email address format) installation.</p>
<p>This patch is based on <a href="http://qmail.org/netqmail/" target="_blank">netqmail-1.06</a> and Erwin Hoffmann&#8217;s <a href="http://www.fehcom.de/qmail/smtpauth.html##PATCHES" target="_blank">qmail-authentication-0.68 patch</a>. But I believe that you can simply integrate your qmail source.</p>
<p>PS:  qmail-remote-logging.patch and qmail-smtp-auth-fromcheck.patch are integrated into JMS1 combined patch and Shupp Toaster patch.</p>
<p>URLs:</p>
<p><a href="http://files.endersys.com/patches/qmail-1.03-jms1.7.08_endersys.patch" target="_blank">http://files.endersys.com/patches/qmail-1.03-jms1.7.08_endersys.patch</a></p>
<p><a href="http://files.endersys.com/patches/qmail-toaster-0.9.1_endersys.patch" target="_blank">http://files.endersys.com/patches/qmail-toaster-0.9.1_endersys.patch</a></p>
<p><strong>INSTALLATION and CONFIGURATION</strong></p>
<p>1.  Stop qmail<br />
2. Apply this patch to your qmail toaster and compile it (don&#8217;t install!)<br />
3. Take backup of your qmail-smtpd binary and override new qmail-smtpd binary<br />
4. Create control/checksenderauth to enable this control<br />
5. Start qmail</p>
<p>You can get the patch from <a href="http://files.endersys.com/patches/qmail-smtp-auth-fromcheck.patch" target="_blank">here</a></p>
<pre class="brush: diff; title: ; notranslate">

--- qmail-smtpd.c.orig  2009-12-16 00:09:42.000000000 +0200
+++ qmail-smtpd.c       2009-12-16 00:20:34.000000000 +0200
@@ -1,3 +1,4 @@
+#include &lt;sys/stat.h&gt;
#include &quot;sig.h&quot;
#include &quot;readwrite.h&quot;
#include &quot;stralloc.h&quot;
@@ -346,6 +347,7 @@
out(&quot;250 ok\r\n&quot;);
}
void smtp_rcpt(arg) char *arg; {
+struct stat st;
if (!seenmail) { err_wantmail(); return; }
if (!addrparse(arg)) { err_syntax(); return; }
if (flagbarf) { err_bmf(); return; }
@@ -356,6 +358,22 @@
}
else
if (!addrallowed()) { err_nogateway(); return; }
+/* This small patch compare mail from value and smtp auth username.
+* if they are not identical,  the mail will not be relayed!
+* This control will be ignored, if the remote IP is defined in tcp.smtp.cdb
+* create/delete control/checksenderauth file to enable/disable this feature
+*  - Developed by Endersys Ltd R&amp;D Team - http://www.endersys.com
+*/
+  if ((stat(&quot;control/checksenderauth&quot;,&amp;st) == 0) &amp;&amp; (remoteinfo)) {
+
+ /* remoteinfo:username issued during the smtp auth state
+ *   mailfrom.s: From value issued at mail from: state */
+        if (str_diff(remoteinfo, mailfrom.s))  {
+               out(&quot;535 Mail From address and SMTP-AUTH username does not match (#5.7.1)\r\n&quot;);
+                       return;
+       }
+ }
+
</pre>
<p>Related posts:<ol>
<li><a href='http://blog.endersys.com/2009/12/qmail-canonicalised-recipient-logging-and-more-patch/' rel='bookmark' title='qmail canonicalised recipient logging and more patch'>qmail canonicalised recipient logging and more patch</a></li>
<li><a href='http://blog.endersys.com/2009/09/qmailde-hotmailden-mail-alamama-sorunu/' rel='bookmark' title='qmail&#8217;de Hotmail&#8217;den mail alamama sorunu'>qmail&#8217;de Hotmail&#8217;den mail alamama sorunu</a></li>
<li><a href='http://blog.endersys.com/2009/12/qmail-multilog-localtime-patch-for-daemontools-0-76/' rel='bookmark' title='qmail multilog localtime patch for daemontools-0.76'>qmail multilog localtime patch for daemontools-0.76</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.endersys.com/2009/12/qmail-from-address-and-smtp-auth-username-check-patch/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

