spamtrap cron jobs

Hi,

I am running the last virtualmin.

I've enabled "Create spamtrap and hamtrap aliases?" but i realize that emails send to these addresses are not processed.

After a short research I found out that spamtrap cron jobs was not added.

I have these cron jobs on other servers and everything is fine:

53 0 * * * /etc/webmin/virtual-server/spamclear.pl 49 * * * * /etc/webmin/virtual-server/spamtrap.pl 19 * * * * /etc/webmin/virtual-server/spamconfig.pl

What I should to for these to be enabled and not needed to add them manually?

Thank you.

Status: 
Active

Comments

As of Virtualmin 3.99, those old-style cron jobs no longer exist - instead the functionality has been moved into the Webmin server process.

If you go to Webmin -> Webmin -> Webmin Configuration -> Scheduled Functions, you should see jobs that run spamclear.pl and spamtrap.pl

Hi Jamie,

The files from /var/virtualmin-traps/spam was not processed:

-rw-rw-rw- 1 root root 23K May 12 01:25 13360830084902

date

Sun May 12 11:03:17 CEST 2013

Something is not working. How I can check why the cron jobs are not running?

I've pressed on Run Selected Functions Now for spamtrap.pl and nothing was happen.

When I've run manually with: perl /etc/webmin/virtual-server/spamtrap.pl everything was fine.

So I guess, that, just the cron job is not run this. Is there a way or a log where I can see why cron jobs from webmin are not running/

Thank you.

So are you saying that if you run /etc/webmin/virtual-server/spamtrap.pl manually from the command line, spam does get processed OK?

Hi Jamie,

Yes. exactly. If I run it manually everything is processed.

But the scheduled jobs are not working. I've upgraded today another servers and now are the latest CentOS software and webmin/virtualmin. I saw the these cron jobs was moved to webmin scheduled functions and again, from over 10 hours, virtualmin traps are not processed.

So its clear that these Scheduled Functions are not working.

Ok, try this :

  1. SSH into your system as root, and cd to /etc/webmin/webmincron/crons
  2. Run the follow command to enable debug output : echo "arg1=--debug" >> `grep -l spamtrap *.cron`
  3. On the Webmin Scheduled Functions page, run the spamtrap.pl command and post the output here.

Hi Jamie,

I've did what you told me and here is the output fom Scheduled Functions:

Running function run_cron_script in Virtualmin Virtual Servers (GPL) ..
srv0.domain.com: processing spam file .. done

Here is the output when I am running manually the script:

# /etc/webmin/virtual-server/spamtrap.pl --debug
srv0.domain.com: processing spam file
srv0.domain.com: 0 messages in /var/virtualmin-traps/spam/133608228332714
srv0.domain.com: processing ham file
srv0.domain.com: 0 messages in /var/virtualmin-traps/ham/133608228332714
whmcs.domain.com: processing spam file
whmcs.domain.com: 0 messages in /var/virtualmin-traps/spam/13360832257904
whmcs.domain.com: processing ham file
whmcs.domain.com: 0 messages in /var/virtualmin-traps/ham/13360832257904
emails.domain.com: processing spam file
emails.domain.com: 0 messages in /var/virtualmin-traps/spam/135750281129330
emails.domain.com: processing ham file
emails.domain.com: 0 messages in /var/virtualmin-traps/ham/135750281129330
projects.domain.com: spam filtering is not enabled
beta.domain.com: processing spam file
beta.domain.com: 0 messages in /var/virtualmin-traps/spam/13360830755741
beta.domain.com: processing ham file
beta.domain.com: 0 messages in /var/virtualmin-traps/ham/13360830755741
domain.com: processing spam file
domain.com: 1 messages in /var/virtualmin-traps/spam/13360830084902
domain.com: processing ham file
domain.com: 0 messages in /var/virtualmin-traps/ham/13360830084902
domain.com: id=<20130513034351.Horde.oP2_utktI__A3P6phW4vBA1@mail.domain.com>
domain.com: user=email@domain.com what=from
domain.com: email@domain.com: Invalid received by srv0.domain.com (Postfix, from userid 48) id E1F8C32B; Mon, 13 May 2013 03:43:51 +0200 (CEST)
monitoring.domain.com: processing spam file
monitoring.domain.com: 0 messages in /var/virtualmin-traps/spam/13360831707175
monitoring.domain.com: processing ham file
monitoring.domain.com: 0 messages in /var/virtualmin-traps/ham/13360831707175
smts.domain.com: processing spam file
smts.domain.com: 0 messages in /var/virtualmin-traps/spam/13360831316505
smts.domain.com: processing ham file
smts.domain.com: 0 messages in /var/virtualmin-traps/ham/13360831316505

