Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3742

MIME-Version header is changed, breaking DKIM signatures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.2
    • None
    • James Core
    • None

    Description

      We are using James to forward mails from external email servers to customer accounts.

      Some email clients create emails with the following headers:

      Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\))
      DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
              d=xxxx.gappssmtp.com; s=20210112;
              h=from:content-transfer-encoding:mime-version:subject:message-id:date:to;
              bh=...;
              b=...

      So the message is signed by the originator including the Mime-Version header. The problem is that if we set an additional header with SetMimeHeaderHandler or invoke the SpamAssassin service then the method MimeMessage.updateHeaders() is invoked which sets a new mime version header:

      MIME-Version: 1.0

      thereby breaking the DKIM signature from the original sender. We can add our own signature using the new header, but this isn't aligned with the sender domain so it doesn't help. It's probably debatable whether the original Mac mail client mime version header is valid, but it is what it is.

      This seems to be completely broken, but the behaviour is baked into the MimeMessage class and we can't see any way around it. How can we preserve the original mime-version header and the DKIM signature?

      Attachments

        Activity

          People

            Unassigned Unassigned
            paulch Paul Chown
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: