Skip to content

Conversation

@fumiyas
Copy link

@fumiyas fumiyas commented Nov 14, 2025

Closes issue #33.

self = <test_authentication.TestAuthenticateMessage testMethod=test_authenticate_dmarc_prev_spf>

    def test_authenticate_dmarc_prev_spf(self):
        prev = "Authentication-Results: example.com; spf=pass smtp.mailfrom=gmail.com"
>       res = authenticate_message(self.message2, "example.com", prev=prev, spf=False, dkim=True, dmarc=True, dnsfunc=self.dnsfunc)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

authheaders/test/test_authentication.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
authheaders/__init__.py:434: in authenticate_message
    return str(auth_res)
           ^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:476: in __str__
    return ''.join((self.HEADER_FIELD_NAME, ': ', self.header_value()))
                                                  ^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:492: in header_value
    strs.append(str(result))
                ^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:222: in __str__
    strs.append(str(property_))
                ^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <authres.core.AuthenticationResultProperty object at 0x7fc4178465f0>

    def __str__(self):
        if self.comment:
            return '%s.%s=%s (%s)' % (self.type, self.name, self.value.quote_if_needed(), self.comment)
        else:
>           return '%s.%s=%s' % (self.type, self.name, self.value.quote_if_needed())
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
E           AttributeError: 'NoneType' object has no attribute 'quote_if_needed'

/usr/lib/python3/dist-packages/authres/core.py:132: AttributeError

Closes issue ValiMail#33.

```
self = <test_authentication.TestAuthenticateMessage testMethod=test_authenticate_dmarc_prev_spf>

    def test_authenticate_dmarc_prev_spf(self):
        prev = "Authentication-Results: example.com; spf=pass smtp.mailfrom=gmail.com"
>       res = authenticate_message(self.message2, "example.com", prev=prev, spf=False, dkim=True, dmarc=True, dnsfunc=self.dnsfunc)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

authheaders/test/test_authentication.py:155:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
authheaders/__init__.py:434: in authenticate_message
    return str(auth_res)
           ^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:476: in __str__
    return ''.join((self.HEADER_FIELD_NAME, ': ', self.header_value()))
                                                  ^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:492: in header_value
    strs.append(str(result))
                ^^^^^^^^^^^
/usr/lib/python3/dist-packages/authres/core.py:222: in __str__
    strs.append(str(property_))
                ^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <authres.core.AuthenticationResultProperty object at 0x7fc4178465f0>

    def __str__(self):
        if self.comment:
            return '%s.%s=%s (%s)' % (self.type, self.name, self.value.quote_if_needed(), self.comment)
        else:
>           return '%s.%s=%s' % (self.type, self.name, self.value.quote_if_needed())
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
E           AttributeError: 'NoneType' object has no attribute 'quote_if_needed'

/usr/lib/python3/dist-packages/authres/core.py:132: AttributeError
```
@fumiyas
Copy link
Author

fumiyas commented Nov 17, 2025

This pull request will likely also fix bug #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant