How to log headers sent during SMTP client session?
How to log headers sent during SMTP client session?
I need a copy of the email headers sent in an SMTP client session. I've enabled SMTP logging, but those logs don't show all the detailed headers being sent. How can I do this?
Thanks,
Mark
Thanks,
Mark
Re: How to log headers sent during SMTP client session?
headers sent in a SMTP client session?
Perhaps use Wireshark or something similar
I'm really not sure what you will find though
Message headers will normally be part of a message, but I suspect that you are looking for something else
Can you provide more detail on EXACTLY what you are looking for
Perhaps use Wireshark or something similar
I'm really not sure what you will find though
Message headers will normally be part of a message, but I suspect that you are looking for something else
Can you provide more detail on EXACTLY what you are looking for
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: How to log headers sent during SMTP client session?
I'm trying to get a complete copy of the mail headers from an email that failed to be delivered. The mail was accepted for delivery by hMailServer, but when hMailServer tried to relay it to its final destination, that destination mail server (Yahoo) refused to accept it, and issued an error message. A bounced email was returned to the original sender. I'm trying to work with Yahoo's postmaster (the final destination mail server) to get the problem corrected, and they are asking me for:
I have the mail headers from the email as originally sent to hMailServer. I have the bounced message, but it doesn't include the original email/headers sent to Yahoo. I'd like to have a log of the communication between hMailServer and Yahoo's mail server, showing the exact headers sent/refused. Or, maybe there were no headers even attempted to be sent in this case? Maybe Yahoo rejected the message before headers were even sent (at the MAIL FROM: command)?
Thank you,
Mark
I can only get this from the hMailServer logs:to provide us with the full headers of a recent email sent to a Yahoo Mail account that experienced delivery problems
Code: Select all
"SMTPC" 2192 13993 "2021-03-25 19:23:15.374" "98.136.96.74" "RECEIVED: 250-mtaproxy209.free.mail.ne1.yahoo.com[nl]250-PIPELINING[nl]250-SIZE 41943040[nl]250-8BITMIME[nl]250 OK"
"SMTPC" 2192 13993 "2021-03-25 19:23:15.374" "98.136.96.74" "SENT: MAIL FROM:<announcement@fundmanagersoftware.com>"
"SMTPC" 2204 13993 "2021-03-25 19:23:15.436" "98.136.96.74" "RECEIVED: 421 4.7.0 [TSS04] Messages from 54.68.144.214 temporarily deferred due to unexpected volume or user complaints - 4.16.55.1; see https://postmaster.verizonmedia.com/error-codes"
"SMTPC" 2204 13993 "2021-03-25 19:23:15.436" "98.136.96.74" "SENT: QUIT"
Thank you,
Mark
Re: How to log headers sent during SMTP client session?
If you are not already doing so you should select all the hMailServer Logs and look at them after recreating the problem. The full set of Logs may give you the necessary information. The Log Entries you show seem to indicate a problem with mail sent to a Verizon Postmaster indicating a possible Volume issue or perhaps user complaints.
If you think you understand quantum mechanics, you don't understand quantum mechanics.
Re: How to log headers sent during SMTP client session?
Can you ask the original sender for a copy of the message that they sent?
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: How to log headers sent during SMTP client session?
Yes, I understand the reason for the error message. We were sending out an email announcement, and Yahoo saw a large spike in volume. I'm just trying to provide Yahoo what they've asked for, which are the mail headers from one of these rejected messages. I did turn on all logging, and couldn't find such a low level detailed log of all communications sent/received during an SMTP session. I'm not sure even how far the communication gets, before getting the rejected message. Is it rejecting it on the MAIL FROM command, or on the DATA command? I don't seem to be able to figure out this level of detail from the available logs.
-
- Senior user
- Posts: 837
- Joined: 2016-12-08 02:21
Re: How to log headers sent during SMTP client session?
Maybe trap the delivery failures in a quarantine and use a scheduled task to delete them after a few days. Then you can review the entire header in the message file.
Code: Select all
sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
set oFS = CreateObject("Scripting.FileSystemObject")
on error resume next
oFS.CopyFile oMessage.Filename, "C:\ProgramData\hMailServer\Quarantine\", True
on error goto 0
end sub
Re: How to log headers sent during SMTP client session?
Thanks, that does accomplish what I was after.
-
- Senior user
- Posts: 837
- Joined: 2016-12-08 02:21
Re: How to log headers sent during SMTP client session?
Just a thought...if you want to preserve which recipient failed and why:
Code: Select all
sub OnDeliveryFailed(oMessage, sRecipient, sErrorMessage)
oMessage.HeaderValue("X-hMailServer-Failure-Recipient") = sRecipient
oMessage.HeaderValue("X-hMailServer-Failure-Reason") = sErrorMessage
oMessage.Save
set oFS = CreateObject("Scripting.FileSystemObject")
on error resume next
oFS.CopyFile oMessage.Filename, "C:\ProgramData\hMailServer\Quarantine\", True
on error goto 0
end sub
Re: How to log headers sent during SMTP client session?
Great idea, thanks again!