Submitted by virtualminhab on Tue, 08/18/2015 - 15:10
Having a problem with Automatic Spam Clearing not working. It was working on this server, but stopped a few months ago.
I found this info from 2008 (https://www.virtualmin.com/node/8208) in the support forum, however I don't think the part about a cron job applies anymore, since I have another Virtualmin server where Spam Clearing is functioning and it has no cron job either.
As the forum post suggested, I tried running /etc/webmin/virtual-server/spamclear.pl from the Command Shell in Virtualmin and using Putty this is the message:
Error: Failed to open /home/pdqpdq/Maildir/.spam/cur : Permission denied
The permissions on the .spam/cur folder are 0700 - same as my functioning server.
Are there any logs or setting I should be checking?
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Tue, 08/18/2015 - 20:43 Comment #1
Are you fully updated to the latest version of Webmin (1.780)? Because it fixes exactly this issue..
Submitted by virtualminhab on Wed, 08/19/2015 - 05:27 Comment #2
In Software Package Updates this server shows:
webmin web-based administration interface for Unix systems Running latest 1.760 Virtualmin
Refreshing shows "No packages available to be updated were found." Virtualmin Package Updates doesn't show any updates. Maybe I should wait a couple of days and update when it displays.
Submitted by JamieCameron on Wed, 08/19/2015 - 22:10 Comment #3
What does the command
dpkg --list webmin
output on your system? That should tell you the Webmin version.Submitted by webwzrd on Tue, 08/25/2015 - 16:43 Pro Licensee Comment #4
I'm having this issue too. No 1.780 yet, still waiting for it to show up for Centos.
Submitted by virtualminhab on Wed, 08/26/2015 - 16:58 Comment #5
dpkg --list webmin shows
1.760
Software Package Updates shows "No packages available to be updated were found." but when I refresh it displays " found 3 possible updates".
aptitude shows three however non of them is for webmin
Submitted by JamieCameron on Thu, 08/27/2015 - 00:02 Comment #6
Ok - can you check if the directory
/home/pdqpdq/Maildir/.spam/cur
from the error message is actually owned by the expected userpdqpdq
?Submitted by webwzrd on Thu, 08/27/2015 - 11:46 Pro Licensee Comment #7
In my case, yes.
Error: Failed to open /home/domain/homes/mfrogner/Maildir/.spam/cur : Permission denied
drwx------ 2 mfrogner.domain domain 77824 Aug 24 19:00 cur
Submitted by virtualminhab on Thu, 08/27/2015 - 14:55 Comment #8
/home/pdqpdq/Maildir/.spam$ ls -l total 48
drwx------ 2 pdqpdq pdqpdq 8192 Jun 11 00:58 cur
-rw------- 1 pdqpdq pdqpdq 17408 Mar 2 2014 dovecot.index.cache
-rw------- 1 pdqpdq pdqpdq 3900 Jun 9 2014 dovecot.index.log
-rw------- 1 pdqpdq pdqpdq 150 Jun 9 2014 dovecot-uidlist
drwx------ 2 pdqpdq pdqpdq 8192 Aug 27 12:23 new
drwx------ 2 pdqpdq pdqpdq 4096 Aug 27 12:23 tmp
Submitted by JamieCameron on Thu, 08/27/2015 - 22:57 Comment #9
Can you verify that if you actually login as the
pdqpdq
user that you can list the/home/pdqpdq/Maildir/.spam/cur
directory?Submitted by virtualminhab on Mon, 08/31/2015 - 12:46 Comment #10
using the pdqpdq user:
$ cd /home/pdqpdq/Maildir/.spam/cur
$ ls -l
total 44
-rw------- 1 pdqpdq pdqpdq 34707 May 4 06:59 1430747949.11868_0.pdqpdq
-rw------- 1 pdqpdq pdqpdq 7673 Jun 10 01:49 1433926155.27108_0.pdqpdq
$
Submitted by JamieCameron on Mon, 08/31/2015 - 21:46 Comment #11
That's very odd - all those permissions look correct.
If you go to the Edit Users page in Virtualmin, click on this user, click the link to view his mail file, select the spam folder and delete a message, do you get the same error?
Submitted by virtualminhab on Tue, 09/01/2015 - 11:15 Comment #12
I was able to delete them using the pdqpdq user or root.
Submitted by JamieCameron on Tue, 09/01/2015 - 23:44 Comment #13
That is odd - the code in both cases should be the same.
Does the spam cleanup fail 100% of the time ... even if you first delete it manually?
Submitted by virtualminhab on Wed, 09/02/2015 - 14:43 Comment #14
Yes it's not working on new spam. I deleted all the spam for a few users on August 12 and now there are several each day afterward. I have the cleanup set at 3 days.
Submitted by webwzrd on Wed, 09/02/2015 - 17:05 Pro Licensee Comment #15
My answers have been pretty much the same as virtualminhab. However here is something interesting I've noticed.
I'll start with running this:
find /home//homes//Maildir/.spam/cur/ -type f -mtime +5 -exec rm {} \;
, The command appears to run with no error, although is finished instantly and has no effect on excess spam.Then I'll check a particular user who gets lots of spam by logging into their Usermin CP and see they still have way in excess of the 5 days of spam (only view spam folder, I leave everything there). Now if I go back and run that same command and then refresh the Usermin view for that same user the excess spam has been removed, but not for any other user.
I can repeat this for any user and get the same results. If I go back a week later there will be 7 days of spam instead of 5 and I can repeat the process with the same results. Meanwhile any user I don't do the routine with continues to accumulate spam unchecked.
So in short the command line to rm spam older than 5 days only works right after I view a given users spam folder in Usermin, however with no lasting effect. Hope this was clear.
Submitted by webwzrd on Tue, 10/06/2015 - 10:28 Pro Licensee Comment #16
Still struggling with this. Any work around available?
Error
Failed to open /home/domain/homes/mfrogner/Maildir/.spam/cur : Permission denied
Submitted by JamieCameron on Wed, 10/07/2015 - 01:25 Comment #17
If anyone who is seeing this could allow me to login to your system to debug what's going wrong internally, please send me an email at jcameron@virtualmin.com
Submitted by webwzrd on Mon, 10/19/2015 - 14:37 Pro Licensee Comment #18
Sorry I didn't reply sooner. It appears doing a yum reinstall spamassassin fixed the issue in my case.
Submitted by danblack on Fri, 10/30/2015 - 04:19 Comment #19
cd /usr/share/webmin/virtual-server ; WEBMIN_CONFIG=/etc/webmin strace -fe trace=process,file `pwd`/spamclear.pl
stat("/home/sweetadelines/homes/finance/Maildir/.spam/cur", {st_mode=S_IFDIR|0700, st_size=65536, ...}) = 0
stat("/home/sweetadelines/homes/finance/Maildir/.spam/new", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
stat("/etc/webmin/mailboxes/maildircache", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
stat("/etc/webmin/mailboxes/maildircache/_home_sweetadelines_homes_finance_Maildir_.spam", {st_mode=S_IFREG|0644, st_size=2500, ...}) = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 5
open("/etc/shadow", O_RDONLY|O_CLOEXEC) = 5
open("/etc/group", O_RDONLY|O_CLOEXEC) = 5
open("/home/sweetadelines/homes/finance/Maildir/.spam/cur", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
Error: Failed to open /home/sweetadelines/homes/finance/Maildir/.spam/cur : Permission denied
# namei -mo /home/sweetadelines/homes/finance/Maildir/.spam/cur
f: /home/sweetadelines/homes/finance/Maildir/.spam/cur
drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-x--- sweetadelines sweetadelines sweetadelines
drwxr-xr-x sweetadelines sweetadelines homes
drwx------ finance.sweetadelines sweetadelines finance
drwx------ finance.sweetadelines sweetadelines Maildir
drwx------ finance.sweetadelines sweetadelines .spam
drwx------ finance.sweetadelines sweetadelines cur
su - finance.sweetadelines
Cannot execute /dev/null: Permission denied
upgraded to webmin 1.1770 on squeeze and reran the script above. No errors. strace of it showed it unlink spam files.
Submitted by JamieCameron on Sat, 10/31/2015 - 19:11 Comment #20
Ok, it looks like Webmin 1.770 fixes this then. This version will be rolled out to all virtualmin uses soon.
Submitted by danblack on Sat, 10/31/2015 - 19:59 Comment #21
Thanks Jamie
Submitted by Issues on Sat, 11/14/2015 - 19:00 Comment #22
Automatically closed -- issue fixed for 2 weeks with no activity.