~ar-python-hackers/authentication-results-python/trunk

« back to all changes in this revision

Viewing changes to authres/tests

  • Committer: Scott Kitterman
  • Date: 2018-10-30 03:44:32 UTC
  • Revision ID: scott@kitterman.com-20181030034432-mtoe0qvj31wavzjf
Tags: 1.1.1
--- 1.1.1 2018-10-30
  + Added ARC specific tags for draft-ietf-dmarc-arc-protocol-18 (as of IETF
    last call, still experimental), smtp.remote-ip and header.oldest-pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
549
549
... results = [mfrom_pass, helo_none]))
550
550
'Authentication-Results: example.com; spf=pass smtp.mailfrom=authenticated@example.net; spf=none reason="No SPF record for HELO" smtp.helo=mailserver.example.net'
551
551
 
552
 
# Create header field with ARC results (draft-ietf-dmarc-arc-protocol-05)
 
552
# Create header field with ARC results (draft-ietf-dmarc-arc-protocol-18)
553
553
>>> import authres
554
554
>>> import authres.arc
555
555
>>> arc_pass = authres.arc.ARCAuthenticationResult(result = 'pass',
556
 
... header_ams_d = 'example.net', header_ams_s='valimail2016', header_as_d="example.com", header_as_s="valimail2017")
 
556
... header_ams_d = 'example.net', header_ams_s='valimail2016', header_as_d="example.com", header_as_s="valimail2017", header_oldest_pass='1', smtp_remote_ip='203.0.113.1')
557
557
>>> str(authres.AuthenticationResultsHeader(authserv_id = 'example.com',
558
558
... results = [arc_pass]))
559
 
'Authentication-Results: example.com; arc=pass header.ams-d=example.net header.ams-s=valimail2016 header.as-d=example.com header.as-s=valimail2017'
 
559
'Authentication-Results: example.com; arc=pass header.ams-d=example.net header.ams-s=valimail2016 header.as-d=example.com header.as-s=valimail2017 header.oldest-pass=1 smtp.remote-ip=203.0.113.1'
560
560
 
561
561
# Parsing IP6 address.
562
562
>>> arobj = authres_context.parse('Authentication-Results: mail.bmsi.com; iprev=pass policy.iprev="2001:748:100:40::2:2" (mout0.freenet.de); spf=none smtp.mailfrom=markuslaudi@freenet.de')