not possible to set archiver that works only on files and not on pipes

DaLiV daliv.tyw at
Thu Dec 22 21:35:26 CET 2016

amavisd archivers works only on piped in command line content
as amavisd have such construction:
sub run_command($$@) {
   my $msg = join(' ', $cmd, @args, "<$stdin_from", "2>$stderr_to");

so not possible to configure behaviour for decompressors thar works only with real files and not with pipes
as example replacement for proprietary rar may be LGPL-ed unar archiver look at :

so would be nice in amavisd.conf write
@decoders = (
['rar',  \&do_uncompress, ['unar -D'] ],
['cab',  \&do_uncompress, ['unar -D'] ],
['zipx',  \&do_uncompress, ['unar -D'] ],
['iso',  \&do_uncompress, ['unar -D'] ],
['msi',  \&do_uncompress, ['unar -D'] ],
but that will not works

possible implement /dirty hack/
sub run_command($$@) {
   my($stdin_from, $stderr_to, $cmd, $piped, @args) = @_;
   my $msg = join(' ', $cmd, @args, "$piped$stdin_from", "2>$stderr_to");

and replace all calls to "run_command" with new syntaxis ...
or implement another way for that...

More information about the amavis-users mailing list