Port dkimverify.py.
This commit is contained in:
+11
-2
@@ -17,13 +17,22 @@
|
||||
# 3. This notice may not be removed or altered from any source distribution.
|
||||
#
|
||||
# Copyright (c) 2008 Greg Hewgill http://hewgill.com
|
||||
#
|
||||
# This has been modified from the original software.
|
||||
# Copyright (c) 2011 William Grant <me@williamgrant.id.au>
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
|
||||
import dkim
|
||||
|
||||
if sys.version_info.major >= 3:
|
||||
# Make sys.stdin a binary stream.
|
||||
sys.stdin = sys.stdin.detach()
|
||||
|
||||
message = sys.stdin.read()
|
||||
if not dkim.verify(message):
|
||||
print "signature verification failed"
|
||||
print("signature verification failed")
|
||||
sys.exit(1)
|
||||
print "signature ok"
|
||||
print("signature ok")
|
||||
|
||||
Reference in New Issue
Block a user