<?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>onderka.com &#187; qmail</title>
	<atom:link href="http://www.onderka.com/category/qmail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.onderka.com</link>
	<description>Hardware-Fetischismus. Oder so ähnlich.</description>
	<lastBuildDate>Wed, 08 Sep 2010 05:38:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Spamassassin shortcircuit</title>
		<link>http://www.onderka.com/2008/01/22/spamassassin-shortcircuit/</link>
		<comments>http://www.onderka.com/2008/01/22/spamassassin-shortcircuit/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 12:51:01 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2008/01/22/spamassassin-shortcircuit/</guid>
		<description><![CDATA[Zwei qmail-Mailrelays in Reihe (dazwischen eine DMZ), beide Server mit Spamassassin. Bisher waren beide mit den selben Rulesets konfiguriert, doch um eine bessere Lastverteilung zu erreichen, wird in Zukunft Bild- und PDF-OCR auf den &#8220;inneren&#8221; verschoben und der &#8220;äußere&#8221; darf sich mit reinen Text-Rules abkämpfen. Wenn der äußere eine Mail bereits als Spam gekennzeichnet hat, [...]]]></description>
			<content:encoded><![CDATA[<p>Zwei qmail-Mailrelays in Reihe (dazwischen eine DMZ), beide Server mit <a class="ext-link" href="http://spamassassin.apache.org/"><span class="icon"> </span> Spamassassin</a>.</p>
<p>Bisher waren beide mit den selben <a class="ext-link" href="http://rulesemporium.com/"><span class="icon"> </span> Rulesets</a> konfiguriert, doch um eine bessere Lastverteilung zu erreichen, wird in Zukunft <a class="ext-link" href="http://fuzzyocr.own-hero.net/"><span class="icon"> </span> Bild- und PDF-OCR</a> auf den &#8220;inneren&#8221; verschoben und der &#8220;äußere&#8221; darf sich mit reinen Text-Rules abkämpfen.</p>
<p>Wenn der äußere eine Mail bereits als Spam gekennzeichnet hat, muß sich der innere ja nicht mehr bemühen &#8211; das <a class="ext-link" href="http://spamassassin.apache.org/full/3.2.x/doc/Mail_SpamAssassin_Plugin_Shortcircuit.html"><span class="icon"> </span> shortcircuit</a>-Plugin von Spamassassin ist ideal dafür.</p>
<h2>Beispiel</h2>
<p>Der äußere Server taggt Spam mit</p>
<blockquote><p>
rewrite_header Subject SPAM [GATE-2|S:_SCORE_|A:_AUTOLEARN_]
</p></blockquote>
<p>dabei kommt ein Subject heraus wie</p>
<blockquote><p>
SPAM [GATE-1|S:34.8|A:spam] SPAM [GATE-02|S:28.5|A:spam] Wieder Spass am Leben &#8211; mit einem Leangeren
</p></blockquote>
<h2>Shortcut</h2>
<p>Auf dem inneren Server wird eine neue Regel eingefügt mit folgendem Inhalt:</p>
<blockquote><p># Kurzschluss, wenn gate-2 bereits als Spam markiert hat<br />
#<br />
# Beispiel-Subject: &#8220;SPAM [GATE-02|S:15.2|A:spam] &#8230;&#8230;&#8221;<br />
# Beispiel-Regex:   &#8220;^SPAM \[GATE-2.*\]&#8221;<br />
#<br />
header       F_G2_TAGGED Subject =~ /^SPAM \[GATE-2.*\]/i<br />
describe     F_G2_TAGGED Bereits von gate-2 als Spam getaggt<br />
score        F_G2_TAGGED 0.1<br />
priority     F_G2_TAGGED -100<br />
shortcircuit F_G2_TAGGED spam<br />
tflags       F_G2_TAGGED noautolearn
</p></blockquote>
<p>Die Regex in der Zeile &#8220;<code>header ...</code>&#8221; muss natürlich an das Tagging des äußeren Servers angepasst werden, um auszulösen. Für Tests empfiehlt es sich, die Datei mit nur den ersten 3 Zeilen anzulegen, wie folgt:</p>
<blockquote><p># Kurzschluss, wenn gate-2 bereits als Spam markiert hat<br />
#<br />
# Beispiel-Subject: &#8220;SPAM [GATE-02|S:15.2|A:spam] &#8230;&#8230;&#8221;<br />
# Beispiel-Regex:   &#8220;^SPAM \[GATE-2.*\]&#8221;<br />
#<br />
header       F_G2_TAGGED Subject =~ /^SPAM \[GATE-2.*\]/i<br />
describe     F_G2_TAGGED Bereits von gate-2 als Spam getaggt<br />
score        F_G2_TAGGED 0.1
</p></blockquote>
<p>Es kann dann zuerst am Mail-Client geprüft werden, ob die Regel <code>F_G2_TAGGED</code> mit einer Score von 0.1 greift &#8211; also ob z.B. die Regex fehlerfrei ist. Die weiteren 3 Zeilen</p>
<blockquote><p>
priority     F_G2_TAGGED -100<br />
shortcircuit F_G2_TAGGED spam<br />
tflags       F_G2_TAGGED noautolearn
</p></blockquote>
<p>legen dann fest, dass diese Regel sehr früh geprüft wird (<code>priority</code>), dass der &#8220;<code>shortcircuit</code> als <code>spam</code>&#8221; ausgeführt wird und dass <code>autolearn</code> für diese Mail deaktiviert wird.</p>
<p>Spamassassin bricht dann jede weitere Bearbeitung ab und kann sich anderen Mails widmen.</p>
<h2>Loggin</h2>
<p>Im <code>spamd.log</code> sieht es dann aus wie folgt:</p>
<blockquote><p>Tue Jan 22 13:19:45 2008 [6463] info: spamd: result: . 0 &#8211; F_G2_TAGGED<br />
scantime=0.1,size=9915,user=qscand,uid=210,required_score=5.0,rhost=gate-1.XXXXXX.de,<br />
raddr=127.0.0.1,rport=10050,mid=&lt;01c85d3c$e5824580$1ac2867d@pampel.rycki>,<br />
autolearn=disabled,shortcircuit=spam</p></blockquote>
<p><code>F_G2_TAGGED</code> hat ausgelöst, <code>autolearn</code> ist aus, Scanzeit ist 0,1 Sekunden, fast unschlagbar. Und dran denken:</p>
<p><code>spamassassin --lint</code> ist Dein Freund!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2008/01/22/spamassassin-shortcircuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>messagelabs.com SMTP bricht RFC821/RFC2821 &#8211; Update</title>
		<link>http://www.onderka.com/2008/01/21/messagelabscom-smtp-bricht-rfc821rfc2821-update/</link>
		<comments>http://www.onderka.com/2008/01/21/messagelabscom-smtp-bricht-rfc821rfc2821-update/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 20:20:40 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2008/01/21/messagelabscom-smtp-bricht-rfc821rfc2821-update/</guid>
		<description><![CDATA[Update: Es war eine Kombination aus Mein Spamassassin brauchte zu lange &#8211; Manchmal bis zu 300s (kann passieren&#8230;) Messagelabs disconnected nach 240s, ohne vorher QUIT zu senden Resümeeeeh Meine selbstgeschriebene 00_msg_body.cf enthielt eine Regex, die bei manchen Texten ewig lief. Kann passieren, nach 5 Minuten kommt der spamd-Timeout und beendet den Spuk. qmail sendet ein [...]]]></description>
			<content:encoded><![CDATA[<p>Update: Es war eine Kombination aus</p>
<ul>
<li>Mein Spamassassin brauchte zu lange &#8211; Manchmal bis zu 300s (kann passieren&#8230;)</li>
<li>Messagelabs disconnected nach 240s, ohne vorher <code>QUIT</code> zu senden</li>
</ul>
<h2>Resümeeeeh</h2>
<p>Meine selbstgeschriebene <code>00_msg_body.cf</code> enthielt eine Regex, die bei manchen Texten ewig lief. Kann passieren, nach 5 Minuten kommt der spamd-Timeout und beendet den Spuk. <code>qmail</code> sendet ein <code>250 ok</code> und fertig.</p>
<p>Messagelabs verletzt trotzdem RFC2821 und trennt ohne <code>QUIT</code>.</p>
<p><strike>1:0</strike> 1:0,75 für mich. Bäh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2008/01/21/messagelabscom-smtp-bricht-rfc821rfc2821-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>messagelabs.com SMTP bricht RFC821/RFC2821?</title>
		<link>http://www.onderka.com/2008/01/17/messagelabscom-smtp-bricht-rfc821rfc2821/</link>
		<comments>http://www.onderka.com/2008/01/17/messagelabscom-smtp-bricht-rfc821rfc2821/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 20:00:48 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2008/01/17/messagelabscom-smtp-bricht-rfc821rfc2821/</guid>
		<description><![CDATA[So. Einige Mails von deutschen Firmen werden seit letzter Woche in der Arbeit bis zu 70 Mal innerhalb ca. 4 Tagen eingeliefert. An der infrastruktur oder der Konfiguration im Haus wurde nichts geändert. Nachdem sichergestellt wurde, daß die Mails sich nicht intern vermehren, sodern wirklich zu Hauf per SMTP abgegeben werden, steht folgendes fest: Es [...]]]></description>
			<content:encoded><![CDATA[<p>So. Einige Mails von deutschen Firmen werden seit letzter Woche in der Arbeit bis zu 70 Mal innerhalb ca. 4 Tagen eingeliefert. An der infrastruktur oder der Konfiguration im Haus wurde nichts geändert. </p>
<p>Nachdem sichergestellt wurde, daß die Mails sich nicht intern vermehren, sodern wirklich zu Hauf per SMTP abgegeben werden, steht folgendes fest:</p>
<ul>
<li>Es handelt sich um Mails von 4 deutschen Firmen, die auf den ersten Blick nichts gemeinsam haben. Auf den 2. Blick fällt auf, dass alle über Server von <a class="ext-link" href="http://de.messagelabs.com/company/why_messagelabs.aspx"><span class="icon"> </span> messagelabs.com</a> senden. Prima, Outsourcing!</li>
<li><a class="ext-link" href="http://cr.yp.to/ucspi-tcp/recordio.html"><span class="icon"> </span> recordio</a> vor <code>qmail-smtpd</code> zeigt, dass keine der Mails einen 4xx SMTP-Fehler provoziert, der den sendenden Server denken lassen könnte, die Zustellung wäre fehlgeschlagen.</li>
<li>Es zeigt auch, dass der sendende Server keine Mail-Abgabe nach dem Ende (<code>&lt;crlf&gt;.&lt;crlf&gt;</code>) mit einem <code>QUIT</code> beendet, und auch nicht wartet, bis sich mein qmail-Server nach einigen Minuten vergeblichen Wartens mit einem <code>250 ok xxxxxxxxxxxxx qp xxxxxx</code> bedankt. &#8211; Er trennt die Verbindung vorher (<code>[EOF]</code>) und bekommt deswegen das <code>250 ok ...</code> wahrscheinlich garnicht mehr mit.</li>
</ul>
<h2>Muß mein qmail-smtpd ein QUIT abwarten?</h2>
<p>In <a class="ext-link" href="http://www.ietf.org/rfc/rfc0821.txt"><span class="icon"> </span> RFC821</a>, Abschnitt 4.1.1., &#8220;COMMAND SEMANTICS&#8221;, steht:</p>
<blockquote><p>QUIT (QUIT)</p>
<p>This command specifies that the receiver must send an OK reply, and then close the transmission channel.</p>
<p>The receiver should not close the transmission channel until it receives and replies to a QUIT command (even if there was an error).  The sender should not close the transmission channel until it send a QUIT command and receives the reply (even if there was an error response to a previous command).</p>
<p>If the connection is closed prematurely the receiver should act as if a RSET command had been received (canceling any pending transaction, but not undoing any previously completed transaction), the sender should act as if the command or transaction in progress had received a temporary<br />
error (4xx).</p>
<p>[...]</p>
<p>The last command in a session must be the QUIT command.  The QUIT command can not be used at any other time in a session.</p></blockquote>
<p>Auf Deutsch: </p>
<blockquote><p>Der Empfänger <strong>sollte</strong> den Übertragungskanal nicht schließen, bis er ein <code>QUIT</code> empfangen und bearbeitet hat.</p></blockquote>
<blockquote><p>Der Sender <strong>sollte</strong> den Übertragungskanal nicht schließen, bis er ein <code>QUIT</code> gesendet und die Antwort empfangen hat.</p></blockquote>
<blockquote><p>Das letzte kommando in einer Session <strong>muß</strong> das <code>QUIT</code>-Kommando sein. Das <code>QUIT</code>-Kommando kann zu keiner anderen Zeit in einer session verwendet werden.</p></blockquote>
<p>RFC 821 ist zwar abgelöst, aber in der nachfolgenden <a class="ext-link" href="http://www.ietf.org/rfc/rfc2821.txt"><span class="icon"> </span> RFC2821</a>, Abschnitt 4.1.1.10, &#8220;QUIT (QUIT)&#8221; steht:</p>
<blockquote><p>This command specifies that the receiver MUST send an OK reply, and then close the transmission channel.</p>
<p>The receiver MUST NOT intentionally close the transmission channel until it receives and replies to a QUIT command (even if there was an error).  The sender MUST NOT intentionally close the transmission channel until it sends a QUIT command and SHOULD wait until it receives the reply (even if there was an error response to a previous command).  If the connection is closed prematurely due to violations of the above or system or network failure, the server MUST cancel any pending transaction, but not undo any previously completed transaction, and generally MUST act as if the command or transaction in progress had received a temporary error (i.e., a 4yz response).</p>
<p>The QUIT command may be issued at any time.</p></blockquote>
<p>Auf Deutsch:</p>
<blockquote><p>Dieses Kommando spezifiziert, dass der Empfänger eine <code>OK</code>-Antwort senden und danach den Übertragungskanal schließen <strong>muss</strong>.</p></blockquote>
<blockquote><p>der Empfänger <strong>DARF NICHT</strong> absichtlich den Übertragungskanal schließen, bevor er ein QUIT-Kommando empfangen und darauf geantwortet hat (Auch nach Fehlern).</p></blockquote>
<blockquote><p>Der Sender <strong>DARF NICHT</strong> absichtlich den Übertragungskanal schließen, bevor  er ein <code>QUIT</code>-Kommando gesendet hat und <strong>SOLLTE</strong> auf eine Antwort darauf warten. (Auch wenn auf das vorherige Kommando eine Fehler-Antwort kam).</p></blockquote>
<h2>Mr. Bernstein</h2>
<p><a class="ext-link" href="http://cr.yp.to/smtp/quit.html"><span class="icon"> </span> D. J. Bernstein</a>, der Autor von qmail schreibt:</p>
<blockquote><p>Clients will close connections without QUIT in some circumstances, for example because of a crash, or a message I/O error or timeout after DATA. Servers <strong>must not</strong> throw away messages that they accepted during such connections.</p></blockquote>
<p>Was mit RFC2821 absolut einhergeht: </p>
<ul>
<li>Als Client nicht <strong>abslichtlich</strong> trennen ohne vorhergehendes <code>QUIT</code></li>
<li>Als Server nichts rückgängig machen, was <strong>bisher</strong> getan wurde</li>
</ul>
<h2>Meine Logs</h2>
<p>Erklärung: &#8220;< ", also "rechts nach links" ist mein Empfang, ">&#8220;, also &#8220;links nach rechts&#8221; ist was ich sende.</p>
<p>So wär&#8217;s richtig</p>
<p>Dialog mit einem fremden Mailserver, der &#8220;normal&#8221; ist:</p>
<pre>2008-01-17 18:11:00.720143500 22823 < ------=_Part_4949241_6324
2008-01-17 18:11:00.720146500 22823 <
2008-01-17 18:11:00.720148500 22823 < .
2008-01-17 18:11:00.720151500 22823 < QUIT
2008-01-17 18:11:55.222277500 22823 > 250 ok 1200589915 qp 22844
2008-01-17 18:11:55.222289500 22823 > 221 mail.xxxxxxxxx.de running a Microsoft Exchange replacement that works!
2008-01-17 18:11:55.222550500 tcpserver: end 22823 status 0
2008-01-17 18:11:55.222788500 22823 > [EOF]</pre>
<p>Er sendet <code>&lt;crlf&gt;.&lt;crlf&gt;</code> zum Beenden der Mail, danach <code>QUIT</code>, da er keine weiteren Mails mehr für mich hat. 55 Sekunden später antworte ich <code>250 ok ...</code>.</p>
<p>Oder so (auch normaler Server):</p>
<pre>2008-01-17 18:17:30.021800500 23325 < ------=_Part_199924_6949
2008-01-17 18:17:30.021828500 23325 <
2008-01-17 18:17:30.021854500 23325 < .
2008-01-17 18:17:30.021881500 23325 < QUIT
2008-01-17 18:18:52.965812500 23325 > 250 ok 1200590332 qp 23339
2008-01-17 18:18:52.966059500 23325 > 221 mail.xxxxxxxxx.de running a Microsoft Exchange replacement that works!
2008-01-17 18:18:52.966411500 23325 > [EOF]
2008-01-17 18:18:52.966757500 tcpserver: end 23325 status 0</pre>
<p>Er sendet auch <code>&lt;crlf&gt;.&lt;crlf&gt;</code> zum Beenden der Mail, danach <code>QUIT</code>. 1:22 Minuten später antworte ich <code>250 ok ...</code>. Bissl spät, aber was soll&#8217;s. War noch nie ein Problem, wie gesagt.</p>
<h2>So geht&#8217;s nicht</h2>
<p>Das st eine Mail, die von <code>serverXX.towerYY.messagelabs.com</code> kommt:</p>
<pre>2008-01-17 16:29:51.975112500 12573 < ------_=_NextPart_001_01C858-
2008-01-17 16:29:51.975115500 12573 < .
2008-01-17 16:33:51.957547500 12573 < [EOF]
2008-01-17 16:34:52.425670500 12573 > 250 ok 1200584092 qp 12584
2008-01-17 16:34:52.426139500 12573 > [EOF]
2008-01-17 16:34:52.426434500 tcpserver: end 12573 status 256</pre>
<p>Ein <code>&lt;crlf&gt;.&lt;crlf&gt;</code>, kein <code>QUIT</code>. Stattdessen nach 4 Minuten ohne Antwort von mir ein Disconnect, mein <code>250 ok ...</code> hört er nicht mehr.</p>
<p>So auch nicht:</p>
<pre>2008-01-17 16:44:46.869105500 13972 < delete the material from your it-system.
2008-01-17 16:44:46.869114500 13972 <
2008-01-17 16:44:46.869116500 13972 < .
2008-01-17 16:48:46.775874500 13972 < [EOF]
2008-01-17 16:49:47.253506500 13972 > 250 ok 1200584987 qp 13989
2008-01-17 16:49:47.253651500 tcpserver: end 13972 status 256
2008-01-17 16:49:47.253817500 13972 > [EOF]</pre>
<p>Das selbe, nach exakt 4 Minuten ein Disconnect.</p>
<p>Und so auch nicht:</p>
<pre>2008-01-17 18:04:43.727334500 22298 < Danke und ciao.
2008-01-17 18:04:43.727336500 22298 <
2008-01-17 18:04:43.727339500 22298 <
2008-01-17 18:04:43.727341500 22298 < .
2008-01-17 18:08:43.677168500 22298 < [EOF]
2008-01-17 18:09:44.105791500 22298 > 250 ok 1200589784 qp 22315
2008-01-17 18:09:44.106070500 tcpserver: end 22298 status 256
2008-01-17 18:09:44.106159500 22298 > [EOF]</pre>
<p>Und wieder nach 4 Minuten.</p>
<h2>Zusammenfassung &#8211; Meine Seite </h2>
<p>Nach RFC2821 verhalte ich mich (fast) korrekt:</p>
<blockquote><p>This command specifies that the receiver <strong>MUST</strong> send an OK reply, and then close the transmission channel.</p></blockquote>
<p>Mache ich, wenn ich das <code>QUIT</code> bekomme.</p>
<blockquote><p>The receiver <strong>MUST NOT</strong> intentionally close the transmission channel until it receives and replies to a QUIT command (even if there was an error).</p></blockquote>
<p>Tue ich nicht. Der Sender trennt.</p>
<blockquote><p>If the connection is closed prematurely due to violations of the above or system or network failure, the server <strong>MUST</strong> cancel any pending transaction, but not undo any previously completed transaction &#8230;</p></blockquote>
<p>Ich mache keine ausgeführten Aktionen rückgängig. Die Mail wird zugestellt. Jeeeedes verdammte Mal&#8230;</p>
<blockquote><p>&#8230; and generally <strong>MUST</strong> act as if the command or transaction in progress had received a temporary error (i.e., a 4yz response).</p></blockquote>
<p>Ich kann nicht mehr antworten, wenn getrennt wurde. Ganz einfach.</p>
<h2>Zusammenfassung &#8211; Messagelabs</h2>
<blockquote><p>The sender <strong>MUST NOT</strong> intentionally close the transmission channel until it sends a QUIT command&#8230;</p></blockquote>
<p>Das tut Messagelabs aber &#8211; entgegen der RFC.</p>
<blockquote><p>&#8230;and <strong>SHOULD</strong> wait until it receives the reply (even if there was an error response to a previous command).</p></blockquote>
<p>Das interessiert Messagelabs nicht.</p>
<blockquote><p>The QUIT command may be issued at any time.</p></blockquote>
<p>Sollte Messagelabs.</p>
<h2>Muß mein qmail-smtpd auf <crlf>.</crlf><crlf> antworten?</crlf></h2>
<p>In RFC2821, Abschnitt 4.2.5 &#8220;Reply Codes After DATA and the Subsequent <crlf>.</crlf><crlf>&#8221; steht:</p>
<blockquote><p>When an SMTP server returns a positive completion status (2yz code) after the DATA command is completed with <crlf>.</crlf><crlf>, <strong>it</strong> accepts responsibility for:</crlf></p></blockquote>
<p>Wenn ich mit einem <code>2xx ok...</code> antworte, bin ich für die Mail verantwortlich.</p>
<blockquote><p>When an SMTP server returns a permanent error status (5yz) code after the DATA command is completed with <crlf>.</crlf><crlf>, [...] The SMTP <strong>client</strong> retains responsibility for delivery of  [...]</crlf></p></blockquote>
<p>Wenn ich mit einem <code>5xx</code>-Fehler antworte, ist der Client für die Mail verantwortlich. Soweit noch nichts von &#8220;ich muß antworten&#8221;. Doch in Abschnitt 6.1, &#8220;Reliable Delivery and Replies by Email&#8221; steht:</p>
<blockquote><p>To avoid receiving duplicate messages as the result of timeouts, a receiver-SMTP <strong>MUST</strong> seek to minimize the time required to respond to the final <crlf>.</crlf><crlf> end of data indicator.  See RFC 1047 [28] for a discussion of this problem.</crlf></p></blockquote>
<p>Also die Antwortzeit von empfangenen <code>&lt;crlf&gt;.&lt;crlf&gt;</code> bis zur Antwort <strong>muss</strong> vom Server möglichst gering gehalten werden. qmail antwortet hier 4 Minuten nicht.</p>
<h2>Ein Fehler in qmail?</h2>
<p><a class="ext-link" href="http://www.ietf.org/rfc/rfc1047.txt"><span class="icon"> </span>RFC1047</a>, &#8220;DUPLICATE MESSAGES AND SMTP&#8221;, sagt: </p>
<blockquote><p>When the receiving mailer receives this final dot, it is <strong>expected</strong> to do its final message processing and either confirm receipt of the message (with a 250 reply) or reject the message with any one of several error codes.</p></blockquote>
<p>Ok, nach <code>&lt;crlf&gt;.&lt;crlf&gt;</code> bearbeiten und Antworten.</p>
<blockquote><p>Until the sending mailer gets the 250 reply, it must assume the message was not delivered.  After the receiving mailer has decided to accept the message, it must assume the message has been delivered to it.  If the communications link fails during this synchronization gap, then the message has been duplicated.  Both mailers have active copies of the message that they will try to deliver.</p></blockquote>
<p>Bingo.</p>
<blockquote><p>Many mailers delay responding to the final dot because they are doing sophisticated processing of the message, in an attempt to confirm that they can deliver the message.</p></blockquote>
<p>&#8230; oder Spamassassin kotzt sich mit der Alles-auch-in-HTML-Mail einen ab. </p>
<blockquote><p>Some mailers can be configured to do more or less processing upon receipt of the final dot.  In such situations, the mailer should always be configured to do less processing.</p></blockquote>
<p><code>qmail-scanner-queue.pl</code> hat die Mail jeweils laut Log in ca. 5-25 Sekunden durchgecheckt, und auch das Umstellen von <code>qmail-scanner</code> auf <code>sa_fast</code> (Socket statt Netzwerk-Verbindung zu <code>spamd</code>) bringt nichts. Schon ausprobiert.</p>
<p>Weiter heißt es:</p>
<blockquote><p>Finally, some mailers allow remote mailers only a minute or two to acknowledge the final dot before timing out and trying again.  Given the increasing round-trip times on the Internet, and that some processing after the final dot is required, the timeout for reply to the final dot should probably be at least 5 minutes and a timeout of 10 minutes would not be unreasonable.</p></blockquote>
<h2>Ende</h2>
<p>Messagelabs wartet exakt 4 Minuten, und trennt dann die Verbindung, ohne ein <code>QUIT</code> zu senden. Das ist <strong>gegen</strong> die RFC.</p>
<p>Warum qmail nicht gleich auf <code>&lt;crlf&gt;.&lt;crlf&gt;</code> antwortet, ist mir momentan unerklärlich. Kommt ein <code>&lt;crlf&gt;.&lt;crlf&gt;</code> gefolgt von einem <code>QUIT</code>, antwortet qmail innerhalb kürzester Zeit.</p>
<p>Eine Idee wäre ein <a class="ext-link" href="http://qmail-spp.sourceforge.net/"><span class="icon"> </span> qmail-SPP</a> Plugin, das nach <code>&lt;crlf&gt;.&lt;/crlf&gt;</code> immer mit <code>220 ok</code> antwortet &#8211; aber es gibt keinen Hook für <code>&lt;crlf&gt;.&lt;crlf&gt;</code>, nur für <code>DATA</code>.</p>
<p>Mal sehen, was noch so passiert. Morgen qmail noch einmal kompilieren und weitertesten.</p>
<p><a class="ext-link" href="http://itstudent.org/blog/wp-trackback.php?p=611"><span class="icon"> </span>ITStudent.org</a> und andere Seiten berichten auch über wiederkehrende (andere) Probleme mit Messagelabs.</crlf></p>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2008/01/17/messagelabscom-smtp-bricht-rfc821rfc2821/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qmail SPP-Plugin “goodmailto”</title>
		<link>http://www.onderka.com/2007/12/27/qmail-spp-plugin-%e2%80%9cgoodmailto%e2%80%9d/</link>
		<comments>http://www.onderka.com/2007/12/27/qmail-spp-plugin-%e2%80%9cgoodmailto%e2%80%9d/#comments</comments>
		<pubDate>Thu, 27 Dec 2007 15:04:31 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2007/12/27/qmail-spp-plugin-%e2%80%9cgoodmailto%e2%80%9d/</guid>
		<description><![CDATA[Ein qmail-Plugin names goodmailto.]]></description>
			<content:encoded><![CDATA[<p>Ein qmail-Plugin names <a href="/index.php/qmail-spp-plugin-goodmailto/">goodmailto</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2007/12/27/qmail-spp-plugin-%e2%80%9cgoodmailto%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>spamassassin &#8211;lint und utf-8</title>
		<link>http://www.onderka.com/2006/04/28/spamassassin-lint-und-utf-8/</link>
		<comments>http://www.onderka.com/2006/04/28/spamassassin-lint-und-utf-8/#comments</comments>
		<pubDate>Fri, 28 Apr 2006 20:28:09 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2006/04/28/spamassassin-lint-und-utf-8/</guid>
		<description><![CDATA[Was klemmt da nur? spamassassin &#8211;lint [21545] warn: config: warning: description exists for non-existent rule SPF_HELO_PASS [21545] warn: config: warning: description exists for non-existent rule HASHCASH_HIGH [21545] warn: config: warning: description exists for non-existent rule HASHCASH_24 [21545] warn: config: warning: description exists for non-existent rule SPF_HELO_SOFTFAIL [21545] warn: config: warning: description exists for non-existent rule [...]]]></description>
			<content:encoded><![CDATA[<p>Was klemmt da nur?</p>
<blockquote><p>
spamassassin &#8211;lint<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_HELO_PASS<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_HIGH<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_24<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_HELO_SOFTFAIL<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_OB_SURBL<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_HELO_FAIL<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_SC_SURBL<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_22<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_SBL<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_23<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_PASS<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_SOFTFAIL<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_AB_SURBL<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_PH_SURBL<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_25<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_20<br />
[21545] warn: config: warning: description exists for non-existent rule SPF_FAIL<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_21<br />
[21545] warn: config: warning: description exists for non-existent rule HASHCASH_2SPEND<br />
[21545] warn: config: warning: description exists for non-existent rule URIBL_WS_SURBL<br />
[21545] warn: lint: 20 issues detected, please rerun with debug enabled for more information
</p></blockquote>
<p>Alle Regeln da, alle inclusive <code>score</code> und <code>description</code>. Kein Fehler zu entdecken. Im Netz nichts eindeutiges zu finden, aber ähnliche Probleme anderer Leute:</p>
<p>Spamassassin (bzw. Perl) hat immernoch Probleme mit nicht-latin1 und nicht-C locales. Besonders mit UTF-8 ist einiges im Argen, so setzt auch <code>qmail-scanner-queue.pl</code> bis heute <code>POSIX::setlocale(&amp;POSIX::LC_ALL,'en_EN');</code>.</p>
<p>Nach einem <code>export LANGUAGE="C"</code> bringt <code>spamassassin --lint</code> keinen Fehler mehr &#8211; vorausgesetzt natürlich, der aktuelle User hat Leserechte in /etc/mail/spamassassin <img src='http://www.onderka.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2006/04/28/spamassassin-lint-und-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORBL-Checks für qmail-smtpd</title>
		<link>http://www.onderka.com/2006/01/27/orbl-checks-fur-qmail-smtpd/</link>
		<comments>http://www.onderka.com/2006/01/27/orbl-checks-fur-qmail-smtpd/#comments</comments>
		<pubDate>Fri, 27 Jan 2006 19:05:10 +0000</pubDate>
		<dc:creator>Stefan</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[qmail]]></category>

		<guid isPermaLink="false">http://www.onderka.com/index.php/2006/01/27/orbl-checks-fur-qmail-smtpd/</guid>
		<description><![CDATA[Einfacher Spam-Schutz f&#252;r qmail mit Bordmitteln Es ist sehr sehr einfach zu realisieren, qmail ist installiert nach der Anleitung auf Life with qmail, ucspi und die daemontools somit auch. Erfahrung im Umgang mit supervise, svc, svstat etc. wird vorausgesetzt. Wirkungsweise &#8220;Werkzeug&#8221; wird nicht ben&#246;tigt, das installierte ucspi behinhaltet rblsmtpd, einen dem eigentlichen qmail SMTP-Daemon vorgeschalteten [...]]]></description>
			<content:encoded><![CDATA[<p>Einfacher Spam-Schutz f&uuml;r qmail mit Bordmitteln</p>
<p>
Es ist sehr sehr einfach zu realisieren, qmail ist installiert nach der Anleitung auf <a  class="ext-link" href="http://www.lifewithqmail.org"><span class="icon"> </span>Life with qmail</a>, <a class="ext-link" href="http://cr.yp.to/ucspi-tcp.html"><span class="icon"> </span>ucspi</a> und die <a class="ext-link" href="http://cr.yp.to/daemontools.html"><span class="icon"> </span>daemontools</a> somit auch. Erfahrung im Umgang mit <code>supervise</code>, <code>svc</code>, <code>svstat</code> etc. wird vorausgesetzt.
</p>
<h2>Wirkungsweise</h2>
<p>
&#8220;Werkzeug&#8221; wird nicht ben&ouml;tigt, das installierte <code>ucspi</code> behinhaltet <a class="ext-link" href="http://cr.yp.to/ucspi-tcp/rblsmtpd.html"><span class="icon"> </span>rblsmtpd</a>, einen dem eigentlichen qmail SMTP-Daemon vorgeschalteten SMTP-Daemon, der <a class="ext-link" href="http://de.wikipedia.org/wiki/RBL" class="external"><span class="icon"> </span>RBL</a>-Abfragen macht und bei positiven Antworten die SMTP-Session mit einem Code 451 abbricht.
</p>
<p>
Als Fehlertext zum Error 451 gibt <code>rblsmtpd</code> den Link zum jeweiligen RBL-Eintrag aus, so da&szlig; der einliefernde Mailserver oder -client einen Grund f&uuml;r den Abbruch erf&auml;hrt.</p>
<p>
Verlaufen alle RBL-Anfragen negativ oder enden mit DNS-Timeouts (in dubio pro reo), &uuml;bergibt <code>rblsmtpd</code> die begonnene SMTP-Session an <code>qmail-smtpd</code>.
</p>
<p>
Nach der qmail-Installation befindet sich in <code>/service/qmail-smtpd/</code> das Shellscript <code>run</code>, das bei SMTP-Sessions abl&auml;uft. Her wird der Relay-Check eingef&uuml;gt:</p>
<blockquote><p>
#!/bin/sh<br />
#<br />
# /var/qmail/supervise/qmail-smtpd/run<br />
# rblsmtpd mit Relay-/spam-Check vor qmail-smtpd</p>
<p><font color="#0000FF"># Serverliste einlesen<br />
. /var/qmail/control/ordbservers</font></p>
<p>QMAILDUID=`id -u qmaild`<br />
NOFILESGID=`id -g qmaild`<br />
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`</p>
<p><font color="#0000FF">ORDBSTRING=&#8221;"</font><br />
<font color="#0000FF"># &#8220;-r &#8230; -r &#8230; -r &#8230;&#8221;-String konstruieren<br />
for used_server in $ordb_servers<br />
do<br />
    ORDBSTRING=$ORDBSTRING&#8221;-r $used_server &#8221;<br />
done</font></p>
<p>exec /usr/local/bin/softlimit -m <font color="#0000FF">8</font>000000 \<br />
	/usr/local/bin/tcpserver -H -R -l 0 -v -x \<br />
	/etc/tcp.smtp.cdb -c $MAXSMTPD \<br />
	-u $QMAILDUID -g $NOFILESGID 0 smtp \<br />
	<font color="#0000FF">/usr/local/bin/rblsmtpd $ORDBSTRING \</font><br />
	/var/qmail/bin/qmail-smtpd 2>&#038;1</font>
</p></blockquote>
<p>
Die dunkelblauen Zeilen kommen hinzu, das ist der &#8220;vorgeschaltete&#8221; RBL-Check. das <code>softlimit</code> darf hier ruhig von 2000000 auf 8000000 erh&ouml;ht werden. Die in der zweiten &#8220;dunkelblauen Zeile&#8221; eingelesene Datei <code>/var/qmail/control/ordbservers</code> mu&szlig; angelegt werden, sie beinhaltet die Variable mit den zu verwendenden ORDBs in der gew&uuml;nschten Reihenfolge, z.B.
</p>
<blockquote><p>
# ORDB-Server in der Reihenfolge der Verwendung.<br />
# rblsmtpd bricht nach der ersten &#8220;positiven&#8221; Anfrage ab.<br />
#<br />
# http://www.ordb.org<br />
# http://www.spamhaus.org<br />
# http://www.spamcop.net</p>
<p>ordb_servers=&#8221;relays.ordb.org sbl-xbl.spamhaus.org bl.spamcop.net&#8221;
</p></blockquote>
<h2>Spam separat loggen mit multilog</h2>
<p>
<a class="ext-link" href="http://cr.yp.to/daemontools/multilog.html"><span class="icon"> </span>multilog</a>, das für <code>qmail-smtpd</code> loggt, kann filtern und in mehrere Logs gleichzeitig schreiben. Dazu mu&szlig; lediglich <code>/service/qmail-smtpd/log/run</code> angepa&szlig;t werden:</p>
<blockquote><p>
#!/bin/sh<br />
#<br />
# Alles nach                  /var/log/qmail-smtpd<br />
# Zeilen mit &#8220;rbslmtpd:&#8221; nach /var/log/qmail-spam</p>
<p>exec /usr/local/bin/setuidgid qmaill /usr/local/bin/multilog \<br />
	t s2500000 <font color="#0000FF">&#8216;+*&#8217; &#8216;-* rblsmtpd: *&#8217;</font> /var/log/qmail-smtpd <font color="#0000FF">\<br />
		&#8216;-*&#8217; &#8216;+* rblsmtpd: *&#8217; /var/log/qmail-spam</font></font>
</p></blockquote>
<p>
Wieder wird das in blau geschriebene eingef&uuml;gt. Log-Zeilen die also <code>"* rblsmtpd: *"</code> beinhalten werden statt nach <code>/var/log/qmail-smtpd</code> in das Verzeichnis <code>/var/log/qmail-spam</code> geschrieben. Verzeichnis <code>/var/log/qmail-spam</code> erstellen, <code>chown qmaill.nofiles</code><sup>1</sup><code> /var/log/qmail-spam</code> nicht vergessen!
</p>
<p>
<sup>1</sup> Je nachdem, in welcher Group der User qmaill ist.
</p>
<p>
Nach einem erneuten Einlesen von <code>run</code> durch <code>svc -t /service/qmail-smtpd/run/</code> l&auml;uft das zus&auml;tzliche Logging, Beispiel:
</p>
<blockquote><p>
@4000000040a377be101a98c4 rblsmtpd: 69.6.6.171 &#8230;<br />
@4000000040a378ca0daf2a8c rblsmtpd: 69.6.79.133 &#8230;<br />
@4000000040a378d6011abcdc rblsmtpd: 219.252.145.196 &#8230;<br />
@4000000040a378d60645c42c rblsmtpd: 80.80.160.45 &#8230;
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.onderka.com/2006/01/27/orbl-checks-fur-qmail-smtpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
