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

« back to all changes in this revision

Viewing changes to authres/arc.py

  • Committer: Scott Kitterman
  • Date: 2016-12-11 05:52:42 UTC
  • Revision ID: scott@kitterman.com-20161211055242-molq08jlvoa07tj0
  + Add support for RFC 7601 use of SMTP auth with the mailfrom property

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# coding: utf-8
2
 
 
3
 
# Copyright © 2017 Gene Shuman <gene@valimail.com>,
4
 
# Copyright © 2012-2013 Scott Kitterman <scott@kitterman.com>
5
 
#
6
 
# Licensed under the Apache License, Version 2.0 (the "License");
7
 
# you may not use this file except in compliance with the License.
8
 
# You may obtain a copy of the License at
9
 
#
10
 
#  http://www.apache.org/licenses/LICENSE-2.0
11
 
#
12
 
# Unless required by applicable law or agreed to in writing, software
13
 
# distributed under the License is distributed on an "AS IS" BASIS,
14
 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 
# See the License for the specific language governing permissions and
16
 
# limitations under the License.
17
 
 
18
 
"""
19
 
authres extension module for the Authenticated Recieved Chain (ARC)
20
 
(draft-ietf-dmarc-arc-protocol-05) authentication method.
21
 
"""
22
 
 
23
 
#MODULE = 'authres'
24
 
 
25
 
__author__  = 'Scott Kitterman, Gene Shuman'
26
 
__email__   = 'scott@kitterman.com, gene@valimail.com'
27
 
 
28
 
import authres.core
29
 
from authres.core import make_result_class_properties
30
 
 
31
 
class ARCAuthenticationResult(authres.core.AuthenticationResult):
32
 
    """
33
 
    ARC (draft-ietf-dmarc-arc-protocol-05) result clause of an
34
 
    ``Authentication-Results`` header
35
 
    Note: Still under development API subject to change."""
36
 
 
37
 
    METHOD = 'arc'
38
 
 
39
 
    def __init__(self, version = None,
40
 
        result               = None,  result_comment               = None,
41
 
        reason               = None,  reason_comment               = None,
42
 
        properties = None,
43
 
        header_ams_d                = None,  header_ams_d_comment                = None,
44
 
        header_ams_s                = None,  header_ams_s_comment                = None,
45
 
        header_as_d                 = None,  header_as_d_comment                 = None,
46
 
        header_as_s                 = None,  header_as_s_comment                 = None,
47
 
    ):
48
 
        authres.core.AuthenticationResult.__init__(self, self.METHOD, version,
49
 
            result, result_comment, reason, reason_comment, properties)
50
 
        if header_ams_d:                        self.header_ams_d                    = header_ams_d
51
 
        if header_ams_d_comment:                self.header_ams_d_comment            = header_ams_d_comment
52
 
        if header_ams_s:                        self.header_ams_s                    = header_ams_s
53
 
        if header_ams_s_comment:                self.header_ams_s_comment            = header_ams_s_comment
54
 
        if header_as_d:                         self.header_as_d                     = header_as_d
55
 
        if header_as_d_comment:                 self.header_as_d_comment             = header_as_d_comment
56
 
        if header_as_s:                         self.header_as_s                     = header_as_s
57
 
        if header_as_s_comment:                 self.header_as_s_comment             = header_as_s_comment
58
 
 
59
 
    header_ams_d,             header_ams_d_comment             = make_result_class_properties('header', 'ams-d')
60
 
    header_ams_s,             header_ams_s_comment             = make_result_class_properties('header', 'ams-s')
61
 
    header_as_d,              header_ams_d_comment             = make_result_class_properties('header', 'as-d')
62
 
    header_as_s,              header_ams_s_comment             = make_result_class_properties('header', 'as-s')
63
 
 
64
 
RESULT_CLASSES = [
65
 
    ARCAuthenticationResult
66
 
]
67
 
 
68
 
# vim:sw=4 sts=4