Open Bug 1602281 Opened 4 years ago Updated 2 years ago

Add to SMTP:5 logging the ability to output the actual message sent including end of line characters

Categories

(Thunderbird :: General, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: gds, Assigned: gds)

References

Details

Attachments

(1 file)

Currently if SMTP logging is in effect (e.g., MOZ_LOG=SMTP:5), the SMTP protocol transactions (excluding passwords) are output to the designated MOZ_LOG_FILE. However, the actual email that is sent is not output to the file. This additional information would be helpful when debugging user problems during message delivery and is currently not available without using a network sniffer such as tcpdump or wireshark. Even with these tools the message may be hard to decipher due to SSL/TLS encoding or other encryption.
This proposes allowing SMTP:5 to add the mail message content to the log output. SMTP:4 will exclude the mail message and will be equivalent to the log generated currently with SMTP:4 or SMTP:5.

Here's a patch that works but it still contains various printf's that need to be removed.
This was inspired by bug 1222046 where seeing the actual mail delivery strings was needed to analyze the problem.
This also has a feature that when SMTP:5 is defined, if the message as a missing CRLF at the end, a CRLF is inserted before the terminating .CRLF
It also adds logging to indicate if "dot stuffing" occurred during the transmission (which is something I've yet to see on a real email message).

See Also: → 1222046
Assignee: nobody → gds
Status: NEW → ASSIGNED

The c++ SMTP implementation will soon be removed, so the patch is obsolete.
In the js implementation it would probably be here: https://searchfox.org/comm-central/rev/2038ea37e18a2a415c437a9c0b7c1a6d4948c23f/mailnews/compose/src/SmtpClient.jsm#559
Not sure if we'd really want to output all of the message. Potentially we could add a call to write the data as a file to the temp folder.

Status: ASSIGNED → NEW

Not sure if we'd really want to output all of the message. Potentially we could add a call to write the data as a file to the temp folder.

My proposed patch would only log the full message with SMTP:5 which adds the "Verbose" flag. The SMTP:4 would log like it currently does with the c++ code, up to only the "Debug" log level. So I don't see a harm in keeping the timestamped logged data all together in the MOZ_LOG_FILE since the user can choose to include the message content or not.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: