In hMailserver we can reject those emails very simply. In the OnSMTPData sub the Subject field is available and we can measure the amount of characters (length):
Sub OnSMTPData(oClient, oMessage)
subjectLength = len(oMessage.Subject)
if subjectLength > 160 then
Eventlog.Write("OnAcceptMessage: email rejected because of Subject = " & subjectLength & " characters (>160). From: " & oMessage.FromAddress)
result.value=1
end if
end sub
When a subject field of an email is longer than 160 characters, the event will be logged in the hMailserver logfile and the email will be rejected.
4144 "2020-02-08 09:02:37.138" "OnAcceptMessage: email rejected because of Subject = 236 characters (>160). From: email@sender.com"
Also, the sender gets an email that the email is rejected:
Your message did not reach some
or all of the intended recipients.
Subject: RE:
1234567890RE: 1234567890RE: 1234567890RE: 1234567890RE: 1234567890RE:
1234567890RE: 1234567890RE: 1234567890RE: 12345678901234567890
Sent: 2/8/2020
9:03 AM
The
following recipient(s) cannot be reached:
554 Rejected
No comments :
Post a Comment