MailScanner: extracting attachments

Rick Cooper rcooper at dwford.com
Fri Mar 14 17:18:05 GMT 2008


 


  _____  

From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Devon
Harding
Sent: Friday, March 14, 2008 12:47 PM
To: MailScanner discussion
Subject: Re: MailScanner: extracting attachments




On Fri, Mar 14, 2008 at 9:25 AM, Rick Cooper <rcooper at dwford.com> wrote:


you are the third our fourth unresolved instance of this problem, I have yet
to see anyone post an lsof output of the hung process to see if it's doing
something funny disk wise when this is happening. Could you list the output
of the hung process?It seems to me this happend to me once when I updated
MailTools with the latestes rather than the one supplied with MailScanner,
and when I reinstalled the MailScanner version all was fine, I could be
wrong though it's been a while back but I am sure it had to do with a perl
module that Jules patched/provides.
 
Rick



[Rick Cooper]
 
lsof is nothing like ps really. It's looking at op files and file can be
pretty much any device, disk or other stream. For instance here is lsof
output from one mailscanner process
 
COMMAND     PID USER   FD   TYPE     DEVICE    SIZE     NODE NAME
MailScann 14635 root  cwd    DIR        3,3    4096 24461518
/opt/MailScanner-4.67.6-1/bin
MailScann 14635 root  rtd    DIR        3,3    4096        2 /
MailScann 14635 root  txt    REG        3,3 1000550   330302 /usr/bin/perl
MailScann 14635 root  mem    REG        3,3   85420  3653635
/lib/ld-2.2.5.so
MailScann 14635 root  mem    REG        3,3  104356 35930443
/usr/lib/perl5/5.8.8/i686-linux/auto/POSIX/POSIX.so
MailScann 14635 root  mem    REG        3,3   12497 33751127
/usr/lib/perl5/5.8.8/i686-linux/auto/MIME/Base64/Base64.so
MailScann 14635 root  mem    REG        3,3   85262  3653667
/lib/libnsl-2.2.5.so
MailScann 14635 root  mem    REG        3,3   11728  3653664
/lib/libdl-2.2.5.so
MailScann 14635 root  mem    REG        3,3  173359  4669467
/lib/i686/libm-2.2.5.so
MailScann 14635 root  mem    REG        3,3   22645  3653651
/lib/libcrypt-2.2.5.so
MailScann 14635 root  mem    REG        3,3   10982  3653685
/lib/libutil-2.2.5.so
MailScann 14635 root  mem    REG        3,3    9193 12370085
/usr/lib/perl5/site_perl/5.8.0/i686-linux/auto/Filesys/Df/Df.so
MailScann 14635 root  mem    REG        3,3   17535 35078297
/usr/lib/perl5/5.8.8/i686-linux/auto/IO/IO.so
MailScann 14635 root  mem    REG        3,3   16874 26656909
/usr/lib/perl5/5.8.8/i686-linux/auto/Fcntl/Fcntl.so
MailScann 14635 root  mem    REG        3,3   22941 25755778
/usr/lib/perl5/5.8.8/i686-linux/auto/Time/HiRes/HiRes.so
MailScann 14635 root  mem    REG        3,3  101902  4669465
/lib/i686/libpthread-0.9.so
MailScann 14635 root  mem    REG        3,3   30157  3653681
/lib/librt-2.2.5.so
MailScann 14635 root  mem    REG        3,3    7280 25870570
/usr/lib/perl5/5.8.8/i686-linux/auto/Sys/Hostname/Hostname.so
MailScann 14635 root  mem    REG        3,3   18264 34947217
/usr/lib/perl5/5.8.8/i686-linux/auto/File/Glob/Glob.so
MailScann 14635 root  mem    REG        3,3   25481 28557540
/usr/lib/perl5/5.8.8/i686-linux/auto/Socket/Socket.so
MailScann 14635 root  mem    REG        3,3   46077 26624212
/usr/lib/perl5/5.8.8/i686-linux/auto/DB_File/DB_File.so
MailScann 14635 root  mem    REG        3,3  818785  9830493
/usr/local/BerkeleyDB.4.3/lib/libdb-4.3.so
MailScann 14635 root  mem    REG        3,3   17391 33669192
/usr/lib/perl5/5.8.8/i686-linux/auto/Sys/Syslog/Syslog.so
MailScann 14635 root  mem    REG        3,3   45766  6864988
/usr/lib/perl5/site_perl/5.8.0/i686-linux/auto/HTML/Parser/Parser.so
MailScann 14635 root  mem    REG        3,3   25000 33505286
/usr/lib/perl5/5.8.8/i686-linux/auto/List/Util/Util.so
MailScann 14635 root  mem    REG        3,3  125615 25231604
/usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/Compress/Raw/Zlib/Zlib.so
MailScann 14635 root  mem    REG        3,3   10829 26656979
/usr/lib/perl5/5.8.8/i686-linux/auto/Cwd/Cwd.so
MailScann 14635 root  mem    REG        3,3   15136 25755769
/usr/lib/perl5/5.8.8/i686-linux/auto/Digest/MD5/MD5.so
MailScann 14635 root  mem    REG        3,3  111561 34783434
/usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBI/DBI.so
MailScann 14635 root  mem    REG        3,3   30502 33669302
/usr/lib/perl5/5.8.8/i686-linux/auto/Data/Dumper/Dumper.so
MailScann 14635 root  mem    REG        3,3   35111 28557520
/usr/lib/perl5/5.8.8/i686-linux/auto/Encode/Encode.so
MailScann 14635 root  mem    REG        3,3   71681 24281139
/usr/lib/perl5/5.8.8/i686-linux/auto/Storable/Storable.so
MailScann 14635 root  mem    REG        3,3   16323  3653675
/lib/libnss_dns-2.2.5.so
MailScann 14635 root  mem    REG        3,3   42897  3653679
/lib/libnss_files-2.2.5.so
MailScann 14635 root  mem    REG        3,3 1447979 24559767
/usr/lib/perl5/site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so
MailScann 14635 root  mem    REG        3,3   64733  3653704
/lib/libresolv-2.2.5.so
MailScann 14635 root  mem    REG        3,3 1401027  4669466
/lib/i686/libc-2.2.5.so
MailScann 14635 root    0r   CHR        1,3            70897 /dev/null
MailScann 14635 root    1w   CHR        1,3            70897 /dev/null
MailScann 14635 root    2w   CHR        1,3            70897 /dev/null
MailScann 14635 root    3u  unix 0xe2c21580         50320558 socket
MailScann 14635 root    4r   REG        3,3   58177 17940707
/opt/MailScanner-4.67.6-1/lib/MailScanner/CustomConfig.pm
MailScann 14635 root    5r   REG        3,3   22207 17940721
/opt/MailScanner-4.67.6-1/lib/MailScanner/ConfigDefs.pl
MailScann 14635 root    6r   REG        3,3    7867 19202291
/opt/MailScanner-4.67.6-1/lib/MailScanner/CustomFunctions/GenericSpamScanner
.pm
MailScann 14635 root    7u  IPv4   50321024              TCP localhost:11553
(LISTEN)
MailScann 14635 root    8u  IPv4   50321031              TCP
localhost:53362->localhost:mysql (ESTABLISHED)

As you can see it shows exactly what modules are open, what devices, files,
dirs, etc. man lsof is a good read. For instance if the problem is caused by
lstat blocking you would likely lock at that point and need to add -b to the
command. +r 5 would cause it to redisplay after 5 seconds so you could see
what files are staying open/changing. lsof +r  -p pid_of_stuck_process or
lsof +r -c MailScanner to watch all MailScanner processes. I have also seen
this exact thing happen with a fooBar tnef attachment and (I think) external
tnef. If you use a pid and repeat and the information goes away then you
know the child is dying without notice and you can use the -c option to see
what is common in terms of open files, specifically files in the batch. Also
note that lsof is going to show the actually file/dir and not the symlinks
(such as the above MailScanner dir)
 
Rick 
 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20080314/3ad65b8c/attachment-0001.html


More information about the MailScanner mailing list