<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="GtkHTML/4.2.2">
</head>
<body link="#0000ff">
fre 2013-04-05 klockan 14:37 &#43;0000 skrev Nikolaos Pavlidis:
<blockquote type="CITE">Hello all,<br>
<br>
&nbsp;<br>
<br>
Many thanks Glenn for the very detailed explanation! I have made the changes and I am holding my breath to see what happens.. after all.. I cannot test it with the email that is in the quarantine.. it is already buggered! Many thanks for all your help.<br>
<br>
&nbsp;<br>
<br>
Final question:<br>
<br>
&nbsp;<br>
<br>
Is disabling that option going to affect the <a href="http://www.inetmsg.com/pub/">
http://www.inetmsg.com/pub/</a> unofficial signature databases I am using with ClamAV?<br>
<br>
&nbsp;<br>
<br>
Thanks again.<br>
<br>
&nbsp;<br>
<br>
Kind regards,<br>
<br>
&nbsp;<br>
<br>
Nik<br>
<br>
</blockquote>
<br>
Sorry Nik (and Steve!)... I think I'm turning slightly senile:-)... Steve is right, that option is to dump the entire message *with headers* in there, which is likely harmless to the file command(s)... What I was thinking of, but remembering kind of wrong,
 was the <br>
Find UU-Encoded Files = <br>
setting ... If that one is &quot;yes&quot;, change it to &quot;no&quot;.<br>
<br>
Cheers<br>
-- <br>
-- Glenn<br>
<blockquote type="CITE">&nbsp;<br>
<br>
<b>From:</b> mailscanner-bounces@lists.mailscanner.info [mailto:mailscanner-bounces@lists.mailscanner.info]
<b>On Behalf Of </b>Glenn Steen<br>
<b>Sent:</b> 05 April 2013 10:11<br>
<b>To:</b> MailScanner discussion<br>
<b>Subject:</b> Re: Filetype Checks: No executables on Greek Emails<br>
<br>
&nbsp;<br>
<br>
</blockquote>
<blockquote type="CITE">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:-).<br>
<br>
</blockquote>
<blockquote type="CITE">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'n'paste from your MUA, or similar.<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">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).<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">Cheers!<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">--&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">-- Glenn<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
</blockquote>
<blockquote type="CITE">On 5 April 2013 10:54, Glenn Steen &lt;<a href="mailto:glenn.steen@gmail.com">glenn.steen@gmail.com</a>&gt; wrote:<br>
<br>
</blockquote>
<blockquote type="CITE">I'm guessing that you have<br>
<br>
ClamAV Full Message Scan = yes<br>
<br>
</blockquote>
<blockquote type="CITE">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't seem to need this &quot;help&quot;). The goal is to catch malware that isn't &quot;properly&quot;
 encoded, but rather just dumped in the message body.<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">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).<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">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:).<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">Provided one has the file -i column in filetypes.rules.conf (it is an optional fifth column, meaning that you likely don'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.<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">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:-):-).<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">As I'm sure you've noticed, this isn'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).<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">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't lose that much security
 by doing so.<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">Cheers!<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">--&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">-- Glenn<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">Den 22 mar 2013 16:40 skrev &quot;Nikolaos Pavlidis&quot; &lt;<a href="mailto:Nikolaos.Pavlidis@beds.ac.uk">Nikolaos.Pavlidis@beds.ac.uk</a>&gt;:<br>
<br>
</blockquote>
<blockquote type="CITE">
<blockquote>&nbsp;<br>
<br>
Hello all,<br>
<br>
I'm having an issue with Mailscanner which weirdly enough has been already discussed here<br>
<a href="http://markmail.org/message/56fofuvh4tzde7hz#query:&#43;page:1&#43;mid:mu77m5qs6zjhh2jx&#43;state:results">http://markmail.org/message/56fofuvh4tzde7hz#query:&#43;page:1&#43;mid:mu77m5qs6zjhh2jx&#43;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 &nbsp;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 &nbsp; text &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; - &nbsp; &nbsp; &nbsp; text/plain &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; - &nbsp; &nbsp; &nbsp; text/x-mail &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; - &nbsp; &nbsp; &nbsp; message/rfc822 &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; \bscript &nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; archive &nbsp; &nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
allow &nbsp; postscript &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -<br>
deny &nbsp; &nbsp;self-extract &nbsp; &nbsp;No self-extracting archives &nbsp; &nbsp; No self-extracting archives allowed<br>
deny &nbsp; &nbsp;executable &nbsp; &nbsp; &nbsp;No executables &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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">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>
<br>
</blockquote>
</blockquote>
<blockquote type="CITE"><br>
<br>
</blockquote>
<blockquote type="CITE">&nbsp;<br>
<br>
<br>
</blockquote>
<blockquote type="CITE">-- <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 <br>
<br>
<br>
</blockquote>
<br>
</body>
</html>