Created
June 28, 2019 07:54
-
-
Save lifeofguenter/09787da01233393ee93fce113cf1e1d8 to your computer and use it in GitHub Desktop.
hMailServer: remove/anonymise "received" header from outgoing emails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Anonymise "Received" header on outgoing emails | |
Sub OnAcceptMessage(oClient, oMessage) | |
' Only delete received headers from own clients/submissions | |
If Len(oClient.Username) > 0 Then | |
Dim oHeaders | |
set oHeaders = oMessage.Headers | |
Dim i | |
For i = oHeaders.Count -1 To 0 Step -1 | |
dim oHeader | |
Set oHeader = oHeaders.Item(i) | |
' Check i this is a header which we should delete. | |
if LCase(oHeader.Name) = "received" Then | |
oHeader.Delete | |
EventLog.Write("Anonymised: " + oClient.Username + " / " + oMessage.To) | |
End If | |
Next | |
' Save all the changes... | |
oMessage.Save | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Worked great!