How To Tag External Email??

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
cbritton1978
New user
New user
Posts: 2
Joined: 2019-06-05 19:39

How To Tag External Email??

Post by cbritton1978 » 2019-06-05 20:08

I am not familiar with scripting portion of hMailServer. Is it possible to add the word "External" at the beginning of a message for all outside email? I have employees ask me sometimes if a message is legit because the name in the from field is an actual employee, but when you look at the email address it will be from outside the domain.

User avatar
jimimaseye
Moderator
Moderator
Posts: 8156
Joined: 2011-09-08 17:48

Re: How To Tag External Email??

Post by jimimaseye » 2019-06-06 09:11

Assuming all of your accounts/users connect using authentication (which they should!):

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if oClient.username <> "" then 
      oMessage.subject = "[EXTERNAL] " & oMessage.subject
      oMessage.save
   End if
End Sub
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

cbritton1978
New user
New user
Posts: 2
Joined: 2019-06-05 19:39

Re: How To Tag External Email??

Post by cbritton1978 » 2019-06-06 16:16

jimimaseye wrote:
2019-06-06 09:11
Assuming all of your accounts/users connect using authentication (which they should!):

Code: Select all

Sub OnAcceptMessage(oClient, oMessage)
   if oClient.username <> "" then 
      oMessage.subject = "[EXTERNAL] " & oMessage.subject
      oMessage.save
   End if
End Sub

Thanks for the reply! So if I tag it in the subject won't the subject keep growing with [External] tags when there are replies to a message?

User avatar
jimimaseye
Moderator
Moderator
Posts: 8156
Joined: 2011-09-08 17:48

Re: How To Tag External Email??

Post by jimimaseye » 2019-06-06 21:33

What, like "Re: " does?

[Entered by mobile. Excuse my spelling.]
HMS 5.6.6 B2383 on Win Server 2008 R2 Foundation, + 5.6.7-B2415 on test.
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829

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

Re: How To Tag External Email??

Post by mattg » 2019-06-07 01:58

I always test the FROM, and if a local domain, I ensure that the sender Authenticated

Much like these couple fo scripts
viewtopic.php?p=68117#p68117
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

estradis
Normal user
Normal user
Posts: 145
Joined: 2014-09-09 10:47

Re: How To Tag External Email??

Post by estradis » 2019-06-07 14:00

Please keep in mind, that subject tagging will break DKIM. :!:

Post Reply