mirror of
https://github.com/decke/smtprelay.git
synced 2026-04-25 04:45:52 +03:00
[GH-ISSUE #284] Rationale behind the UUID in logging messages? #46
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/smtprelay#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Necoro on GitHub (Dec 5, 2025).
Original GitHub issue: https://github.com/decke/smtprelay/issues/284
When relaying a mail, the code logs a message about it -- which includes a random UUID:
github.com/decke/smtprelay@ccb70f5cf6/main.go (L176-L180)What is the rationale here?
@decke commented on GitHub (Dec 6, 2025):
The idea was to have a unique identifier for a request that can be traced. You can see the original code in commit
34cb47c364but I probably broke it in the rewrite from logrus to zerolog.@Necoro commented on GitHub (Dec 6, 2025):
Hmm, I think also in the original version the UUID is not globally assigned to the message so there is really no use (except I misunderstand the logging framework and they do this assignment under the hood).
Btw: mails already have the header "Message-Id". This allows for tracing because it is the same throughout the whole process.
@n3storm commented on GitHub (Dec 7, 2025):
From my experience you cannot trust all messages have a "Message-Id"
@decke commented on GitHub (Dec 7, 2025):
Message-Id does not seem to be strictly required and can also be created by the smtp server. Format of the content seems to be better defined but handling is a bit imprecise.
msmtp has a config option for it and will create a Message-Id header per default. Don't know about dma and others yet.
@decke commented on GitHub (Dec 8, 2025):
DragonFly Mail Agent v0.13+
Message-Id: 69367eae.a763.27b982d6@host
Dma creates a proper message-id.
@Necoro commented on GitHub (Dec 8, 2025):
My first intention was: Well, this is an SMTP server. On the other hand, and this is already true for just reading it, this would require to add mail content handling to the software. This might not be worth it.
@decke: Feel free to just close this issue. I stumbled upon this UUID creation and was just puzzled. If this is as intended there is no issue :)
@decke commented on GitHub (Dec 8, 2025):
It's true that smtprelay is almost transparent and per design does not store and forward like regular SMTP Servers do. But we already fiddle with mail headers (Received) so it's not impossible.
@decke commented on GitHub (Dec 8, 2025):
Tested with a HP LaserJet PRO M281fdw (from 2018) and it does not send a Message-Id so my upstream smtp creates it instead.
Message-ID: 19afd0be6e7.5c39ada953244009.3969882385343288018@zoho.eu