"universial" header to mark mail as spam?

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
BeeTee
New user
New user
Posts: 14
Joined: 2011-06-14 11:00

"universial" header to mark mail as spam?

Post by BeeTee » 2020-12-07 09:27

Today my anti-spam script just delete spam-mails and optional sent a message back to sender that it has been blocked, depending on spam-certainty-level.
But I want some of those spam-mails to get through to the user, but marked as spam by a header to have it end up in the junk folder in the email clients.
Most of my clients use Outlook of different versions.

Are there a "universal" header indicating the mail is spam that most clients would understand?

If not, what do Outlook (ver. 2010, 2013, 2016, 2019) use/look for?

User avatar
mattg
Moderator
Moderator
Posts: 21270
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: "universial" header to mark mail as spam?

Post by mattg » 2020-12-07 09:50

I find that

[SPAM]

pre-pended to the subject line works well
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
katip
Senior user
Senior user
Posts: 815
Joined: 2006-12-22 07:58
Location: Istanbul

Re: "universial" header to mark mail as spam?

Post by katip » 2020-12-07 09:52

BeeTee wrote:
2020-12-07 09:27
Are there a "universal" header indicating the mail is spam that most clients would understand?
No, Antispam software adds its custom headers. Spamassassin for instance adds X-Spam-Status: Yes (and various others depending on config)
I don't use Outlook but it should be able to filter messages based on any header.
HTH
Katip
--
HMS 5.7.0 x64, MariaDB 10.4.10 x64, SA 3.4.2, ClamAV 0.101.2 + SaneS

BeeTee
New user
New user
Posts: 14
Joined: 2011-06-14 11:00

Re: "universial" header to mark mail as spam?

Post by BeeTee » 2020-12-07 10:02

mattg wrote:
2020-12-07 09:50
I find that

[SPAM]

pre-pended to the subject line works well
Didn't work in Outlook 2010 (neither prefixed, trailed, in caps or small-caps).
But I might be the only one left using 2010 :lol:

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

Re: "universial" header to mark mail as spam?

Post by palinka » 2020-12-07 13:56

BeeTee wrote:
2020-12-07 09:27
If not, what do Outlook (ver. 2010, 2013, 2016, 2019) use/look for?
Its not the app, but the user that looks for spam. That's why prepending the subject works well.

You can also send possible spam to the spam folder. People understand today that the spam folder is where spam goes.

Did you check the spam folder? is as ubiquitous as You've Got Mail!

https://www.youtube.com/watch?v=DGOgSPVBmIE

BeeTee
New user
New user
Posts: 14
Joined: 2011-06-14 11:00

Re: "universial" header to mark mail as spam?

Post by BeeTee » 2020-12-07 14:02

That's exactly my question, in other words, how to sent it directly to the spam folder (which should be possible by setting the right header)

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

Re: "universial" header to mark mail as spam?

Post by palinka » 2020-12-07 14:07

BeeTee wrote:
2020-12-07 14:02
That's exactly my question, in other words, how to sent it directly to the spam folder (which should be possible by setting the right header)
That can be done by global rule in hmailserver.

Criteria (Use AND):
X-hMailServer-Spam equals "YES"
X-hMailServer-LoopCount Less Than 1
X-hMailServer-Reason-Score Less Than N (where N is the delete threshold)

Action:
Move to IMAP folder: Spam

BeeTee
New user
New user
Posts: 14
Joined: 2011-06-14 11:00

Re: "universial" header to mark mail as spam?

Post by BeeTee » 2020-12-07 14:19

If I was using imap I would just move the mail directly to the spam-folder and not ask this question, hence I'm not using imap.

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

Re: "universial" header to mark mail as spam?

Post by SorenR » 2020-12-07 14:20

BeeTee wrote:
2020-12-07 09:27
Today my anti-spam script just delete spam-mails and optional sent a message back to sender that it has been blocked, depending on spam-certainty-level.
But I want some of those spam-mails to get through to the user, but marked as spam by a header to have it end up in the junk folder in the email clients.
Most of my clients use Outlook of different versions.

