PDA

View Full Version : The Perfect SpamSnake - Ubuntu 8.04 LTS - Emails stuck in postfix queue


glazebrook
28th October 2008, 18:10
I was hoping you may be able to help me with regards to the above how to article. I followed the how to with no problems and the server has been running fine. Now for some reason all emails stay in /var/spool/postfix/hold directory.
The only error i seem to get is in /var/log/user.log

MailScanner: Process did not exit cleanly, returned 255 with signal 0

If i run MailScanner --lint it passes on everything.

Any help would be very much appreciated.

Rocky
29th October 2008, 13:40
Hey,

Try running in debug mode, it should give a better error message.
From the wiki
http://wiki.mailscanner.info/doku.php?id=documentation:test_troubleshoot:mailsc anner

How to use MailScanner’s debug mode effectively:

* Shutdown MailScanner and your MTA
* Start only your incoming MTA. This is usually done by the command
|service MailScanner startin| on Redhat. Other distros/OS may vary
* Set “Debug = yes” and “Debug SpamAssassin = yes” in
MailScanner.conf, then run ‘check_MailScanner’.
* Watch carefully the output for error messages and fix what you can
fix.
* Restore the debug options back to no
* Restart MailScanner

Rocky

glazebrook
29th October 2008, 19:22
Hi Rocky

Thanks for your reply.

How do i run the following check_MailScanner on ubuntu .When i run it i just get command not found.

Also i have narrowed the problem down to the fact that the emails only stay in the queue when there is an email with a zip file attachment. As soon as i remove the email from the queue the rest of the emails are delivered.

Any ideas?

Thanks again
Ben

glazebrook
14th November 2008, 14:30
Ok i have tracked down the problem.

Mailscanner was basically getting stuck in a loop when it received a .docx or .zip file.

By changing the following setting within mailscanner.conf

Maximum Archive Depth = 2 to Maximum Archive Depth = 5

Emails are no longer getting stuck in the queue.

Rocky
14th November 2008, 15:29
Hey,

It's weird that you had to set that option to 5, because mine is set to 2 and it's been working fine. But I'm happy you got it resolved and that's for the update.

Rocky

teixeira
19th November 2008, 03:35
Hey,

I'm having the same problem here.
I'm testing sending attachments to check if newly added filetypes were ok, i sent 3 emails with and wmv, mpg anf pps files separately and since 1 hr that e have a couple mails stucked in the quere.

As glazebrook, said MailScanner is reporting the same error in user.log and is in loop trying to process the messages.

I also changed the Maximum Archive Depth to 5 and did a MailScanner restart but no luck.

Regards,
Teixeira

Rocky
19th November 2008, 04:22
Are those filetypes allowed in your filetype rules file?

teixeira
19th November 2008, 04:30
Nope. They're blocked.
The idea was to test if they were passing or not.

I already deleted all /var/spool/postfix/hold files that were on the queue and restarted postfix and mailscanner but new mails still coming and stuck in the queue.

if helps, here is my current maillog:

Nov 19 02:31:18 scx MailScanner[6582]: MailScanner E-Mail Virus Scanner version 4.68.8 starting...
Nov 19 02:31:18 scx MailScanner[6582]: Read 817 hostnames from the phishing whitelist
Nov 19 02:31:18 scx MailScanner[6582]: Read 5141 hostnames from the phishing blacklist
Nov 19 02:31:19 scx MailScanner[6582]: Config: calling custom init function SQLBlacklist
Nov 19 02:31:19 scx MailScanner[6582]: Starting up SQL Blacklist
Nov 19 02:31:19 scx MailScanner[6582]: Read 0 blacklist entries
Nov 19 02:31:19 scx MailScanner[6582]: Config: calling custom init function MailWatchLogging
Nov 19 02:31:20 scx MailScanner[6582]: Started SQL Logging child
Nov 19 02:31:20 scx MailScanner[6582]: Config: calling custom init function SQLWhitelist
Nov 19 02:31:20 scx MailScanner[6582]: Starting up SQL Whitelist
Nov 19 02:31:20 scx MailScanner[6582]: Read 1 whitelist entries
Nov 19 02:31:21 scx MailScanner[6582]: SpamAssassin temporary working directory is /var/spool/MailScanner/incoming/SpamAssassin-Temp
Nov 19 02:31:21 scx MailScanner[6582]: Using SpamAssassin results cache
Nov 19 02:31:21 scx MailScanner[6582]: Connected to SpamAssassin cache database
Nov 19 02:31:22 scx MailScanner[6582]: Enabling SpamAssassin auto-whitelist functionality...
Nov 19 02:31:24 scx MailScanner[6582]: ClamAV scanner using unrar command /usr/bin/unrar
Nov 19 02:31:24 scx MailScanner[6582]: Using locktype = flock
Nov 19 02:31:24 scx MailScanner[6582]: New Batch: Scanning 2 messages, 5384 bytes
Nov 19 02:31:25 scx MailScanner[6582]: SpamAssassin cache hit for message 5AC63148066.E8316
Nov 19 02:31:25 scx MailScanner[6582]: SpamAssassin cache hit for message D019714805A.00BA8
Nov 19 02:31:25 scx MailScanner[6582]: Spam Checks: Found 2 spam messages
Nov 19 02:31:25 scx MailScanner[6582]: writing to /var/spool/MailScanner/quarantine/20081119/spam/5AC63148066.E8316: No such file or directory


Remark: I commented out all the filtypes i implemented before it happened to start from the beginnig.

Regards,
Teixeira

Rocky
19th November 2008, 04:40
Please resend a mail with the problem attachment and post your log here for me to take a look at.

teixeira
19th November 2008, 04:44
Hi,

I looked better in to the mail.log and the message

What happened? Well i remember to send those 3 kinda big email ( summed maybe 12MB all 3) at about 23:50 (18 Nov) i went drink a coffe when arrived (19 Nov) i noticed the emails hadn't been delivered.... i did the steps above...and now i made this:


root@scx:~# mkdir -p /var/spool/MailScanner/quarantine/20081119/spam
root@scx:~# chown -R postfix:www-data /var/spool/MailScanner/quarantine/20081119


I forced that 2 directories criation and new stucked emails just were delivered sucessfully.


Could MailScanner for any reason not checking everytime it has to write in /var/spool/MailScanner/quarantine/year_month_day/spam directory if this exists or not generates the mail.log error and mail stuck in queue?


Anyways, looks running ok now. But i've to to do some more tests like these i made today with and check if happens again.


Thanks.

Regards,
Teixeira

Rocky
19th November 2008, 14:04
Sounds like a permission problem to me. Verify that you did all the steps regarding changing or adding permissions to the folders.