diff options
author | Steve Dower <steve.dower@python.org> | 2019-06-24 15:42:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 15:42:54 (GMT) |
commit | 60419a7e96577cf783b3b45bf3984f9fb0d7ddff (patch) | |
tree | 2718cb915663c42902621491ba60accce6729d42 /Lib/smtplib.py | |
parent | 9bbf4d7083a819cbcee2a6cd3df2802d4c50f734 (diff) | |
download | cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.zip cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.gz cpython-60419a7e96577cf783b3b45bf3984f9fb0d7ddff.tar.bz2 |
bpo-37363: Add audit events for a range of modules (GH-14301)
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-x | Lib/smtplib.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 3c5ac75..01f3d43 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -335,6 +335,7 @@ class SMTP: port = self.default_port if self.debuglevel > 0: self._print_debug('connect:', (host, port)) + sys.audit("smtplib.SMTP.connect", self, host, port) self.sock = self._get_socket(host, port, self.timeout) self.file = None (code, msg) = self.getreply() @@ -352,6 +353,7 @@ class SMTP: # should not be used, but 'data' needs to convert the string to # binary itself anyway, so that's not a problem. s = s.encode(self.command_encoding) + sys.audit("smtplib.SMTP.send", self, s) try: self.sock.sendall(s) except OSError: |