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

Detailed logging for decryption/validation #10

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

garrettr
Copy link

Currently, if the server is unable to verify an email, and "Valid signatures only" is enabled, it logs MailHandler: ignoring emails with invalid signature. This is helpful because otherwise the message is dropped with no indication to the sender or the Redmine administator.

However, it lacks details that could assist troubleshooting. Ideally, the log message would also include the sender and a unique ID for the message (e.g. Message-ID), so an administrator could try to troubleshoot the problem (and potentially recover and examine emails that were rejected from the IMAP server).

Additionally, some servers might like to try to enforce or strongly encourage that all incoming mail is encrypted (in addition to encrypting outgoing mail, which is handled by redmine_openpg). I filed #9 to address this with a comprehensive feature, but as a stop-gap measure it would be helpful for an administrator to be able to determine if their Redmine instance is receiving unencrypted mail.

This pull request:

  • Prints a log line for every email received
  • Includes the sender address and Message-ID to assist troubleshooting
  • Indicates whether the message was encrypted/not encrypted, had a valid/invalid signature, or was ignored/not ignored. This assists troubleshooting and enables some useful monitoring (e.g. detecting when users are sending unencrypted email, and following up with them individually, as a stop-gap until something is implemented for Add option to filter incoming email #9).

The new log lines look like this:

MailHandler: received email from [email protected] with Message-ID [email protected]: encrypted=true, valid=true, ignored=false

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

Successfully merging this pull request may close these issues.

1 participant