Strip the IP and (host-)name of the original sender
Strip the IP and (host-)name of the original sender
Like described viewtopic.php?f=7&t=35385, other servers have an option to strip above mentioned personal data from emails they send. This would be a nice option to have in hmailserver too.
Re: Strip the IP and (host-)name of the original sender
Can you name the other servers that do this...
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation
Re: Strip the IP and (host-)name of the original sender
https://www.hmailserver.com/forum/viewtopic.php?t=18467
Code: Select all
' Strips out private IP addresses from Received header
' if the client's IP address is in 172.16.0.0/16
Sub OnAcceptMessage(oClient, oMessage)
' Check client's IP address
if Left(oClient.IPAddress, 7) = "172.16." Then
Dim oHeaders
set oHeaders = oMessage.Headers
' Iterate over the headers looking for Received:
Dim i
For i = oHeaders.Count -1 To 0 Step -1
dim oHeader
Set oHeader =oHeaders.Item(i)
' Check if this is a header which we should modify.
if LCase(oHeader.Name) = "received" Then
' Log the header value in case we need it later on
EventLog.Write("Pre-anonymisation: " + oHeader.Value)
' Set up the regex
Dim myRegExp
Set myRegExp = New RegExp
myRegExp.Global = False
myRegExp.Pattern = "\bfrom[\-\sA-Za-z0-9\.\]\[\(\)]*by mail.example.com\b"
' Do the replacement
oHeader.Value = myRegExp.Replace( oHeader.Value, "from mailclient by mail.example.com" )
' Dump the modified header
EventLog.Write("Post-anonymisation: " + oHeader.Value)
End If
Next
' Save all the changes...
oMessage.Save
End If
End Sub
CIDR to RegEx: d-fault.nl/cidrtoregex
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup
DNS Lookup: d-fault.nl/dnstools
DKIM Generator: d-fault.nl/dkimgenerator
DNSBL Lookup: d-fault.nl/dnsbllookup
GEOIP Lookup: d-fault.nl/geoiplookup
- jimimaseye
- Moderator
- Posts: 10053
- Joined: 2011-09-08 17:48
Re: Strip the IP and (host-)name of the original sender
That will also strip the local received headers of inbound external mail too. A condition would be required to check it's outbound email.
[Entered by mobile. Excuse my spelling.]
[Entered by mobile. Excuse my spelling.]
5.7 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
SpamassassinForWindows 3.4.0 spamd service
AV: Clamwin + Clamd service + sanesecurity defs : https://www.hmailserver.com/forum/viewtopic.php?f=21&t=26829
Re: Strip the IP and (host-)name of the original sender
And also it should work for non-local users too. I don't rely on it in any way. I think it is just a good, somewhat privacy focused, feature, witch is missing in that great peace of software, that other servers offer, which I can't name, because I don't know stuff.
But thinking of it more, I don't run any scripts, so I probably won't that one ether. It would be nice to have it truly integrated, but if not, please don't write scripts just for me. I gave my PC a reasonable name already.
But thinking of it more, I don't run any scripts, so I probably won't that one ether. It would be nice to have it truly integrated, but if not, please don't write scripts just for me. I gave my PC a reasonable name already.
Re: Strip the IP and (host-)name of the original sender
I think that the last thing that hMailserver does for mail that is Local >> (local |External) is add the received from header
even after all rules and scripts are run
i think that script will ONLY impact on incoming mail
even after all rules and scripts are run
i think that script will ONLY impact on incoming mail
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation
https://www.hmailserver.com/documentation