spamassassin learning from spam folder

Hi,

I want to optimize spamassassin and know that this is possible to run a sa-learn command with the option --spam through the spam folder. I know that spam mails are put there from spamassassin, but spamassassin does not recognize the spam mails which the user - which uses IMAP - has moved there. Also the other way round this command with the --ham option should be used in the inbox, if the user moved some good mails from the spam folder to the inbox.

Any suggestions how I can do this with a script for all users on my server?

Best reagards, Christian

Status: 
Active

Comments

Howdy -- there isn't an existing script to do that, though it should be possible using the Virtualmin command line tools.

This command here will generate a list of all users on the server, and provide some additional information about each one, such as the home directory:

virtualmin list-users --email-only --all-domains --multiline

From there, you'd just need to parse that output, and use it alongside a tool like sa-learn.

Thanks for the suggestion. 1. it is still not easy to manage this for me because I am not a script programmer 2. the suggested command maybe wrong, because I got a long list with all details like shown below: ipv6 Domain: gerwig.at Unix username: ipv6@gerwig.at Real name: Encrypted password: dfasdf Disabled: No Home directory: /home/gerwig/homes/ipv6 FTP access: No Login permissions: Email only Shell: /dev/null User type: Normal user Home quota: 100 MB Home quota used: 144 kB Home byte quota: 104857600 Home byte quota used: 147456 Mail location: /home/gerwig/homes/ipv6/Maildir Mail storage type: Maildir Email address: ipv6@gerwig.at Check spam and viruses: Yes

Yeah unfortunately, what you're asking for isn't a feature Virtualmin supports.

With the Virtualmin command line tools, someone savvy with scripting could do it, but it'd still be a bit of a project.

The command I shared provides a bunch of data -- someone taking on this particular task would need to parse through all the data, and grab the portions they need (such as the username and home directory location).

We unfortunately aren't able to code that ourselves, but there may be folks on the Forums who would offer to build such a script.

One command you might find useful is virtualmin list-mailbox --domain whatever.com --user bob --folder Span , which will dump all his spam as output.