<div dir="ltr">BTW, when stripping down the body, you may need &quot;de-MIME&quot; a bit as well, to get the actual thing that file sees... Can be a bit tricky:-).<div style>IIRC there is a common greek greeting phrase that will start with a character that is guaranteed to be interpreted as a DOS executable... so you might not need go through the trouble of the copy/edit thing, just put that greeting in a (text) file and run file/file -i on that... or just cut&#39;n&#39;paste from your MUA, or similar.</div>
<div style><br></div><div style>I mentioned russion and greek specifically, but this has been reported for other non-english languages as well (french and some south east asian language, at least... for french the culprit was an É or Ë or similar).</div>
<div style><br></div><div style>Cheers!</div><div style>-- </div><div style>-- Glenn</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 April 2013 10:54, Glenn Steen <span dir="ltr">&lt;<a href="mailto:glenn.steen@gmail.com" target="_blank">glenn.steen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p>I&#39;m guessing that you have</p><p></p><p>ClamAV Full Message Scan = yes</p><div>set in MailScanner.conf ... This will make MailScanner &quot;unpack&quot; the body of the email as a file in the directory presented to ClamAV for scanning (other AVs don&#39;t seem to need this &quot;help&quot;). The goal is to catch malware that isn&#39;t &quot;properly&quot; encoded, but rather just dumped in the message body.</div>

<div>For non-english locales, especially greek and russian locales, this can be ... less than fortunate, since the &quot;body file&quot; will be present when the file command is run on the directory, and the file command has some very naive one byte magic detection &quot;strings&quot; that will interprete common greek (or russion KOI-8) characters as being the start of an MS-DOS executable (COM-files et al).</div>

<div>When the message is quarantined, the &quot;whole message file&quot; (including headers) is stored in the quarantine (not the file containing just the body), so a simplistic &quot;file message&quot; command will not show the root cause. You need make a copy of that file and manually remove all the headers (and the blank line separating the headers from the body), then run file (and file -i) command on that to see the gory details:).</div>

<div><br></div><div>Provided one has the file -i column in filetypes.rules.conf (it is an optional fifth column, meaning that you likely don&#39;t have it and need add it yourself... The columns are &lt;TAB&gt; -separated!), you can use the file -i commands &quot;findings&quot; in that column, for the line that triggers the blocking.... Having lines with file -i &quot;syntax&quot; will make the file -i take precedence ... I think, at least.</div>

<div>The common practice of changing the &quot;File Command = &quot; setting to the file -i command is perhaps less work, but it is also less secure, since the string matching on the result may be even less reliable than usual. Then again, file type checking is more of an art than a science:-):-).</div>

<div><br></div><div>As I&#39;m sure you&#39;ve noticed, this isn&#39;t a new problem, it has been with MailScanner for quite a few years (if not since the very begining). The methods for fixing the problem has varied over the years (editing the magic file, reporting it to the file command maintainers as a bug, using file -i straight up etc), but the interface Jules has provided is actually the very best imaginable, so do explore that... In a stock filetype.rules.conf file there is even an example for the DOS executables that file -i might find (hopefully a bit more securely than the plain file command... Though the commands are actually one and the same, the -i uses a different magic file, not just different descriptive strings).</div>

<div><br></div><div>Changing the ClamAV setting shown above to &quot;no&quot; will make this problem a lot less common (read: go away completely:-), as well, so that might be another very viable option... If you use more than one AV, you don&#39;t lose that much security by doing so.</div>

<div><br></div><div>Cheers!</div><span class="HOEnZb"><font color="#888888"><div>-- </div><div>-- Glenn</div><p></p></font></span><div class="gmail_quote"><span class="HOEnZb"><font color="#888888">Den 22 mar 2013 16:40 skrev &quot;Nikolaos Pavlidis&quot; &lt;<a href="mailto:Nikolaos.Pavlidis@beds.ac.uk" target="_blank">Nikolaos.Pavlidis@beds.ac.uk</a>&gt;:</font></span><div>
<div class="h5"><br type="attribution">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello all,<br>
<br>
I&#39;m having an issue with Mailscanner which weirdly enough has been already discussed here<br>
<a href="http://markmail.org/message/56fofuvh4tzde7hz#query:+page:1+mid:mu77m5qs6zjhh2jx+state:results" target="_blank">http://markmail.org/message/56fofuvh4tzde7hz#query:+page:1+mid:mu77m5qs6zjhh2jx+state:results</a><br>



<br>
The problem is:<br>
<br>
Mar 22 15:00:18 smtp1 MailScanner[17935]: Filetype Checks: No executables (r2JAPluH011324 )<br>
Mar 22 15:00:46 smtp1 MailScanner[17935]: Saved entire message to /var/spool/MailScanner/quarantine/20130322/r2JAPluH011324<br>
<br>
And:<br>
<br>
[root@smtp1 r2JAPluH011324]# pwd<br>
/var/spool/MailScanner/quarantine/20130322/r2JAPluH011324<br>
[root@smtp1 r2JAPluH011324]# ll<br>
total 28K<br>
-rw------- 1 root root  22K Mar 22 15:00 dfr2JAPluH011324<br>
-rw------- 1 root root 3.7K Mar 22 15:00 qfr2JAPluH011324<br>
[root@smtp1 r2JAPluH011324]# file -i *<br>
dfr2JAPluH011324: text/plain; charset=us-ascii<br>
qfr2JAPluH011324: text/plain; charset=unknown<br>
<br>
But I have also added the lines suggested in the previous thread so my filetype.rules.conf looks like:<br>
<br>
&lt;snip&gt;<br>
allow   text            -                       -<br>
allow   -       text/plain      -                       -<br>
allow   -       text/x-mail     -                       -<br>
allow   -       message/rfc822  -                       -<br>
allow   \bscript        -                       -<br>
allow   archive         -                       -<br>
allow   postscript      -                       -<br>
deny    self-extract    No self-extracting archives     No self-extracting archives allowed<br>
deny    executable      No executables          No programs allowed<br>
&lt;snip&gt;<br>
<br>
I have restarted mailscanner before re-queuing the message but always the same result...<br>
<br>
Any ideas/recommendations would be much appreciated,<br>
<br>
Kind regards,<br>
<br>
Nik<br>
<br>
--<br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" target="_blank">http://lists.mailscanner.info/mailman/listinfo/mailscanner</a><br>
<br>
Before posting, read <a href="http://wiki.mailscanner.info/posting" target="_blank">http://wiki.mailscanner.info/posting</a><br>
<br>
Support MailScanner development - buy the book off the website!<br>
</blockquote></div></div></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>-- Glenn<br>email: glenn &lt; dot &gt; steen &lt; at &gt; gmail &lt; dot &gt; com<br>work: glenn &lt; dot &gt; steen &lt; at &gt; ap1 &lt; dot &gt; se
</div></div>