Commit Graph

245 Commits

Author SHA1 Message Date
Scott Kitterman 2f74edfc1b Fix -rundir expansion 2019-04-26 19:33:36 -04:00
Scott Kitterman 9b1f3c5e31 Fix default rundir in etc/dkimpy-milter.conf.inwq 2019-04-26 19:31:56 -04:00
Scott Kitterman f73596a67e More expand cleanups 2019-04-26 18:44:17 -04:00
Scott Kitterman c89bfdb9df Split out sysconfdir (/etc) and confdir (/etc/dkimpy-milter) in expand 2019-04-26 18:36:12 -04:00
Scott Kitterman b9435d735d Add system/socket-activation files to expand 2019-04-26 18:16:04 -04:00
Scott Kitterman 0092b10064 More expand in s/s/dkimpy-milter.service.in 2019-04-26 18:14:23 -04:00
Scott Kitterman 5d48b5ea2b Use expand in socket-acitvation files 2019-04-26 18:09:27 -04:00
Scott Kitterman 0ef0f2f509 Add system/dkimpy-milter.service to expand 2019-04-26 18:03:44 -04:00
Scott Kitterman 5ff6ef5c4b Set daemon path and rundir in dkimpy-milter.service using variable expansion 2019-04-26 18:00:14 -04:00
Scott Kitterman cd86159057 fix dkimpy-milter.in permissions 2019-04-26 17:41:45 -04:00
Scott Kitterman 43ea5c1cdf bindir vice sbindir in openrc file 2019-04-26 17:38:49 -04:00
Scott Kitterman d1cfcb7c44 More expand fixes/updates 2019-04-26 17:37:29 -04:00
Scott Kitterman ad505cda6e Use variable expansion in system/dkimpy-milter 2019-04-26 17:33:44 -04:00
Scott Kitterman d291f10a9b Use variable expansion for dkimpy-milter.conf.5 2019-04-26 17:20:37 -04:00
Scott Kitterman 6268032484 Simplify openrc.in - no checkconfig in dkimpy-milter 2019-04-26 17:19:37 -04:00
Scott Kitterman 385271982f Don't need to find the grep command after all 2019-04-26 17:18:58 -04:00
Scott Kitterman f7d4dd2d47 Start CHANGES for 1.2.0 2019-04-26 17:18:36 -04:00
Scott Kitterman 7521e156f8 Belatedly bump version and start CHANGES for 1.2.0 2019-04-25 07:17:07 -04:00
Scott Kitterman e993125514 Use setup.py expand to fill out man/dkimpy-milter.conf.5 2019-04-25 07:15:04 -04:00
Scott Kitterman b8118c604a Merge branch 'master' of git+ssh://git.launchpad.net/dkimpy-milter 2019-04-25 07:05:33 -04:00
Scott Kitterman 518a66d60b Use setup.py expand to fill out etc/dkimpy-milter.conf 2019-04-25 07:05:25 -04:00
Scott Kitterman 6dacbb59df Use setup.py expand to fill out etc/dkimpy-milter.conf 2019-04-25 07:02:15 -04:00
Scott Kitterman ae8b17c0ce First effort at doing make like variable expansion so we don't have to patch when file locations change 2019-04-25 00:50:23 -04:00
Scott Kitterman 0b522ca4d1 Minor README corrections 2019-04-13 08:42:30 -04:00
Scott Kitterman aba9c0aa0c Update TODO 1.1.0 2019-04-12 22:43:18 -04:00
Scott Kitterman 19b6ce7a68 Update CHANGES and man/dkimpy-milter.conf.5 for SubDomains option. 2019-04-12 22:34:59 -04:00
Scott Kitterman 8dc3ac6474 Add option to sign for subdomains - Thanks to Sagi for the patch 2019-04-12 22:31:24 -04:00
Scott Kitterman 290a37b99c Update CHANGES to current 2019-04-12 22:27:23 -04:00
Scott Kitterman 564799402a Catch and log config items missing values 2019-04-12 22:01:56 -04:00
Scott Kitterman 357905bb68 Fix debugLevel for config._readConfigFile 2019-04-12 21:45:31 -04:00
Scott Kitterman 6b851f18df Changes in dkimpy_milter/__init__.py to harmonize logging messages and log text instead of bytestring. 2019-04-12 21:29:09 -04:00
Scott Kitterman 7ab58edb1b Consisently use /run vice /var/run for documentation and init system integration 2019-04-12 20:57:08 -04:00
Scott Kitterman 23b0e8a386 README updates for python3 switch 2019-04-12 20:51:33 -04:00
Scott Kitterman 2e105bd18c Py3DNS vice PyDNS because we're python3 now 2019-04-12 20:34:42 -04:00
Scott Kitterman fb72b9f6e7 Merge 1_0 into master 2019-03-12 22:06:42 -04:00
Scott Kitterman 7eed8995a2 Merge branch 'dkg/socket-activation' into 1_0 2019-03-12 22:01:00 -04:00
Scott Kitterman a16d887ac6 Fix merge conflicts 2019-02-24 07:22:58 -05:00
Scott Kitterman 23d91b2b50 Update CHANGES for merge of dkg/test-suite 2019-02-24 07:19:18 -05:00
Scott Kitterman 481fbdae29 Merge branch 'dkg/test-suite' into 1_0 2019-02-24 07:13:30 -05:00
Scott Kitterman 4b0c39b0c7 Start changes for python3 update 2019-02-24 06:57:47 -05:00
Daniel Kahn Gillmor 7092874729 Enable sd_listen_fds(3)-style socket-activation support
I've added straightforward systemd unit files in
system/socket-activation/ that make use of this approach, and a
README.md in the same location that describes the tradeoffs.
2019-02-21 19:22:11 -05:00
Daniel Kahn Gillmor ea09bab1a8 Convert __init__.py to python3
The main work here is about bytes vs. strings.  This work was
confusing for several reasons:

 * pymilter thinks that headers are all strings, but body is bytes

 * dkimpy wants to deal with bytes objects generally (though it
   accepts a string object as an ed25519 secret key for some reason,
   despite requiring bytes as an RSA secret key)

 * authres.AuthenticationResultsHeader object converts easily to a
   string, but has no direct bytes conversion.  meanwhile, it wants
   its arguments as strings, but will accept them if they are bytes
   and convert them with something like str(), which leaves weird
   cruft like "header.a=b'ed25519-sha256'"

 * dkimpy_milter/utils.py contains fold() which expects bytes

 * self.fp needs to accumulate the on-the-wire version of the message
   as a whole (so it needs to be bytes).  That means converting the
   headers.  Header names and values are US-ASCII, per §2.2 of RFC
   5322, so they should be convertible cleanly, but we still have to
   convert them explicitly so that python knows the right thing to do.

At any rate, tests/runtests all passes with these changes, and the
output for both Authentication-Results: and DKIM-Signature headers
looks the same.
2019-02-21 19:22:11 -05:00
Daniel Kahn Gillmor 25fdd3b81c Do not create PidFile by default
By default, avoid creating a PIDFile.

PIDFiles are racy and potentially dangerous.  Modern system
supervision systems don't need them, because they manage the process
groups directly.

If the configuration file doesn't specify a PidFile, dkimpy-milter
shouldn't try to create one.
2019-02-21 19:22:11 -05:00
Daniel Kahn Gillmor 9d5316ca0e Handle defaults for Socket differently
We want to be able to select the default for Socket differently in the
future.

This change augments the API for dkimpy_milter.util.own_socketfile()
by adding an optional sockname argument.  This is a
backward-compatible change.  If we aren't committed to API stability
for this function, we could make a more invasive change that would
probably be a more reasonable API going forward, but this is probably
good enough.
2019-02-21 19:22:11 -05:00
Daniel Kahn Gillmor 391b5352f3 Convert mostly to python3 (still need strings/bytes conversions)
This covers conversion of the whole project to python3, *except* for
the strings/bytes distinction in __init__.py, which i'm leaving for a
second commit.

The changes in this commit are intended to be relatively
uncontroversial, so that the following commit contains the tricky
bits.
2019-02-21 19:22:09 -05:00
Daniel Kahn Gillmor ad8f396db0 Expand test suite to cover RSA as well as ed25519 2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor 479820a07d tests: test DKIM signing and verification
This test makes use of DNSOverride and the new verifying milter to
ensure that signatures can be verified properly.

It doesn't test the actual interaction with the public DNS, but
getting that kind of test to work on arbitrary platforms might be more
trouble than it's worth.

I note that the DNSOverride only works as long as testkey.dns is a
single line, which is fine for ed25519, but maybe not for RSA.
2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor 7bfb87fab7 Set up __main__.py, use it in tests
This allows us to invoke dkimpy-milter as "python -m dkimpy_milter
dkimpy-milter.conf", which makes running the test suite easier.
2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor 5c1d5d6e52 tests: Run a verifying milter as well as a signing milter
Having a verifying milter will come in handy when we want to test both
sides of the DKIM process.
2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor ae31730593 check for actions claimed by the filter 2019-02-21 19:21:38 -05:00