Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by breun »

I don't know if these steps also fix the problem if you don't install qmail-scanner again.
Lemonbit Internet Dedicated Server Management
AntiochInteractive
Forum User
Forum User
Posts: 35
Joined: Thu Jan 08, 2009 4:31 am
Location: Fort Worth, TX
Contact:

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by AntiochInteractive »

Fixed.

rpm /root/parallels/PSA_10.4.4/dist-rpm-CentOS-5-x86_64/base/* -Uvh --force

Reinstalling the PLESK Base Files to fix qmail is a bit ridiculous. I'm going to guess that there are some users, groups and permissions that get setup and reset here.

qmail-scanner may have broken them when it was installed -- I really don't know. If this were a non-production server, I'd love to retrace my steps and identify where things went wrong.

I've used the method of swapping to postfix and back to qmail before -- and its a bit obnoxious too as you've noted.

--

I am, for the time being, not going to use qmail-scanner-queue despite its advantages when it is working.
Kalimari
Forum Regular
Forum Regular
Posts: 526
Joined: Wed Jan 02, 2008 3:21 pm
Location: United Kingdom

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by Kalimari »

This specific problems seem to be resolved now (on a fresh install at least). Have Plesk 10.4.4 server running qmail-scanner+spamassassin+clamav, only issue I noticed is that when installing spamdyke into the smtp chain, it scans the delivery connection IP after qmail-scanner and spamassassin:

Telnet test message > qmail-scanner/spamassassin > spamdyke:

/var/qmail/bin/relaylock: /var/qmail/bin/relaylock: mail from MY.IP.ADDRESS
Feb 5 16:57:28 HOSTNAME spamd[1033]: spamd: connection from HOSTNAME [127.0.0.1] at port 37921
Feb 5 16:57:28 HOSTNAME spamd[1033]: spamd: setuid to qscand succeeded
Feb 5 16:57:28 HOSTNAME spamd[1033]: spamd: checking message (unknown) for qscand:10001
Feb 5 16:57:28 HOSTNAME dccproc[23324]: missing message body; fatal error
Feb 5 16:57:28 HOSTNAME spamd[1033]: spamd: identified spam (11.1/4.0) for qscand:10001 in 0.3 seconds, 158 bytes.
Feb 5 16:57:28 HOSTNAME spamd[1033]: spamd: result: Y 11 - BAYES_20,EMPTY_MESSAGE,FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,MISSING_DATE,MISSING_FROM,MISSING_HEADERS,MISSING_MID,MISSING_SUBJECT,RDNS_NONE,TO_NO_BRKTS_DIRECT scantime=0.3,size=158,user=qscand,uid=10001,required_score=4.0,rhost=
HOSTNAME,raddr=127.0.0.1,rport=37921,mid=(unknown),bayes=0.189068,autolearn=no
Feb 5 16:57:28 HOSTNAME qmail-scanner-queue.pl: qmail-scanner[23315]: SA:SPAM-DELETED:RC:0(MY.IP.ADDRESS):SA:1(11.1/4.0): 0.309819 130 me@home me@domain <> <> HOSTNAME 132846104179823315-unpacked:130
Feb 5 16:57:28 HOSTNAME spamdyke[23311]: ALLOWED from: me@home to: me@domain origin_ip: MY.IP.ADDRESS origin_rdns: (unknown) auth: (unknown) encryption: (none) reason: 250_ok_1328461048_qp_23315

This might be due to spamdyke being installed from rpm as opposed to yum (as no spamdyke in CentOS 6 repo).

Any one else running Plesk 10.4.4 + qmail-scanner/spamassassin + spamdyke have this?
Kalimari
Forum Regular
Forum Regular
Posts: 526
Joined: Wed Jan 02, 2008 3:21 pm
Location: United Kingdom

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by Kalimari »

breun wrote:If anyone knows of an easier way to get qmail-scanner back to life I'd love to hear it.
Not exactly "easier" but certainly faster, to switch just Plesk mail agent, try:

Code: Select all

/usr/local/psa/admin/sbin/autoinstaller --select-release-current --install-component postfix
/usr/local/psa/admin/sbin/autoinstaller --select-release-current --install-component qmail
Avoids any fat-finger mistakes or potentially pulling in other updates when running autoinstaller in full
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by exi1ed0ne »

OK, after reading the ZMOG UPDATE NOW! email from the fine folks at plesk last night I updated my server. Apparently I also took out my brain in the process having run plesk for years, and gotten burned each time I do this.

This morning after I upgraded I logged into my email, and I find lots and lots of spam. I think to myself, huh. After some poking, I find that DrWeb has some how found it's way on to my box rather than my trusty qmail-scanner. I think to myself, huh again. Ripped it out and refreshed the package, and the server goes into suicide mode. I won't repeat what I thought at that point. Kids might find this post.

After following the instructions from breun (I owe you more beer than you can imagine for your very informative posts over the years!), I was able to bring it back from the dead. On the last step where you install qmail-scanner the server goes into another death spiral. Did it a couple times just because I seem to hate myself, and always the same. Qmail-scanner busticates something in the mail chain. Hey, at least email is flowing right? The spice must flow, even if it has 50% more impurities.

I'm posting this in the hopes that someone has some clue as to why this is going on. My server isn't exactly robust, so it goes into the death spiral almost right away. I'd be happy to give up logs, etc.
-Andy
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by Highland »

It's been a while since I dealt with Plesk and qmail but...

1. Make sure that psa-postfix didn't replace psa-qmail by mistake (one will show up as an upgrade to the other)
2. Completely remove qmail scanner and reinstall. Remember to run qmail-scanner-reconfigure
"Its not a mac. I run linux... I'm actually cool." - scott
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by exi1ed0ne »

1) qmail is what is running. Did the swaparoo like Bruen suggested above a few times, but left it on qmail at the end.

2) I've been running qmail-scanner for years, so I know the drill. However, side effects now include dizziness, loss of appetite, vacationing with the in-laws, and spiraling-run-away-process-swerlies of death.
-Andy
ghazlewood
Forum User
Forum User
Posts: 40
Joined: Thu Feb 26, 2009 6:50 pm

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by ghazlewood »

Just been bitten by this bug but it wasn't after an upgrade or anything. This machine was installed with 10.4.

The machine is running ASL, spamdyke and spamassassin.

One of the users reported a higher amount of spam than normal getting through.

I thought qmail-scanner was running but looking at one of the log files it had stopped working at around 4am. No obvious errors I could find in any of the usual places.

I ran

Code: Select all

yum reinstall qmail-scanner 
qmail-scanner-reconfigure
And all hell broke loose and thousands of perl processes locked the machine so hard it had to be rebooted by force in the DC.

Any ideas to get to the bottom of this problem, is it a Plesk bug?
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by exi1ed0ne »

I'd follow Breun's suggestions to see if that fixes it for you. My install is still broken, and I've not figured out how to unfuggle it. It is only my personal playground, but it is still angrymaking. The Plesk folks messed up good this time, and I've honestly spent more time figuring out what I want to do about finally moving away from that platform. It is way too buggy and convoluted for my purposes.
-Andy
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by breun »

The qmail-scanner package 'breaks' into the psa-qmail package by replacing /var/qmail/bin/qmail-queue. I'd argue that this is not a very clean way to integrate with Plesk. I'm not too familiar with Plesk's mail handler architecture, but I guess this should be used instead?

The qmail-scanner package has some triggers to fix the qmail-scanner integration when psa-qmail gets updated, but this doesn't work when Plesk updates psa-qmail files via a micro update, since micro updates are sadly not distributed as RPM packages.

So both Plesk and qmail-scanner aren't playing completely nice here.

'yum uninstall qmail-scanner' not working correctly is also a problem of course.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by faris »

Logically speaking, forcing the reinstallation of qmail-scanner should resolve the problem.

Alternatively, get a copy of qmail-queue from a working machine and copy it in. Again, logically, this should solve the problem.

Whether it does or not I can't say. But I'm going to make a backup copy for emergencies just in case, both before the original install of qmail-scanner and afterwards.

Faris.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by breun »

The qmail-scanner RPM scripts also create backups of modified files. See the output of rpm -q --scripts qmail-scanner and rpm -q --triggers qmail-scanner to see the magic.
Lemonbit Internet Dedicated Server Management
ghazlewood
Forum User
Forum User
Posts: 40
Joined: Thu Feb 26, 2009 6:50 pm

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by ghazlewood »

Right so yes it looks like an automatically installed MU triggered this whole mess. I did manage to fix it with the excellent advice on this thread. Specifically making the component switch to postfix and then back to qmail. Reinstalling qmail-scanner this morning has resolved the problem (aside from clamd having the wrong user set in clamd.conf which stopped users sending via port 587 - they were getting a qq temporary errors).

Why on earth I thought automatically installing micro updates from Plesk was a good idea when I never would have considered it on the 9.x series :)

Thanks for the help and explanations all...
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by breun »

I do recommend installing micro updates, since they contain bug fixes and security fixes. It's just a bad idea to not distribute them as RPM packages, which can lead to issues with third party tools that rely on the RPM mechanism. I've asked Parallels to change this, but I guess it takes more users to make this clear to them, by all means talk to them about this issue.

Also, running asl -s -f should fix the clamd user issue.
Lemonbit Internet Dedicated Server Management
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: Upgrade Plesk 9.5.4 to 10.4.4 breaks qmail-scanner

Unread post by faris »

OK. Lets look into this then...

On a system with qmail-scanner installed:

Code: Select all

-r-xr-sr-x  1 mhandlers-user popuser   6375 Mar 21 18:04 qmail-queue
-r-s--x--x  1 qmailq         qmail    19256 Nov  1 08:34 qmail-queue.moved
-rwsr-xr-x  1 qmailq         qmail    49080 Nov  2 12:49 qmail-queue.orig
-r-x--s--x  1 mhandlers-user popuser  46240 Nov  2 12:49 qmail-remote
-r-xr-xr-x  1 root           qmail    48576 Nov  1 08:34 qmail-remote.moved
-r-xr-xr-x  1 root           qmail    16152 Nov  1 08:34 qmail-rspawn
-rwsr-xr-x  1 qscand         qscand  154796 Mar 30 21:02 qmail-scanner-queue.pl
On a system with 4PSA's SpamGuardian/CleanServer (which does not break on microupdates as far as I'm aware):

Code: Select all

-r-x--s--x  1 mhandlers-user popuser 49080 Nov  2 12:49 qmail-queue
-r-s--x--x  1 qmailq         qmail   19256 Nov  1 08:34 qmail-queue.moved
-r-x--s--x  1 mhandlers-user popuser 46240 Nov  2 12:49 qmail-remote
-r-xr-xr-x  1 root           qmail   48576 Nov  1 08:34 qmail-remote.moved
-r-xr-xr-x  1 root           qmail   16152 Nov  1 08:34 qmail-rspawn

from /var/qmail/bin/qmail-scanner-queue.pl

Code: Select all

# This file was auto-generated by:
#
# ./configure --qs-user qscand --qmail-queue-binary /var/qmail/bin/qmail-queue.orig --admin root --domain redacted.hostname.tld --admin-description "System Anti-Virus Administrator" [etc etc]
#
<SNIP>
## Required Packages
##
## Qmail-1.03
## Perl 5.005_03+
## Maildrop-0.73
## Bruce Guenter's QMAILQUEUE patch <URL:http://www.qmail.org/qmailqueue-patch>
From http://www.qmail.org/qmailqueue-patch

Code: Select all

Greetings.

Appended is a patch to qmail-1.03 that causes any program that would run
qmail-queue to look for an environment variable QMAILQUEUE.  If it is
present, it is used in place of the string "bin/qmail-queue" when
running qmail-queue.  This could be used, for example, to add a program
into the qmail-smtpd->qmail-queue pipeline that could do filtering,
rewrite broken headers, etc. (this is my planned usage for it).
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply