_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.4.0'
+__version__ = '0.4.1'
LOG = logging.getLogger(__name__)
self.auth = auth
self.client_addr = client_addr
self.client_host = client_host
+ self.commands = commands
self.ehlo = ehlo
self.end = end
self.message_id = message_id
self.postfix_id = postfix_id
+ self.rcpt = rcpt
self.sent_quit = sent_quit
self.start = start
self.starttls = starttls
return
self._client_host = val
+ # -----------------------------------------------------------
+ @property
+ def commands(self):
+ """Return statistics about the commands in SMTP dialogue."""
+ return self._commands
+
+ @commands.setter
+ def commands(self, value):
+ if value is None:
+ self._commands = None
+ return
+
+ if isinstance(value, int):
+ self._commands = DataPair(value)
+ return
+ if isinstance(value, DataPair):
+ self._commands = copy.copy(value)
+ return
+ val = str(value).strip()
+ if val == '':
+ self._commands = None
+ return
+ else:
+ self._commands = DataPair.from_str(val)
+
# -----------------------------------------------------------
@property
def duration(self):
return
self._postfix_id = val
+ # -----------------------------------------------------------
+ @property
+ def rcpt(self):
+ """Return statistics about recipients in SMTP dialogue."""
+ return self._rcpt
+
+ @rcpt.setter
+ def rcpt(self, value):
+ if value is None:
+ self._rcpt = None
+ return
+
+ if isinstance(value, int):
+ self._rcpt = DataPair(value)
+ return
+ if isinstance(value, DataPair):
+ self._rcpt = copy.copy(value)
+ return
+ val = str(value).strip()
+ if val == '':
+ self._rcpt = None
+ return
+ else:
+ self._rcpt = DataPair.from_str(val)
+
# -----------------------------------------------------------
@property
def sent_quit(self):
fields.append('sent_quit={!r}'.format(str(self.sent_quit)))
if self.auth is not None:
fields.append('auth={!r}'.format(str(self.auth)))
+ if self.commands is not None:
+ fields.append('commands={!r}'.format(str(self.commands)))
+ if self.rcpt is not None:
+ fields.append('rcpt={!r}'.format(str(self.rcpt)))
if fields:
out += ', '.join(fields)
res['auth'] = self.auth
res['client_addr'] = self.client_addr
res['client_host'] = self.client_host
+ res['commands'] = self.commands
res['duration'] = self.duration
res['ehlo'] = self.ehlo
res['end'] = self.end
res['message_id'] = self.message_id
res['postfix_id'] = self.postfix_id
+ res['rcpt'] = self.rcpt
res['sent_quit'] = self.sent_quit
res['start'] = self.start
res['starttls'] = self.starttls