Page 1 of 1

How To Tag External Email??

Posted: 2019-06-05 20:08
by cbritton1978
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.

Re: How To Tag External Email??

Posted: 2019-06-06 09:11
by jimimaseye
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

Re: How To Tag External Email??

Posted: 2019-06-06 16:16
by cbritton1978
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?

Re: How To Tag External Email??

Posted: 2019-06-06 21:33
by jimimaseye
What, like "Re: " does?

[Entered by mobile. Excuse my spelling.]

Re: How To Tag External Email??

Posted: 2019-06-07 01:58
by mattg
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

Re: How To Tag External Email??

Posted: 2019-06-07 14:00
by estradis
Please keep in mind, that subject tagging will break DKIM. :!: