<br>Julian,<br><br>Thanks for the clarification on the Delivery Method behavior.&nbsp; What you&#39;re saying makes a lot of sense and seems the optimal way to deliver the best results under normal circumstances.<br><br>It&#39;s starting to look like it may be a DNS issue after all.&nbsp; The server has a local DNS resolver bound to its IP address and configured via /etc/resolv.conf.&nbsp; All DNS tests performed in the shell were very clean.&nbsp; It seems though that sendmail (for whatever reason and despite its lack of presence in 
resolv.conf) is attempting (on occasion) to talk to localhost.&nbsp; About an hour ago I modified the bind configuration to listen on everything and it seems like things may be improving.<br><br>Thanks for all the responses on this guys.&nbsp; I&#39;ll monitor this box for a few hours and see what happens.
<br><br>-Corey<br><br><br><br><br><div><span class="gmail_quote">On 8/1/07, <b class="gmail_sendername">Julian Field</b> &lt;<a href="mailto:MailScanner@ecs.soton.ac.uk">MailScanner@ecs.soton.ac.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br><br><br>Corey McFadden wrote:<br>&gt;<br>&gt; It does seem as though the problem begins when MailScanner disposes of<br>&gt; a message.&nbsp;&nbsp;Maybe someone could clarify the process whereby Sendmail
<br>&gt; picks up the message and decides to deliver it (locally or relay or<br>&gt; whatever.)<br>See my explanation below. The normal setting to use is &quot;Delivery Method<br>= batch&quot;. Though for debugging MailScanner, I run no outgoing queue
<br>runner process at all, and have &quot;Delivery Method = queue&quot;. The result is<br>that processed messages are placed in the outgoing mqueue and no attempt<br>to deliver them is made at all. I can then look at the messages, check
<br>whether they are correct and that the development code is working, and<br>then just delete them from the mqueue by hand. I don&#39;t want to ever<br>actually deliver these messages, all the information I want is in the
<br>df+qf files.<br>&gt;<br>&gt; It doesn&#39;t look like a DNS issue.&nbsp;&nbsp;We&#39;ve got a local resolver (that<br>&gt; has a PTR record for the machine&#39;s IP) and a backup resolver.&nbsp;&nbsp;I&#39;ve<br>&gt; done a number of DNS tests and haven&#39;t been able to produce an error
<br>&gt; there.<br>It&#39;s usually fairly easy to test DNS speed problems with a few &quot;dig&quot;<br>commands for some random domains (most English words .com exist, so<br>picking a random word is usually pretty reliable, and probably won&#39;t be
<br>in your DNS cache already).<br>&gt;<br>&gt; On other systems everything happens so quickly that it&#39;s hard to see<br>&gt; what happens but does it resemble this:<br>&gt;&nbsp;&nbsp;- MailScanner finds message in <a href="http://mqueue.in">
mqueue.in</a> &lt;<a href="http://mqueue.in">http://mqueue.in</a>&gt;<br>&gt;&nbsp;&nbsp;- MailScanner processes message and dumps qf/df into mqueue<br>&gt;&nbsp;&nbsp;- Sendmail daemon periodically scans mqueue<br>&gt;<br>&gt; or:<br>&gt;&nbsp;&nbsp;- MailScanner finds message in 
<a href="http://mqueue.in">mqueue.in</a> &lt;<a href="http://mqueue.in">http://mqueue.in</a>&gt;<br>&gt;&nbsp;&nbsp;- MailScanner processes message and spawns a sendmail process for<br>&gt; delivery<br>It always put the qf/df in the mqueue first. It doesn&#39;t directly pass
<br>the message text to sendmail, that would involve an extra copy of the<br>message being written down a pipe which slows things down. I try quite<br>hard to make MailScanner as fast and efficient as I can. Which is why I
<br>have a full MailScanner+SpamAssassin+ClamAV setup on one box in my<br>office which can process 2.2 million messages per day, on 1 server.<br>&gt; What are the implications of the &quot;Delivery Method&quot; queue vs. batch
<br>&gt; option on the above?<br>The explanation below is described for sendmail, but the same basic<br>design applies to all the other supported MTAs as well. They all work in<br>pretty much the same way, more or less.<br>
<br>With &quot;Delivery Method = queue&quot; the processed message(s) is placed in the<br>mqueue. That&#39;s it. You will then have a sendmail queue runner regularly<br>attempting delivery of everything in the queue that&#39;s due for a delivery
<br>attempt. So if the outgoing sendmail process is running (ie the queue<br>runner) then delivery will be delayed until the next regular queue run.<br>You can start and stop this bit with &quot;service MailScanner startout&quot; and
<br>&quot;service MailScanner stopout&quot;.<br><br>With &quot;Delivery Method = batch&quot; the processed message(s) are placed in<br>the mqueue. Then a &quot;sendmail -qI.....&quot; command is then executed, with<br>&quot;.....&quot; set to the IDs of the message files just placed in the mqueue.
<br>This tells sendmail to immediately make 1 delivery attempt of each<br>message. If this succeeds, the net result is instant message delivery.<br>If it fails, then it is left to be retried by the outgoing sendmail<br>queue runner process, as described above. In cases where the batch is
<br>large, measures are taken to ensure that the &quot;sendmail -qI.....&quot; command<br>is not too long for the operating system to be able to handle. When<br>there are multiple mqueues in use, a separate &quot;sendmail -qI.....&quot;
<br>command is issued for the messages in each outgoing queue, so that<br>delivery of all messages is attempted, regardless of the number of<br>outgoing queues they are spread across. This is needed as the mqueue<br>directory can be specified by a ruleset or Custom Function, allowing you
<br>to use different queue runner parameters for each of several queues<br>(e.g. a fast queue runner for local or small messages, with a slower one<br>for remote or large messages, for example).<br><br>Hopefully that explains what happens in full detail.
<br><br>&gt;<br>&gt; Thanks for the input!<br>&gt;<br>&gt; -Corey<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; On 8/1/07, * Scott Silva* &lt;<a href="mailto:ssilva@sgvwater.com">ssilva@sgvwater.com</a><br>&gt; &lt;mailto:<a href="mailto:ssilva@sgvwater.com">
ssilva@sgvwater.com</a>&gt;&gt; wrote:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Corey McFadden spake the following on 7/31/2007 9:46 PM:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Guys,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; We&#39;re experiencing an issue on one of our boxes where messages
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; (a good<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; percentage) are hung in /var/spool/mqueue after being processed by<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; MailScanner.&nbsp;&nbsp;Even those to be delivered locally will sit for<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; (sometimes) hours until they&#39;re finally delivered.
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; I&#39;ve never seen this behavior before and something is definitely<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; awry.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Here&#39;s the environment:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; This is CentOS release 
4.5 (Final)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; This is Perl version 5.008008 (5.8.8)<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; This is MailScanner version 4.61.7<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; Executing &#39;sendmail -q -v&#39; WILL process the stuck messages but
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; can take<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; quite a long time to run because it will try to deliver everything<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt; queued in a linear fashion.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Since it is in mqueue and not <a href="http://mqueue.in">
mqueue.in</a> &lt;<a href="http://mqueue.in">http://mqueue.in</a>&gt;,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; mailscanner is pretty much out of the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; loop. Check if you have a FQDN that resolves properly as this will<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; choke<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; sendmail quickly. Also try a local caching nameserver, as sendmail<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; might be<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; taking a long time to resolve delivery addresses.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; --<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; MailScanner is like deodorant...
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; You hope everybody uses it, and<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; you notice quickly if they don&#39;t!!!!<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; --<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; MailScanner mailing list<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:mailscanner@lists.mailscanner.info">
mailscanner@lists.mailscanner.info</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mailto:<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner">
http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Before posting, read <a href="http://wiki.mailscanner.info/posting">http://wiki.mailscanner.info/posting</a><br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;<a href="http://wiki.mailscanner.info/posting">
http://wiki.mailscanner.info/posting</a>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Support MailScanner development - buy the book off the website!<br>&gt;<br>&gt;<br><br>Jules<br><br>- --<br>Julian Field MEng CITP<br><a href="http://www.MailScanner.info">
www.MailScanner.info</a><br>Buy the MailScanner book at <a href="http://www.MailScanner.info/store">www.MailScanner.info/store</a><br><br>MailScanner customisation, or any advanced system administration help?<br>Contact me at 
<a href="mailto:Jules@Jules.FM">Jules@Jules.FM</a><br><br>PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654<br>For all your IT requirements visit <a href="http://www.transtec.co.uk">www.transtec.co.uk</a><br>
<br><br>-----BEGIN PGP SIGNATURE-----<br>Version: PGP Desktop 9.6.2 (Build 2014)<br>Charset: ISO-8859-1<br><br>wj8DBQFGsNm8EfZZRxQVtlQRAuAWAJ9bWzKisXCEcEeJGZ5TrFdMcBFAKgCcCMjh<br>gmylU66oi8Mi4/pxd+5q+wg=<br>=Sru3<br>-----END PGP SIGNATURE-----
<br><br>--<br>This message has been scanned for viruses and<br>dangerous content by MailScanner, and is<br>believed to be clean.<br>For all your IT requirements visit <a href="http://www.transtec.co.uk">www.transtec.co.uk
</a><br><br>--<br>MailScanner mailing list<br><a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.info</a><br><a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner">http://lists.mailscanner.info/mailman/listinfo/mailscanner
</a><br><br>Before posting, read <a href="http://wiki.mailscanner.info/posting">http://wiki.mailscanner.info/posting</a><br><br>Support MailScanner development - buy the book off the website!<br></blockquote></div><br>