PDA

View Full Version : [ubuntu] MailScanner not working after 9.10 upgrade



dalto
November 4th, 2009, 03:50 AM
I upgraded from 9.04 to 9.10 and I only have one issue. However, I am having trouble finding a solution.

Ever since upgrade my MailScanner is not working correctly. It just restarts every couple of seconds.

There are no errors in the log so I ran MailScanner in debug mode. However, when I run it in debug mode it works fine. I get no errors and it does just what it should. However, when I re-enable it I just get this over few seconds in my logs and no mail is delivered.


Nov 3 20:44:22 gandalf MailScanner[10676]: MailScanner E-Mail Virus Scanner version 4.74.16 starting...
Nov 3 20:44:22 gandalf MailScanner[10676]: Read 848 hostnames from the phishing whitelist
Nov 3 20:44:22 gandalf MailScanner[10676]: Read 4278 hostnames from the phishing blacklist
Nov 3 20:44:23 gandalf MailScanner[10676]: Using SpamAssassin results cache
Nov 3 20:44:23 gandalf MailScanner[10676]: Connected to SpamAssassin cache database
Nov 3 20:44:23 gandalf MailScanner[10676]: Enabling SpamAssassin auto-whitelist functionality...
Nov 3 20:44:24 gandalf MailScanner[10676]: I have found clamd scanners installed, and will use them all by default.
Nov 3 20:44:24 gandalf MailScanner[10676]: Using locktype = flock
Nov 3 20:44:24 gandalf MailScanner[10676]: New Batch: Scanning 20 messages, 162600 bytes
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 6C9DD3A023.27991
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 3737C3A006.E18D3
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message B8D713A015.0F684
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 59A4A3A007.0C4AD
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message EC7C23A134.17AE5
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message A060E3A032.14CA5
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 5F3D93A029.2733C
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 45EE53A00A.399D2
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 3366A3A027.73BA9
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 8A3D53A003.9C145
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message A98C93A025.30C01
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 518723A02F.9A8E9
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 0A8833A02A.30ED9
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message AEFB43A014.96AB1
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message CA0D53A004.8EE14
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 149E13A00B.892E5
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message DF6E63A135.AD49D
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 255813A028.044E8
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 63AF13A009.F3A58
Nov 3 20:44:24 gandalf MailScanner[10676]: SpamAssassin cache hit for message 774033A008.56F6E
Nov 3 20:44:24 gandalf MailScanner[10676]: Spam Checks: Found 18 spam messages


Any help is appreciated.

tps
November 4th, 2009, 05:49 AM
Same here. It looks like it never gets to the point that it's moving the mail to the outbound queue. I may change this to not deliver in the background to see if that helps...

Tim

tps
November 4th, 2009, 06:01 AM
I'm now getting:

Insecure dependency in chown while running with -T switch at /usr/share/MailScanner//MailScanner/Message.pm line 2407.

dalto
November 4th, 2009, 06:23 AM
I'm now getting:

Insecure dependency in chown while running with -T switch at /usr/share/MailScanner//MailScanner/Message.pm line 2407.

You can't run it as root. Run it as the user it normally runs as using sudo -u <username>.

tps
November 4th, 2009, 06:53 AM
You can't run it as root. Run it as the user it normally runs as using sudo -u <username>.

setting debug, and running '/etc/init.d/mailscanner start' should do the right thing, no?

dalto
November 4th, 2009, 07:14 AM
setting debug, and running '/etc/init.d/mailscanner start' should do the right thing, no?

I believe when you set debug you need to run it interactively.

I did it by using "sudo -u postfix MailScanner"

tps
November 4th, 2009, 01:35 PM
I believe when you set debug you need to run it interactively.

I did it by using "sudo -u postfix MailScanner"

'cpan install IO' did the trick for me. It's now working again...

Tim

dalto
November 4th, 2009, 06:37 PM
Still no luck for me.

If anyone has any ideas I would appreciate it.

tps
November 5th, 2009, 02:25 AM
'cpan install IO' did the trick for me. It's now working again...


Well OK then... 12 hours later and it stopped working. From the logs, MailScanner processed the queue for about 90-odd minutes, and then went back to the former state. Grrr...

tps
November 10th, 2009, 03:56 PM
Well, it looks like only two of us. I'm going to try to purge MailScanner tonight, and then reinstall. Not the way I'm used to working with Debian-based systems...

All my production systems are pure Debian...

Tim

tps
November 11th, 2009, 05:01 AM
Success. The problem is with the init script. In /etc/init.d/mailscanner, I had to add -c ${user} to the start-stop-daemon line, since it had no idea what user to run as. It was strange that when called from the command line as (for me) sudo -u Debian-exim MailScanner, it would work.

So, the modified line in the init script should look something like:

start-stop-daemon --start --quiet --startas $STARTAS --name $NAME --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --nicelevel $run_nice -c ${user} --exec $DAEMON --name $NAME -- $DAEMON_ARGS \
|| return 2


Add the -c ${user}, restart mailscanner, and it'll be back working. At least this is working for me.

Tim

Shaker242
March 12th, 2010, 10:57 PM
Thank you for actually posting your fix! I made the slight modification to the init script as you outlined and fired up mailscanner.

MailScanner --lint still has this error:
Insecure dependency in chown while running with -T switch at /usr/share/MailScanner//MailScanner/Message.pm line 2407.

However, MailScanner is running is deliering mail again... so it'll due for now.

Shaker

bsgcic
April 30th, 2010, 03:42 AM
Hey Tim (tps),
You're the Man!!! Thank you Thank you Thank you!!!

Any thoughts on how to get the ubuntu mailscanner package manager to add that change to the default for future upgrades, etc?

NIT006.5
February 8th, 2011, 10:26 PM
Apparently this is still not fixed in 10.04. Thanks for the work-around - seems to be doing the trick.

ivomans
March 2nd, 2011, 04:06 PM
Same problem after upgrade from 8.04.
Tim's solution seems to solve this.

Regards, Ivo.

halfgaar
May 3rd, 2011, 11:08 PM
Same problem here, on Ubuntu 10.04. Reported bug (https://bugs.launchpad.net/ubuntu/+source/mailscanner/+bug/776753). Please post your relevant information in that bug report.

BTW; why would the initscript need the user, if the Mailscanner config already states the user it should run as?