I think this is indeed a better solution.<br><br><div class="gmail_quote">2011/1/26 Rick Cooper <span dir="ltr">&lt;<a href="mailto:rcooper@dwford.com">rcooper@dwford.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">




<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">If this is causing an issue the fix would be in the unpackrar 
function to test if the file is part of a multi-volume archive and not try and 
extract the file. But this is the same as allowing multipart emails, I wouldn&#39;t 
do it because there is no way to virus test a multipart attachment. Of course 
there could be a new config option to allow multi-volume rar (or 
maybe archives in general?) files that was rule based so you could 
allow a file name pattern from your own users and disallow from all 
else.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Testing for the multi-volume is fast and pretty easy. Command 
line would be :</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">    /path/unrar lv FileName</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Output would be either </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">-------------------------------------------------------------------------------<br>    
1        185500442 52428702  
28%       volume 1</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">                     ^            ^                           
^        +--  Volume 
Number</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">                     |            |                           
+ ----------- The Word Volume    </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">                     |            
+---------------------------------------- The size of this 
file<br>                     
+----------------------------------------------------- Total size of combined 
volume</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">or</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">-------------------------------------------------------------------------------<br>    
0                
0 52428702   0%       volume 
2</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">The 
first number is 1 for the first part and zero for the others so if the file 
size is known a regex (with all white space truncated to one char, no leading or 
trailing)</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2">    /^\d+\s\d+\s$FileSize\s\d+\%\svolume\s+$/, the 
file size part is just insurance we don&#39;t hit the string somewhere in the 
listing but really I think just adding</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2">another \d+ would suffice</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2">If 
this regex hit (and could probably just change the $FileSize to another \d+) you 
would know it was part of a multi-volume set.</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2">To me 
this is an overly complicated change to accommodate a one off situation. Can you 
not just enter pass in one of the file rules sets?</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span>I am looking at the unrar code and as I thought the lv 
is already used to check for password protection so</span> <span>changing the relevant part 
to:</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font> </div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span>  foreach $what (@test) {<br>    
#print STDERR &quot;Processing \&quot;$what\&quot;\n&quot;;<br>    # If we haven&#39;t 
hit any ------- lines at all, and we are prompted for<br>    # a 
password, then the whole archive is password-protected.<br>    
unless ($BeginInfo || $EndInfo) {<br>      if ($what =~ 
/^Encrypted file:/i &amp;&amp; !$allowpasswords) 
{<br>        
MailScanner::Log::WarnLog(&quot;Password Protected RAR 
Found&quot;);<br>        return 
&quot;password&quot;;<br>      
}</span></font></font></font></div>
<div><font face="Arial"><font color="#0000ff"><font size="2"><span>      if ($what =~ 
/^\s+\d+\s+\d+\s+\d+\s+\d+%\s+volume\s{0,}$/i) 
{<br>        
MailScanner::Log::WarnLog(&quot;Multi-Volume RAR 
Found&quot;);<br>        return 
&quot;multivolume&quot;;<br>      }<br><br>    
}<br></span></font></font></font></div>
<div><span><font color="#0000ff" face="Arial" size="2">This 
would prevent MailScanner from attempting to unpack the file and if the return 
is multivolume MS could handle it according to a configured setting, or default 
to rejecting outright instead of trying until it hits maxfail and rejects 
it.</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font> </span></div>
<div dir="ltr" align="left"><span></span><font color="#0000ff" face="Arial" size="2">B<span>ack to 
Julian</span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span>Rick</span></font></div>
<div dir="ltr" align="left"><br></div><br></div></blockquote></div>