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.
This commit is contained in:
@@ -354,7 +354,9 @@ def main():
|
||||
Milter.set_flags(Milter.CHGHDRS + Milter.ADDHDRS)
|
||||
miltername = 'dkimpy-filter'
|
||||
socketname = milterconfig.get('Socket')
|
||||
own_socketfile(milterconfig)
|
||||
if socketname is None:
|
||||
socketname = 'local:/var/run/dkimpy-milter/dkimpy-milter.sock'
|
||||
own_socketfile(milterconfig, socketname)
|
||||
drop_privileges(milterconfig)
|
||||
sys.stdout.flush()
|
||||
Milter.runmilter(miltername, socketname, 240)
|
||||
|
||||
Reference in New Issue
Block a user