Learn Spam from user spam folder

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
bagu
Senior user
Senior user
Posts: 264
Joined: 2005-06-17 03:08
Location: France
Contact:

Learn Spam from user spam folder

Post by bagu » 2023-09-18 15:01

Hello,
I'm looking for a way to make Spamassassin learn all mails considered as SPAM from each user's SPAM folder.
I've seen this topic viewtopic.php?f=20&t=26866&start=240
but in it, they're looking to learn both HAM and SPAM, yet I only want to learn SPAM that's more than seven days old.
Could you help me to do this?

My goal is to be able to transparently use Snappymail's "Mark as Unwanted" function to train spamassassin.
hMailServer 5.6.8 With SpamAssassin 3.4.4

palinka
Senior user
Senior user
Posts: 4230
Joined: 2017-09-12 17:57

Re: Learn Spam from user spam folder

Post by palinka » 2023-09-18 18:07

What is one without the other? How can you compare one to another if the other doesn't exist.

Spam and ham = yin and yang.

Image

Your best bet is to take one of the scripts in that forum thread and put it to work nightly.

User avatar
bagu
Senior user
Senior user
Posts: 264
Joined: 2005-06-17 03:08
Location: France
Contact:

Re: Learn Spam from user spam folder

Post by bagu » 2023-09-18 18:13

that's my business :wink:

I prefer an automated spam learning and a manual ham learning.
That's why i ask this to an other topic :mrgreen:
hMailServer 5.6.8 With SpamAssassin 3.4.4

palinka
Senior user
Senior user
Posts: 4230
Joined: 2017-09-12 17:57

Re: Learn Spam from user spam folder

Post by palinka » 2023-09-18 18:17

bagu wrote:
2023-09-18 18:13
that's my business :wink:

I prefer an automated spam learning and a manual ham learning.
That's why i ask this to an other topic :mrgreen:
I don't think that exists - at least not with spamassassin. There is automated DETECTING, but not automated learning. Spamassassin learns by feeding it spam and ham, and you need at least 200 of each before bayes filtering becomes active. I don't know how any other spam detection software works.

User avatar
bagu
Senior user
Senior user
Posts: 264
Joined: 2005-06-17 03:08
Location: France
Contact:

Re: Learn Spam from user spam folder

Post by bagu » 2023-09-18 18:25

I think we misunderstood each other.
I'd like a script, like the one proposed by SorenR, that would copy mails older than 7 days from hmailserver users' spam folders and put them in SA-Learn's SPAM learning folder.
Because I already have a script that scans what I put in HAM and SPAM from spamassassin, but I'm looking for a way for mails left for more than X days in spam folders to be automatically taken into account as spam.
As a result, I manage to provide it with carefully sorted legitimate e-mails, but anything I leave in spam will be effortlessly learn as a spam.
hMailServer 5.6.8 With SpamAssassin 3.4.4

User avatar
SorenR
Senior user
Senior user
Posts: 6007
Joined: 2006-08-21 15:38
Location: Denmark

Re: Learn Spam from user spam folder

Post by SorenR » 2023-09-18 18:28

bagu wrote:
2023-09-18 18:13
that's my business :wink:

I prefer an automated spam learning and a manual ham learning.
That's why i ask this to an other topic :mrgreen:
Well... I have an automated, manual, SPAM and HAM handling on my server. If the user is not content with what the automated system did, he or she (or the other 112 pronouns) can override the system by manually moving the message.

One thing you need to know is that hMailServer DO NOT support individual SPAM profiles - I tried playing with the code and there is a massive lack of support to do it! Partly from hMailServer and partly from the Windows version of SpamAssassin!
So if one user moves a message to SPAM and an other user moves a similar message to HAM ... Well, just hope they are good friends :mrgreen:
SørenR.

To understand recursion, you must first understand recursion.

palinka
Senior user
Senior user
Posts: 4230
Joined: 2017-09-12 17:57

Re: Learn Spam from user spam folder

Post by palinka » 2023-09-18 18:31

bagu wrote:
2023-09-18 18:25
I think we misunderstood each other.
I'd like a script, like the one proposed by SorenR, that would copy mails older than 7 days from hmailserver users' spam folders and put them in SA-Learn's SPAM learning folder.
Because I already have a script that scans what I put in HAM and SPAM from spamassassin, but I'm looking for a way for mails left for more than X days in spam folders to be automatically taken into account as spam.
As a result, I manage to provide it with carefully sorted legitimate e-mails, but anything I leave in spam will be effortlessly learn as a spam.
OK, but if the message is already in the spam folder and you have a script that scans the spam folder for spamassassin, then you don't need to do anything. In fact, rescanning messages in spamassassin will return an error "message already un/learned". Rescanning will not make a message "more spammy" or give it any more weight than the first scan.

User avatar
bagu
Senior user
Senior user
Posts: 264
Joined: 2005-06-17 03:08
Location: France
Contact:

Re: Learn Spam from user spam folder

Post by bagu » 2023-09-18 18:45

SorenR wrote:
2023-09-18 18:28
bagu wrote:
2023-09-18 18:13
that's my business :wink:

I prefer an automated spam learning and a manual ham learning.
That's why i ask this to an other topic :mrgreen:
Well... I have an automated, manual, SPAM and HAM handling on my server. If the user is not content with what the automated system did, he or she (or the other 112 pronouns) can override the system by manually moving the message.

One thing you need to know is that hMailServer DO NOT support individual SPAM profiles - I tried playing with the code and there is a massive lack of support to do it! Partly from hMailServer and partly from the Windows version of SpamAssassin!
So if one user moves a message to SPAM and an other user moves a similar message to HAM ... Well, just hope they are good friends :mrgreen:
Ok, it answer my question.
I thought it was possible to search directly in users' default "Junk" folders.
Since this isn't the case, and my users don't have the same taste in SPAM, I'd better continue with the manual method ;)
hMailServer 5.6.8 With SpamAssassin 3.4.4

User avatar
SorenR
Senior user
Senior user
Posts: 6007
Joined: 2006-08-21 15:38
Location: Denmark

Re: Learn Spam from user spam folder

Post by SorenR » 2023-09-19 01:12

bagu wrote:
2023-09-18 18:45
SorenR wrote:
2023-09-18 18:28
bagu wrote:
2023-09-18 18:13
that's my business :wink:

I prefer an automated spam learning and a manual ham learning.
That's why i ask this to an other topic :mrgreen:
Well... I have an automated, manual, SPAM and HAM handling on my server. If the user is not content with what the automated system did, he or she (or the other 112 pronouns) can override the system by manually moving the message.

One thing you need to know is that hMailServer DO NOT support individual SPAM profiles - I tried playing with the code and there is a massive lack of support to do it! Partly from hMailServer and partly from the Windows version of SpamAssassin!
So if one user moves a message to SPAM and an other user moves a similar message to HAM ... Well, just hope they are good friends :mrgreen:
Ok, it answer my question.
I thought it was possible to search directly in users' default "Junk" folders.
Since this isn't the case, and my users don't have the same taste in SPAM, I'd better continue with the manual method ;)
Whatever you choose man, I've been running this for a long time and once the users are trained in how to move a message in whatever client they are using ... Once they are trained, I don't have to lift a finger! I am seriously NOT worrying about SPAM anymore. I skim through the messages in my SPAM Account (copies of all SPAM coming in) in case I need to put an email on a black- or whitelist, but that's IT. Sometimes I don't look for a week :mrgreen:
SørenR.

To understand recursion, you must first understand recursion.

Post Reply