Today we experienced some mail delivery problems on one of our client's servers running Centos 4 and postfix with amavisd for virus and spam scanning.
Trawl the log files
The mail logs where filling with errors such as:
(delivery temporarily suspended: lost connection with 127.0.0.1[127.0.0.1] while sending RCPT TO)
From the above entry it was clear that postfix was not having any joy when handing the email over to amavisd-new for scanning. A quick review of the amavisd log enties showed that this was the case and amavisd was having trouble with duplicate file names:
TROUBLE in process_request: Can't create file /var/amavis/tmp/amavis-7/email.txt: File exists at /usr/sbin/amavisd line 4837, <GEN4> line 158.
The cause of the problem was hidden deeper in the log files. It appears that there has been some corruption or an update occurred to the perl module File::Temp.
Error in processing, id=06353-01-2, mime_decode-1 FAILED: Can't locate object method "seek" via package "File::Temp" at /usr/lib/perl5/vendor_perl/5.8.5/MIME/Parser.pm line 816, <GEN6> line 57. (in reply to end of DATA command))
The solution
To fix the problem we upgraded the perl module using CPAN. This is not something I like to do as I prefer to use the distributions upgrade tools but there were no updates available. To fix:
perl -MCPAN -e shell;install File::Temp
Comments
not helped me
I mark,
I have the same issue.
I use Whitebox Enterprise Linux 4, postfix, amavisd-new, clamd.
I updated File:Temp module but not resolved by this mathod.
ok but i saw in /var/amavisd/tmp directory and found mote than 31700 items. so i renamed tmp to tmp.old and created tmp again. given same permission. and problem resolved.
Is it because of massive virus attack? Or Amavisd can't handle items more than 31700 files. 5 days before i had to do same thing.
any way how to find out cause.
What is meaning of " line 158."
for me error in log file is "TROUBLE in process_request: Can't create file /var/amavis/tmp/amavis-7/email.txt: File exists at /usr/sbin/amavisd line 4717, line 14."
how do we find the exact cause.
I will be very helpfull if reply.
Sukhdev Jadhav
sukhdevjadhav@gmail.com
Hi Sukhdev,I have had the
Hi Sukhdev,
I have had the problem this article talks about on different occasions now. In most cases it is some perl module that amavisd needs. Its a different one each time. Its quiet annoying. I am not sure whats happening with your /tmp directory but 30 000+ sounds like a lot of files.
As for the error message "line 158" means the error occurred on line 158 of the script it was running. Have a look at the init script and you can see what it calls and trace from there but the log file will probably list the script name too.
The other error message "Can't create file /var/amavis/tmp/amavis-7/email.txt: File exists at /usr/sbin/amavisd line 4717, line 14." probably means that this is a lock file of some type that already exists and the script needs to create before running. I would first have a look at this file to see what it is, try moving it and then run the script again.
Hope that it helps.