Authobject to use with CRAM-MD5 authentication. Requires self.user and self.password to be set.
(self, challenge=None)
| 669 | raise SMTPAuthenticationError(code, resp) |
| 670 | |
| 671 | def auth_cram_md5(self, challenge=None): |
| 672 | """ Authobject to use with CRAM-MD5 authentication. Requires self.user |
| 673 | and self.password to be set.""" |
| 674 | # CRAM-MD5 does not support initial-response. |
| 675 | if challenge is None: |
| 676 | return None |
| 677 | if not _have_cram_md5_support: |
| 678 | raise SMTPException("CRAM-MD5 is not supported") |
| 679 | password = self.password.encode('ascii') |
| 680 | authcode = hmac.HMAC(password, challenge, 'md5') |
| 681 | return f"{self.user} {authcode.hexdigest()}" |
| 682 | |
| 683 | def auth_plain(self, challenge=None): |
| 684 | """ Authobject to use with PLAIN authentication. Requires self.user and |
nothing calls this directly
no test coverage detected