It seams that, from Scheduled, the script cannot detect all domains. Only the first one. However the content of file was not processed:

-rw-rw-rw- 1 root root 7.4K May 13 04:30 133608228332714

Regards.

It actually looks like the script is crashing when processing the first domain.

Does anything get logged to /var/webmin/miniserv.error when you run spamtrap.pl via Scheduled Functions , or when it runs on schedule?

There is nothing on miniserv.error or any system logs.

If there any chance I could login to your Virtualmin system to see what is going wrong here?

If so, email me directly at jcameron@virtualmin.com

I got the same error. the script does not run automatically

when rotating manually: script processed mx1.mxdomain.com.br.

# /etc/webmin/virtual-server/spamtrap.pl --debug domain.com.br: processing spam file
domain.com.br: 5 messages in /var/virtualmin-traps/spam/134446039819927
domain.com.br: processing ham file
domain.com.br: 0 messages in /var/virtualmin-traps/ham/134446039819927
domain.com.br: id=<be2bba26d22ea33c62062313203fde8c@domain.com.br>
domain.com.br: user=contato@domain.com.br what=from
domain.com.br: contato@domain.com.br: Invalid received by mx1.mxdomain.com.br (Mx1, from userid 33) id 8ED0C1914175; Sat, 11 May 2013 12:49:29 -0300 (BRT)
domain.com.br: id=<d79f932664db288ff978562577a6e2c3@domain.com.br>
domain.com.br: user=contato@domain.com.br what=from
domain.com.br: contato@domain.com.br: Invalid received by mx1.mxdomain.com.br (Mx1, from userid 33) id 108261914082; Sat, 11 May 2013 12:55:18 -0300 (BRT)

I use mx external.

DNS:

domain.com.br MX 5  mx1.mxdomain.com.br
domain.com.br MX 10  mx1b.mxdomain.com.br
domain.com.br MX 15  mx1c.mxdomain.com.br
webmail.domain.com.br CNAME  mx1.mxdomain.com.br

message forwarding was done by webmail.

Look, wait. This seems to only work with attachment forwarding. "Eml" and a pop or imap account.

Webmail does not seem to work. Is that right?

really is not working automatically. I waited 2 hours and nothing.

manual processing works!

/etc/webmin/virtual-server/spamtrap.pl domain.com.br: contato@domain.com.br: Auth received from [10.0.2.15] (222-222-222-222.user.veloxzone.com.br [187.126.253.27]) (Authenticated sender: contato@domain.com.br) by mx1.mxdomain.com.br (Mx1) with ESMTPSA id B8FAA191407D for <spamtrap@domain.com.br>; Mon, 13 May 2013 20:31:18 -0300 (BRT)
domain.com.br: contato@domain.com.br: subject=Lembrete de fatura
domain.com.br: contato@domain.com.br: OK netset: illegal network address given: 'mx1b.mxdomain.com.br' Learned tokens from 1 message(s) (1 message(s) examined)
domain.com.br: Adding email@live.com to blacklist_from

There is some problem in creating a cron to run this script

"/etc/webmin/virtual-server/spamtrap.pl"

Spam processing only works if the entire message is forwarded as an attachment - otherwise the original headers are lost.

Hi Jamie,

I cannot give you access on any product server. I can set a test server in the next days only.

But, I can bet that this will be the same on any of your test servers.

This was happen only after the last upgrade. Everything was fine before. And if spamtrap.pl script is added on crontab as usual, everything is fine.

Regards.

A test server that shows this issue would be great - unfortunately none of our systems are showing the problem.

Hi Jamie,

I am running :-

CentOS Linux 5.9
Webmin version 1.630
Virtualmin version 4.01 Pro

And I have remarkably similar symptoms.

I can give you access and have emailed you off forum.

(my chance to give something back) :o)

Tim

Ok, I found the cause of Tim's problem here - it was due to some old DBM format cache files that Virtualmin couldn't read properly. The quick fix was to delete these with :

rm -f /etc/webmin/mailboxes/*trap*{dir,pag}

I will include a proper fix in the next Virtualmin release.