_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.4.2'
+__version__ = '0.5.0'
LOG = logging.getLogger(__name__)
"""Copy the current data pair into a new object."""
return self.__class__(self.value, total=self.total)
+
# =============================================================================
class PostfixLogchainInfo(FbGenericBaseObject):
"""A class for encapsulating the information from a chain of Postfix log entries."""
def __init__(
self, client_host=None, client_addr=None, start=None, end=None, message_id=None,
postfix_id=None, ehlo=None, starttls=None, sent_quit=None, auth=None, commands=None,
- rcpt=None, data=None, mail=None, from_address=None, to_address=None, smtpd_pid=None):
+ rcpt=None, data=None, mail=None, from_address=None, to_address=None, smtpd_pid=None,
+ mailhost=None):
"""Initialize this object."""
self._auth = None
self._client_addr = None
self._start = None
self._starttls = None
self._to_address = None
+ self._mailhost = None
self.auth = auth
self.client_addr = client_addr
self.from_address = from_address
self.message_id = message_id
self.mail = mail
+ self.mailhost = mailhost
self.postfix_id = postfix_id
self.rcpt = rcpt
self.sent_quit = sent_quit
else:
self._mail = DataPair.from_str(val)
+ # -----------------------------------------------------------
+ @property
+ def mailhost(self):
+ """Return the name of the mailhost, from where this logchain is originating."""
+ return self._mailhost
+
+ @mailhost.setter
+ def mailhost(self, value):
+ if value is None:
+ self._mailhost = None
+ return
+
+ val = str(value).strip()
+ if val == '':
+ self._mailhost = None
+ return
+ self._mailhost = val
+
# -----------------------------------------------------------
@property
def message_id(self):
atribs = (
'client_host', 'client_addr', 'start', 'end', 'message_id', 'postfix_id', 'ehlo',
'starttls', 'sent_quit', 'auth', 'commands', 'rcpt', 'data', 'mail', 'from_address',
- 'to_address', 'smtpd_pid')
+ 'to_address', 'smtpd_pid', 'mailhost')
for attrib in atribs:
if not hasattr(self, attrib):
continue