bugfix: when dkim-signing submitted messages, use the domain from the "message from header" instead of "smtp mail from"

dmarc verifiers will only accept a dkim signature if the domain the message From
header matches the domain of the signature (i.e. it is "aligned").

i hadn't run into this before and when testing because thunderbird sets the
"smtp mail from" to the same address as a custom "message from" header. but
other mail clients don't have to do that.

should fix issue #22
This commit is contained in:
Mechiel Lukkien
2023-03-30 10:38:36 +02:00
parent 0989e59567
commit 936a0d5afe
4 changed files with 108 additions and 8 deletions

View File

@ -331,8 +331,13 @@ func Drop(ID int64, toDomain string, recipient string) (int, error) {
return n, nil
}
type ReadReaderAtCloser interface {
io.ReadCloser
io.ReaderAt
}
// OpenMessage opens a message present in the queue.
func OpenMessage(id int64) (io.ReadCloser, error) {
func OpenMessage(id int64) (ReadReaderAtCloser, error) {
qm := Msg{ID: id}
err := queueDB.Get(&qm)
if err != nil {