Skip to content

Instantly share code, notes, and snippets.

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
EventLog.Write("Anonymised: " + oClient.Username + " / " + oMessage.To)
End If
' Save all the changes...
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment