Home | Trees | Indices | Help |
---|
|
1 #!/usr/bin/env python 2 3 # This software is provided 'as-is', without any express or implied 4 # warranty. In no event will the author be held liable for any damages 5 # arising from the use of this software. 6 # 7 # Permission is granted to anyone to use this software for any purpose, 8 # including commercial applications, and to alter it and redistribute it 9 # freely, subject to the following restrictions: 10 # 11 # 1. The origin of this software must not be misrepresented; you must not 12 # claim that you wrote the original software. If you use this software 13 # in a product, an acknowledgment in the product documentation would be 14 # appreciated but is not required. 15 # 2. Altered source versions must be plainly marked as such, and must not be 16 # misrepresented as being the original software. 17 # 3. This notice may not be removed or altered from any source distribution. 18 # 19 # Copyright (c) 2008 Greg Hewgill http://hewgill.com 20 # 21 # This has been modified from the original software. 22 # Copyright (c) 2011 William Grant <me@williamgrant.id.au> 23 24 from __future__ import print_function 25 26 import sys 27 28 import dkim 29 3032 if sys.version_info[0] >= 3: 33 # Make sys.stdin a binary stream. 34 sys.stdin = sys.stdin.detach() 35 36 message = sys.stdin.read() 37 verbose = '-v' in sys.argv 38 if verbose: 39 import logging 40 d = dkim.DKIM(message, logger=logging) 41 res = d.verify() 42 else: 43 res = dkim.verify(message) 44 if not res: 45 print("signature verification failed") 46 sys.exit(1) 47 print("signature ok")48 49 50 if __name__ == "__main__": 51 main() 52
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Dec 16 12:46:43 2019 | http://epydoc.sourceforge.net |