# -*- coding: utf-8 -*-
"""
-@summary: A class for encapsulating the information from a chain of Postfix log entries
+@summary: A class for encapsulating the information from a chain of Postfix log entries.
@author: Frank Brehm
@contact: frank.brehm@pixelpark.com
import re
# Third party modules
-from
from fb_tools.obj import FbGenericBaseObject
__version__ = '0.1.0'
class PostfixLogchainInfo(FbGenericBaseObject):
"""A class for encapsulating the information from a chain of Postfix log entries."""
+ pattern_isodate = r'(?P<year>\d{4})-?(?P<month>[01]\d)-?(?P<day>[0-3]\d)'
+ pattern_isotime = (
+ r'(?P<hour>[0-2]\d):?(?P<min>[0-5]\d)(?::?(?P<sec>[0-5]\d)(\.(?P<nsec>\d+))?)?')
+ pattern_isotimezone = r'((?P<utc>Z)|(?P<tz_hours>[+-][01]\d)(?::?(?P<tz_mins>[0-5]\d))?)?'
+
+ re_isodatetime = re.compile(
+ pattern_isodate + r'[T\s]' + pattern_isotime + pattern_isotimezone)
+
# -------------------------------------------------------------------------
def __init__(
- self, client_host=None, client_addr=None, start=None, end=None, message_id=None, postfix_pid=None,
- ehlo=None, starttls=None, quit=None, auth=None, commands=None, rcpt=None, data=None,
- mail=None, from_address=None, to_address=None):
+ self, client_host=None, client_addr=None, start=None, end=None, message_id=None,
+ postfix_pid=None, ehlo=None, starttls=None, sent_quit=None, auth=None, commands=None,
+ rcpt=None, data=None, mail=None, from_address=None, to_address=None):
"""Initialize this object."""
self._auth = None
self._client_addr = None
self._mail = None
self._message_id = None
self._postfix_pid = None
- self._quit = None
self._rcpt = None
+ self._sent_quit = None
self._start = None
self._starttls = None
self._to_address = None
if value is None:
self._auth = None
return
-
+
val = str(value).strip()
if val == '':
self._auth = None
else:
self._auth = val
-
# -------------------------------------------------------------------------
def __repr__(self):
"""Typecast into a string for reproduction."""
return res
-
# =============================================================================
if __name__ == '__main__':
# =============================================================================
-# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list