9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Dave MacFarlane <driusan@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] DKIM with upas
Date: Mon, 29 Jan 2018 10:58:49 -0500	[thread overview]
Message-ID: <CAG2UyHpHEMS_qMfaR_iD-UETVb1_Esi9S4kqDXEPYnkpaDgteA@mail.gmail.com> (raw)

I started hosting my personal domain's email on 9front and wanted to
sign my outgoing emails with a DKIM, so I wrote something in Go that
reads a message from stdin and writes a DKIM signed version to stdout
(https://github.com/driusan/dkim).

I was planning on using it in /mail/lib/remotemail by having the final
"exec smtp [...]" replaced by " exec dkimsign [...] | upas/smtp [...]"
and that works with marshal (if I ensure that I add all the headers
that I'm signing manually), but not acme.

>From what I can tell, acme always uses a From line of "From:
localname" (overriding any that you manually specified), and expects
upas/smtp to add in the domain, which is causing the signature to fail
after smtp modifies the signed header. (marshal leaves any headers
that you manually specify unmolested, so the signature is valid as
long as you include a fully qualified From: line while writing the
message.)

Is there a better place/way to do the signing? Ideally I could sign it
as the last thing it does before going out over the wire, but at the
very least I need to sign it after expanding the addresses. (The
standard says I also need to do the hashing before smtp dot stuffing,
but I can take care of that with a flag on the Go side..) The best I
can think of is some convoluted mix of "upas/smtp -f .domainname |
dkimsign | [some script that undoes most of what upas/smtp -f did ] |
upas/smtp", but I have a feeling I'm just missing some better place to
do the signing from.

- Dave



             reply	other threads:[~2018-01-29 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-29 15:58 Dave MacFarlane [this message]
2018-01-30 22:19 ` Anthony Sorace

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG2UyHpHEMS_qMfaR_iD-UETVb1_Esi9S4kqDXEPYnkpaDgteA@mail.gmail.com \
    --to=driusan@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).