Are there a "universal" header indicating the mail is spam that most clients would understand?

If not, what do Outlook (ver. 2010, 2013, 2016, 2019) use/look for?
I categorise SPAM in 1) Blacklisted by script or rule, 2) SPAM score above 6 and 3) Unclassified SPAM.

For ALL SPAM a copy is forwarded to a special SPAM account for review/control of DNSBL, SURBL, local script/rule and SpamAssassin rules.

#1 and #3 go into the the user SPAM/Junk-mail folder controlled by a common rule. Ideally NO SPAM is left in the INBOX!
It is the users responsibility to verify SPAM or HAM so part of the daily SpamAssassin training the user MUST move a falsly categorised HAM mail to their INBOX before midnight no later than 5 days after receipt. The same apply to falsly categorised SPAM must be moved from INBOX to SPAM folder.

When I skim through email subjects in the SPAM account it is (after a while) obvious to see what is SPAM and what is HAM and in such cases I can create a whitelist entry if caught by a blacklist rule or move the email to a "FALSE-POSITIVE" HAM folder.

At NO point in the process am I logged in as the user OR accessing the user emails via file services. I CAN however read their SPAM - how much fun is that :roll: - most often I just investigate the RAW message, headers et al.

I don't mark "*SPAM*" in the subject line as it is my findings that IF a HAM mail end up in the SPAM folder and it require a reply people just click "reply" and never remove the "*SPAM*" from the subject line.
The person that initially send the email may then wonder WHY they got SPAMlisted :mrgreen:
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

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

Re: "universial" header to mark mail as spam?

Post by palinka » 2020-12-07 17:16

BeeTee wrote:
2020-12-07 14:19
If I was using imap I would just move the mail directly to the spam-folder and not ask this question, hence I'm not using imap.
If all you want is a spam header, hmailserver already provides that as X-hMailServer-Spam.

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

Re: "universial" header to mark mail as spam?

Post by palinka » 2020-12-07 17:24

SorenR wrote:
2020-12-07 14:20
I don't mark "*SPAM*" in the subject line as it is my findings that IF a HAM mail end up in the SPAM folder and it require a reply people just click "reply" and never remove the "*SPAM*" from the subject line.
The person that initially send the email may then wonder WHY they got SPAMlisted :mrgreen:
I've been sending spam with subject prefix [POSSIBLE SPAM] to the inbox. You make a compelling argument against it. But my users do not, nor have they ever looked in the spam folder (because, duh... no mail ever goes there automatically), so this may require users being sent to re-education camps, er... I mean.. teaching users to look in the spam folder for missed messages. :wink:

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

Re: "universial" header to mark mail as spam?

Post by SorenR » 2020-12-07 17:40

palinka wrote:
2020-12-07 17:24
SorenR wrote:
2020-12-07 14:20
I don't mark "*SPAM*" in the subject line as it is my findings that IF a HAM mail end up in the SPAM folder and it require a reply people just click "reply" and never remove the "*SPAM*" from the subject line.
The person that initially send the email may then wonder WHY they got SPAMlisted :mrgreen:
I've been sending spam with subject prefix [POSSIBLE SPAM] to the inbox. You make a compelling argument against it. But my users do not, nor have they ever looked in the spam folder (because, duh... no mail ever goes there automatically), so this may require users being sent to re-education camps, er... I mean.. teaching users to look in the spam folder for missed messages. :wink:
Change [POSSIBLE SPAM] to [F'ING PSYCO SPAM CRAP] (pronounced with a broad Scottish accent) and the contacts of your users will educate them :mrgreen:

https://www.youtube.com/watch?v=CYvFxs32zvQ
SørenR.

Algorithm (noun.)
Word used by programmers when they do not want to explain what they did.

Post Reply