You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/08/25 20:51:57 UTC

[incubator-ponymail-foal] branch master updated: Add a --nonce argument for setting a nonce with dkim

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 88e40fe  Add a --nonce argument for setting a nonce with dkim
88e40fe is described below

commit 88e40fe529016d6e4f4507a29b0786b1ff7064ec
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Aug 25 22:50:45 2020 +0200

    Add a --nonce argument for setting a nonce with dkim
---
 tools/setup.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/setup.py b/tools/setup.py
index ef39ed7..3b3a9d2 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -155,6 +155,12 @@ parser.add_argument(
     type=str,
     help="Document ID Generator to use (legacy, medium, cluster, full)",
 )
+parser.add_argument(
+    "--nonce",
+    dest="nonce",
+    type=str,
+    help="Cryptographic nonce to use if generator is DKIM/RFC-6376 (--generator dkim)",
+)
 args = parser.parse_args()
 
 print("Welcome to the Pony Mail setup script!")
@@ -208,6 +214,8 @@ if args.generator:
             + "\n"
         )
         sys.exit(-1)
+if args.generator == 'dkim' and args.nonce is not None:
+    nonce = args.nonce
 
 hostname = input("What is the hostname of the ElasticSearch server? [localhost]: ")
 if not hostname:
@@ -263,7 +271,7 @@ while genname == "":
     except ValueError:
         pass
 
-if genname == "dkim":
+if genname == "dkim" and nonce is None:
     print(
         "DKIM hasher chosen. It is recommended you set a cryptographic nonce for this generator, though not required."
     )