Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown recipients are not logged #232

Open
snabb opened this issue Oct 19, 2024 · 1 comment
Open

Unknown recipients are not logged #232

snabb opened this issue Oct 19, 2024 · 1 comment

Comments

@snabb
Copy link

snabb commented Oct 19, 2024

After migrating some domains over to mox, I woud like to monitor the logs for attempts to send e-mail to non-existing addresses. It could be an indication that I have failed to migrate some addresses. It would be also useful to see if anyone is trying to enumerate possible addresses.

Unfortunately I found that when external delivery attempt to unknown recipients is logged, the recipients entry is always empty. I was not able to find any log entry containing the recipient address even though I have debug level logging enabled.

See example below:

2024-10-18TXX:XX:XX.XXXXXX+00:00 XXXXX mox[763]: l=info m="deliver attempt to unknown user(s)" pkg=smtpserver recipients=[] cid=192a12e1736 delta="52.44µs"

I looked at the code where this is logged, but it wasn't immediately obvious to me why recipients would end up being empty.

This is with mox-v0.0.12-go1.23.2.

mjl- added a commit that referenced this issue Nov 1, 2024
…e recipient

before this change, we were logging an empty string, which turned into "[]",
looking like an empty array. misleading and unhelpful.

this is fixed by making struct fields on type recipient "exported" so they can
get logged, and by changing the logging code to log nested
struct/pointer/interface fields if we would otherwise wouldn't log anything
(when only logging more basic data types).

we'll now get log lines like:

	l=info m="deliver attempt to unknown user(s)" pkg=smtpserver recipients="[addr=bogus@test.example]"

for issue #232 by snabb, thanks for reporting!
@mjl-
Copy link
Owner

mjl- commented Nov 1, 2024

@snabb Thanks for reporting. I thing the commit above fixes the issue. The commit message has more details.

See https://www.xmox.nl/b/#598c5ea6ac9f4a5ac0b6404102b776818f11b6d4 for a binary with this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants