21 Commits

Author SHA1 Message Date
Scott Kitterman fb72b9f6e7 Merge 1_0 into master 2019-03-12 22:06:42 -04: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 71c0c3f20a Avoid failing to chown non-existent Unix-domain sockets
Changing ownership of sockets that doesn't exist isn't a great
practice.

A better approach would be to apply os.chown() to the file descriptor
of the open socket, but at the very least dkimpy-milter shouldn't
crash the way it currently does if the socket isn't already present.
2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor a9a6893c89 Handle unix: socket prefix the same as local:
sendmail's milter.c treats these two declarations the same way, so
what we do for one should also be done for the other.
2019-02-21 19:21:38 -05:00
Daniel Kahn Gillmor bb44f36519 When Socket is absolute path, do not strip leading /
This appears to just be an untested codepath.
2019-02-21 19:21:38 -05:00
Scott Kitterman 4f21623f92 Add read_keytable function to util.py 2018-12-24 16:08:50 -05:00
Scott Kitterman 70606ac58c pep8 and a few other cleanups 2018-03-10 02:45:35 -05:00
Scott Kitterman 6348bdcdc7 Cleanup, indentation, pyflakes 2018-03-10 00:52:45 -05:00
Scott Kitterman c01c04b83f - Fix header folding to use \n only to align with milter protocol
requirements
2018-03-03 14:39:20 -05:00
Scott Kitterman 48a44916e7 Create PID directory if it is missing 2018-03-03 01:45:15 -05:00
Scott Kitterman 5e2cff5e5d - Fold added authres header fields
- Fix pidfile permissions
 - Fix socket setup sequence so Unix sockets work
2018-03-02 16:14:46 -05:00
Scott Kitterman 51464bd7f8 Add support for Canonicalization option 2018-02-18 00:56:02 -05:00
Scott Kitterman 7b8fccf801 Bug fixes for RSA/Ed25519 signing (now works), syslog fixes, update TODO verification status 2018-02-17 02:10:21 -05:00
Scott Kitterman 246bdba859 Read key files in before dropping priviledges 2018-02-16 22:09:05 -05:00
Scott Kitterman 2399ee0010 Implement and test PidFile option. Update TODO 2018-02-16 17:12:41 -05:00
Scott Kitterman 92923fdbc4 Refactor ExceptHook to get rid of archaic string usage and restore reporting to stderr. 2018-02-14 07:21:22 -05:00
Scott Kitterman f5e08c4ea1 very minor cleanup - starts and creates socket 2018-02-13 23:42:24 -05:00
Scott Kitterman c523afe8e5 Continue moving towards a working system:
- Move exception hook from config into util
 - Make config data conversion work for all used types
 - Make syslog work (still need to make it only work if specified)
2018-02-13 23:16:44 -05:00
Scott Kitterman 26c1dd626a Adjust drop_priviledges to better match what's needed here 2018-02-13 02:12:22 -05:00
Scott Kitterman 8cc5c88fec Make a proper package of this, entry points and all 2018-02-12 12:30:43 -05:00