예제 #1
0
def _doVerify(options):
    # Parse the HTTP file
    verify = open(os.path.expanduser(options["verify"])).read()
    _method, _uri, headers, body = _parseRequest(verify)

    # Check for local public key
    if options["pub-key"]:
        PublicKeyLookup_File.pubkeyfile = os.path.expanduser(options["pub-key"])
        lookup = (PublicKeyLookup_File,)
    else:
        lookup = None

    dkim = DKIMVerifier(headers, body, lookup)
    if options["fake-time"]:
        dkim.time = 0

    try:
        yield dkim.verify()
    except DKIMVerificationError, e:
        print("Verification Failed: %s" % (e,))
예제 #2
0
def _doVerify(options):
    # Parse the HTTP file
    verify = open(options["verify"]).read()
    method, uri, headers, stream = _parseRequest(verify)

    request = ClientRequest(method, uri, headers, stream)

    # Check for local public key
    if options["pub-key"]:
        PublicKeyLookup_File.pubkeyfile = options["pub-key"]
        lookup = (PublicKeyLookup_File,)
    else:
        lookup = None

    dkim = DKIMVerifier(request, lookup)
    if options["fake-time"]:
        dkim.time = 0

    try:
        yield dkim.verify()
    except DKIMVerificationError, e:
        print("Verification Failed: %s" % (e,))
예제 #3
0
def _doVerify(options):
    # Parse the HTTP file
    verify = open(options["verify"]).read()
    method, uri, headers, stream = _parseRequest(verify)

    request = ClientRequest(method, uri, headers, stream)

    # Check for local public key
    if options["pub-key"]:
        PublicKeyLookup_File.pubkeyfile = options["pub-key"]
        lookup = (PublicKeyLookup_File, )
    else:
        lookup = None

    dkim = DKIMVerifier(request, lookup)
    if options["fake-time"]:
        dkim.time = 0

    try:
        yield dkim.verify()
    except DKIMVerificationError, e:
        print("Verification Failed: %s" % (e, ))