Menu

#279 opendkim-testmsg

2.10.3
open
nobody
None
5
2020-04-19
2019-08-17
No

Version: 2.11.0~alpha-10+deb9u1
OS: Debian 9

When I run opendkim-testmsg, it repeats the last 8 characters on the base64 encoded b tag value.

Note the end, flG52g==flG52g==:

$ opendkim-testmsg -k '/tmp/dkim.test.private.key' -s 'test20190817' -d 'user.com' < '/tmp/dkim.test.mail'
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d=user.com; s=test20190817;
    t=1566066601; bh=bgTxPlNk5mmbUo24DJIIqb1vTQI=;
    h=Date:From:To:Subject:MIME-Version:Content-Type:Message-ID;
    b=cmSmQREj8ip447K5WIl7YBmW97yiGsCF81XHQa5ObCXjRStVpziq9W0nXVpGR2iLi
     PDkZBFfqdXFJRYcsaKbN6Z6GfnvRmxQxGRe1HSZjBD7o7lPsxc1D2NvI6DDo7kUeeu
     6qF5ebh6ud2O9a0CJZrpCbu5UaExaBI7mcxRldUt0buP3Qo6oXKpPooMmomjAglGfT
     ay2KhQZqcedWg5gjqjmiZhc5ZOL+WgdJldybwYpqMCoE2yNXSMsP9h73/k7Py0VAlW
     nF+MxnVwtZT3ciF0liGjzURRRWLigINQKAh3rnCrthkW6EDm4BwscKiUnSEvCd6/ha
     RV812njflG52g==flG52g==
Date: Sat, 17 Aug 2019 03:58:05 +0000
From: Signer <signer@user.com>
To: Vagrant <recipient@gmail.com>
Subject: Signed by OpenDKIM
MIME-Version: 1.0
Content-Type: text/plain
Message-ID: <C8.B5.44875.D4B775D5@user.com>

Message body here.

opendkim-testmsg correctly complains that this constitutes a syntax error.

$ opendkim-testmsg -k '/tmp/private.key' -s 'test20190817' -d 'user.com' < '/tmp/test.mail' | opendkim-testmsg
opendkim-testmsg: dkim_chunk(): Syntax error

Discussion

  • Horse Whisperer

    Horse Whisperer - 2019-08-17

    Update to this... setting the -C flag (use CRLF) seems to solve the problem.

     
  • David Favor

    David Favor - 2020-04-18

    Problem persists with or without -C flag.

    Version...
    lxd: net14-fixdeliver # opendkim -V | head -n 1
    opendkim: OpenDKIM Filter v2.11.0

     
  • David Favor

    David Favor - 2020-04-19

    I've tried all variations of using -C flag alone with passing messages through unix2dos.

    All variations fail.

    I've also tried signing algorithms rsa-sha256 + sha256, with bit widths of 1024 + 2048 + 4096.

    Again, all variations fail.

    This suggests a bug in opendkim-testmsg which renders this code broken for all cases.

    Since opendkim-testmsg has no verbosity/debug/trace facility + the code never makes it far enough to generate any temp files, some other approach is required.

    Someone let me know if there's some other manual way to interact with the socket to return the signed headers for debugging.

    Makes no difference how complex this process might be. Pass along any approach + I'll figure out how to get it working.

    Thanks.

     
  • David Favor

    David Favor - 2020-04-19

    Using strace shows what appears to be a problem parsing the first line of the test message...

    openat(AT_FDCWD, "/root/tmp/dkim0YNK3Z", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
    unlink("/root/tmp/dkim0YNK3Z")          = 0
    fstat(0, {st_mode=S_IFREG|0644, st_size=594, ...}) = 0
    read(0, "From: david@davidfavor.com\nTo: c"..., 4096) = 594
    read(0, "", 4096)                       = 0
    write(3, "From: david@davidfavor.com\nTo: c"..., 594) = 594
    write(2, "opendkim-testmsg: dkim_chunk(): "..., 45opendkim-testmsg: dkim_chunk(): Syntax error
    ) = 45
    close(3)                                = 0
    exit_group(70)                          = ?
    +++ exited with 70 +++
    
     

    Last edit: David Favor 2020-04-19

Log in to post a comment.

MongoDB Logo MongoDB