Skip to content

Commit

Permalink
fix(logs): added bimi and dmarc entries for dkim logs to graylog
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Feb 8, 2024
1 parent c083740 commit dca10a0
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 113 deletions.
7 changes: 7 additions & 0 deletions lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ async function hookDataPost(stream, plugin, connection) {
short_message: '[DKIM] ' + result.status?.result,
_queue_id: queueId,
_mail_action: 'dkim_verify',
_dkim_envelope_from: dkimResult?.envelopeFrom,
_dkim_header_from: dkimResult?.headerFrom && [].concat(dkimResult?.headerFrom).join(', '),
_dkim_info: result.info,
_dkim_status: result.status?.result,
_dkim_length_limited: result.canonBodyLengthLimited ? 'yes' : 'no',
Expand All @@ -181,7 +183,12 @@ async function hookDataPost(stream, plugin, connection) {
_dkim_signing_headers: signingHeaders.join(','),
_dkim_signing_headers_content_type: signingHeaders.includes('content-type') ? 'yes' : 'no',
_spf_status: txn.notes.spfResult?.status?.result,
_spf_domain: txn.notes.spfResult?.domain,
_dmarc_status: dmarcResult?.status?.result,
_dmarc_spf_aligned: dmarcResult?.alignment?.spf?.result,
_bimi_status: bimiResult?.status?.result,
_bimi_comment: bimiResult?.status?.comment,
_bimi_vmc: bimiResult?.status?.result === 'pass' && (bimiResult?.authority ? 'yes' : 'no'),
_content_type_count: contentTypeHeaders.length,
_content_type_boundary: contentTypeHeaders.length ? contentTypeHeaders.at(-1)?.params?.boundary?.substr(0, 20) : null
});
Expand Down
Loading

0 comments on commit dca10a0

Please sign in to comment.