<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 29/08/2021 04:03, Nick Tait wrote:<br>
</div>
<blockquote type="cite"
cite="mid:74431556-4e5b-15da-d796-c10884ded657@tait.net.nz">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p>Hi there.</p>
<p>Apologies for resending this, but I discovered I had a problem
with my DKIM signature on the original email, so it may have
been blocked by many list recipients...<br>
</p>
<p>I've recently upgraded my email relay, which has amavisd-new
installed, and when amavis starts up it logs all the file types
which it doesn't have decoders for. Looking at the amavisd-new
script, I can see that @decoders is set to:</p>
<blockquote><font face="monospace"> @decoders = ( </font><br>
<font face="monospace"> ['mail',
\&Amavis::Unpackers::do_mime_decode], </font><br>
<font face="monospace"># [[qw(asc uue hqx ync)],
\&Amavis::Unpackers::do_ascii], # not safe </font><br>
<font face="monospace"> ['F',
\&Amavis::Unpackers::do_uncompress, \$unfreeze], </font><br>
<font face="monospace"> # ['unfreeze', 'freeze -d',
'melt', 'fcat'] ], </font><br>
<font face="monospace"> ['Z',
\&Amavis::Unpackers::do_uncompress, \$uncompress], </font><br>
<font face="monospace"> # ['uncompress', 'gzip -d',
'zcat'] ], </font><br>
<font face="monospace"> ['gz',
\&Amavis::Unpackers::do_uncompress, \$gunzip], </font><br>
<font face="monospace"> ['gz',
\&Amavis::Unpackers::do_gunzip], </font><br>
<font face="monospace"> ['bz2',
\&Amavis::Unpackers::do_uncompress, \$bunzip2], </font><br>
<font face="monospace"> ['xz',
\&Amavis::Unpackers::do_uncompress, </font><br>
<font face="monospace"> ['xzdec', 'xz -dc', 'unxz
-c', 'xzcat'] ], </font><br>
<font face="monospace"> ['lzma',
\&Amavis::Unpackers::do_uncompress, </font><br>
<font face="monospace"> ['lzmadec', 'xz -dc
--format=lzma', </font><br>
<font face="monospace"> 'lzma -dc', 'unlzma -c',
'lzcat', 'lzmadec'] ], </font><br>
<font face="monospace"> ['lrz',
\&Amavis::Unpackers::do_uncompress, </font><br>
<font face="monospace"> ['lrzip -q -k -d -o -',
'lrzcat -q -k'] ], </font><br>
<font face="monospace"> ['lzo',
\&Amavis::Unpackers::do_uncompress, \$unlzop], </font><br>
<font face="monospace"> ['lz4',
\&Amavis::Unpackers::do_uncompress, ['lz4c -d'] ], </font><br>
<font face="monospace"> ['rpm',
\&Amavis::Unpackers::do_uncompress, \$rpm2cpio], </font><br>
<font face="monospace"> # ['rpm2cpio.pl',
'rpm2cpio'] ], </font><br>
<font face="monospace"> [['cpio','tar'],
\&Amavis::Unpackers::do_pax_cpio, \$pax], </font><br>
<font face="monospace"> #
['/usr/local/heirloom/usr/5bin/pax', 'pax', 'gcpio', 'cpio']
], </font><br>
<font face="monospace"># ['tar',
\&Amavis::Unpackers::do_tar], # no longer supported </font><br>
<font face="monospace"> ['deb',
\&Amavis::Unpackers::do_ar, \$ar], </font><br>
<font face="monospace"># ['a',
\&Amavis::Unpackers::do_ar, \$ar], #unpacking .a seems an
overkill </font><br>
<font face="monospace"> ['rar',
\&Amavis::Unpackers::do_unrar, \$unrar], # ['unrar',
'rar'] </font><br>
<font face="monospace"> ['arj',
\&Amavis::Unpackers::do_unarj, \$unarj], # ['unarj',
'arj'] </font><br>
<font face="monospace"> ['arc',
\&Amavis::Unpackers::do_arc, \$arc], # ['nomarch',
'arc'] </font><br>
<font face="monospace"> ['zoo',
\&Amavis::Unpackers::do_zoo, \$zoo], # ['zoo',
'unzoo'] </font><br>
<font face="monospace"> ['doc',
\&Amavis::Unpackers::do_ole, \$ripole], </font><br>
<font face="monospace"> ['cab',
\&Amavis::Unpackers::do_cabextract, \$cabextract], </font><br>
<font face="monospace"> ['tnef',
\&Amavis::Unpackers::do_tnef_ext, \$tnef], </font><br>
<font face="monospace"> ['tnef',
\&Amavis::Unpackers::do_tnef], </font><br>
<font face="monospace"># ['lha',
\&Amavis::Unpackers::do_lha, \$lha], # not safe, use 7z
instead </font><br>
<font face="monospace"># ['sit',
\&Amavis::Unpackers::do_unstuff, \$unstuff], # not safe </font><br>
<font face="monospace"> [['zip','kmz'],
\&Amavis::Unpackers::do_7zip, ['7za', '7z'] ], </font><br>
<font face="monospace"> [['zip','kmz'],
\&Amavis::Unpackers::do_unzip], </font><br>
<font face="monospace"> ['7z',
\&Amavis::Unpackers::do_7zip, ['7zr', '7za', '7z'] ], </font><br>
<font face="monospace"> [[qw(gz bz2 Z tar)], </font><br>
<font face="monospace">
\&Amavis::Unpackers::do_7zip, ['7za', '7z'] ], </font><br>
<font face="monospace"> [[qw(xz lzma jar cpio arj rar swf lha
iso cab deb rpm)], </font><br>
<font face="monospace">
\&Amavis::Unpackers::do_7zip, '7z' ], </font><br>
<font face="monospace"> ['exe',
\&Amavis::Unpackers::do_executable, \$unrar, \$lha,
\$unarj], </font><br>
<font face="monospace"> ); </font></blockquote>
<p>Which seems to say that 7z can be used for the following file
extensions:<br>
</p>
<blockquote><font face="monospace">zip kmz</font><br>
<font face="monospace">7z</font><br>
<font face="monospace">gz bz2 Z tar</font><br>
<font face="monospace">xz lzma jar cpio arj rar swf lha iso cab
deb rpm</font></blockquote>
<p>So after installing p7zip-full and p7zip-rar packages, which
provide the 7z program (and also 7zr and 7za), I'm curious why I
still see warnings for rpm, rar, arj and cab:<br>
</p>
<blockquote>
<p><font face="monospace">Aug 29 13:13:39 mx amavis[10781]: No
ext program for .rpm, tried: rpm2cpio.pl, rpm2cpio <br>
Aug 29 13:13:39 mx amavis[10781]: No ext program for .rar,
tried: unrar-free <br>
Aug 29 13:13:39 mx amavis[10781]: No ext program for .arj,
tried: arj, unarj <br>
Aug 29 13:13:39 mx amavis[10781]: No ext program for .cab,
tried: cabextract </font><br>
</p>
</blockquote>
<p>Does this mean that 7z isn't going to be used for these file
types? And if so, is there something I can do to get amavis to
use 7z for these file types?</p>
<p>Or should these messages just be ignored?</p>
<p>And on a related note, I know (on Windows at least) 7-zip can
handle self-extracting exe files, although I notice that the
"man 7z" manual page doesn't mention EXE files. So I wonder
whether exe should or shouldn't be added to the list of files
that 7z can handle in a future version of amavis?<br>
</p>
</blockquote>
<p>You can set @decoders yourself (e.g. in
/etc/amavis/conf.d/50-user).</p>
<p>I let ClamAV do the unpacking for extensions that it can handle
(see <a class="moz-txt-link-freetext" href="https://www.clamav.net/documents/introduction">https://www.clamav.net/documents/introduction</a>), but I have:</p>
<p>[[qw(jar swf lha rpm)], \&do_7zip, '7z' ],</p>
<p>and with $log_level = 1 when I reload amavis I see:</p>
<p>2021-08-29 09:06:01 streamingbats amavis[2976]: Found decoder
for .jar at /usr/bin/7z<br>
2021-08-29 09:06:01 streamingbats amavis[2976]: Found decoder
for .swf at /usr/bin/7z<br>
2021-08-29 09:06:01 streamingbats amavis[2976]: Found decoder
for .lha at /usr/bin/7z<br>
2021-08-29 09:06:01 streamingbats amavis[2976]: Found decoder
for .rpm at /usr/bin/7z<br>
</p>
<p>Maybe your 7z is installed in a place that amavis cannot find?<br>
</p>
<p>Workaround: since rar, arj and cab are all handled by ClamAV you
could remove them. That just leaves rpm for which you could
install rpm2cpio?<br>
</p>
</body>
</html>