spamtrap id issue

Spamassassin doesn't appear to be learning from spamtrap. When I forward emails to spamtrap I can see them appended to /var/virtualmin-traps/spam/142267202818074
When I manually run
[root@nicbaxter crons]# /etc/webmin/virtual-server/spamtrap.pl --debug
xxxx.com.au: missing spamtrap aliases
yyyy.com.au: missing spamtrap aliases
zzz.com.au: processing spam file
Error: Failed to open /var/virtualmin-traps/spam/118291235110245 : No such file or directory
Error
-----
Failed to open /var/virtualmin-traps/spam/118291235110245 : No such file or directory

There appears to be a mismash between the IDs. Where do the IDs come from?

How does the redirection from spamtrap@xxx.com.au actually get to /var/virtualmin-traps/spam?

Cheers
Nic

Status: 
Closed (fixed)

Comments

Those numbers are unique domain IDs - you can get the ID for a domain by running virtualmin list-domains --domain whatever.com --id-only

For the error like xxxx.com.au: missing spamtrap aliases , does the domain xxxx.com.au have an entry in /etc/aliasesthat delivers to a file under/var/virtualmin-traps` ?

I think I have worked it out. Only 2 domains had spam/ham trap activated and those domains are listed in /etc/aliases. Domain 1 was listed followed by domain 2. However only the ID for domain 2 was shown in /var/virtualmin-trap/spam. Which meant when the script ran it stopped when it could find the ID in spam. So I logged in to domain 1 and forwarded a spamtrap email. Both IDs are now in /var/virtualmin-traps/spam and the script works. If I may suggest rather than stopping when the ID wasn't found, shouldn't the script continue to the other entries? Either that or when the spam/ham aliases are set up the system should create a blank ID file.

Cheers Nic

Thanks for sharing your findings! I unfortunately don't know the answer to how that should work, but Jamie will be getting back with you shortly regarding that.

Yes, it shouldn't crash out in this case. I'll fix this in the next VIrtualmin release.

Status: Active ยป Fixed

Thanks Jamie