-
-
Notifications
You must be signed in to change notification settings - Fork 662
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
Save the SMTP conversation #945
Comments
Core or plugin? It should be easy to do in a plugin. There's On Mon, Apr 27, 2015 at 2:54 PM, Matt Simerson notifications@github.com
|
You probably want to store the pre and post transaction conversation in cxn.notes and the transaction stuff in txn.notes and then merge the two before you write the transaction data to ES otherwise if you get >1 transaction per connection, you'll end up with a potentially large structure that contains all of the transactions which I suspect you probably don't want. |
I was thinking core.
That's only half the conversation. I'm not interested in the DATA (as snipped above) or the AUTH details (as snipped above), just the "we said, they said" outline. It might also help capture errors that aren't handled well such as a STARTTLS negotiation that fails, plugin crashes, and that sort of issue. One of the primary reasons I want this is to make it easy for SMTP literate support staff to have a TXT blob they can read like I didn't think this would be "easy" to do in a plugin, because of next(OK), plugin ordering, having to hook the world, and catching all the responses that are sent. |
Ok as long as it's configurable. I don't want high traffic servers storing more in ram than they need to.
|
I can see this being pretty useful for debugging some of those edge cases that are difficult to trace in production from just the log output alone and because we can't currently set the loglevel to something different for just a single session - this would be the next best thing. Might I suggest you make it so that it can be enabled globally (e.g. for what you want it for) via something like |
The use case would be as following:
|
My use case
|
What is the point of storing connection.results and logging the world - if you can't tell why a message was blocked or rejected using it? Both of you are doing it wrong if you cant instantly determine why a message was blocked using one field per recipient and one field for the overall message (e.g. connection.last_reject) in ES. Storing the SMTP conversation is useful for the vanishingly rare cases that there might be some weird issue. e.g. TLS failures, Path MTU issue causing the session to timeout, badly written SMTP client or bug in Haraka that causes a synchronization failure. In 10 years I can count the times on one hand when I've needed to trace the SMTP session to find an issue. Storing every SMTP session of every connection is fine if you don't care how big your ES indexes get or about insert performance (both in terms of Haraka and ES). e.g. as the logging plugin has to keep the session open to log this data before Haraka can destroy the connection object. |
Yeah, it's for those rare cases. |
From the perspective of support workers who typically deal with only the connections that ran afoul, those "rare" cases may not seem all that rare. This request originated in our support department. If adding 28 bytes of extra data to each SMTP document in ES helps them half as much as they think it will, and the cost is maybe an extra ES or Haraka server in high volume environments, that's an easy price to pay. |
Moved to idea section of the wiki. |
I think I'd like to store a summary of the SMTP conversation, assembled as an array on the connection, something like this:
such that it could be assembled into a string like so
connection.conv.join('\n');
Having this in ES would be quite helpful for support purposes.
Thoughts?
The text was updated successfully, but these errors were encountered: