> On Dec 22, 2016, at 21:35, DaLiV <[email protected]> wrote:
> 
> 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 : unarchiver.c3.cx/formats
> 
> 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
> 
> A:
> 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 ...
> B:
> or implement another way for that...
> 

I'd configure amavisd.conf with unar-wrapper.sh that will read stdin into tmp 
file, exec unar with tmp, then unlink tmp.

Reply via email to