[Mimedefang] Timeouts and message_contains_virus

Petra Humann humann at tcs.inf.tu-dresden.de
Wed Jan 27 03:23:41 EST 2010


Am 26.01.2010 um 15:08 schrieb Jan-Pieter Cornet:

> Op 26 jan 2010, om 10:47 heeft Petra Humann het volgende geschreven:
>> I'm using message_contains_virus_sophie for virus checking.
>> Sometimes (rarely) the sophie daemon dies, but the socket file  
>> persists.
>> Because of this mimedefang-filter can't get results from the  
>> subroutine
>> and the mail server is temp failing any mail.
>>
>>> ... sm-mta[15124]: o0PFjX0p015124: Milter (mimedefang): timeout  
>>> before data read, where=body
>>> ... sm-mta[15124]: o0PFjX0p015124: Milter (mimedefang): to error  
>>> state
>>> ... sm-mta[15124]: o0PFjX0p015124: Milter: data, reject=451 4.3.2  
>>> Please try again later
>>
>> Is it possible to set a timeout value for getting the result
>> of virus scanning in message_contains_virus_sophie?
>
>
> On a .pdf attachment maybe? We had the same issue over a year ago,  
> reported to sophos, never really heard back that it's fixed, but  
> newer versions of the engine could suddenly process the sample file  
> I collected.
The reason seems to be the HUP signal to reload the virus patterns  
after updating sophos.
My version of sophie was old for any reasons, I updated today.

Am 26.01.2010 um 15:16 schrieb David F. Skoll:

> Petra Humann wrote:
>
>> Is it possible to set a timeout value for getting the result
>> of virus scanning in message_contains_virus_sophie?
>
> Well, not directly, but you could do something like:
>
> eval {
>     local $SIG{'ALRM'} = sub { die "Timeout\n"; };
>     alarm(10);
>     # Do your virus scanning
>     alarm(0);
> };
>
> if ($@ && $@ =~ /Timeout/) {
>   # Handle a timeout
> } else {
>   # Handle the normal case
> }

Thank you very much.
Petra Humann
---
Mail:    humann at tcs.inf.tu-dresden.de
WWW:     http://wwwtcs.inf.tu-dresden.de/~humann/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4649 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20100127/ffd3c997/attachment-0003.p7s>


More information about the MIMEDefang mailing list