Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
hMailServer: remove/anonymise "received" header from outgoing emails
' 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