from ..handler.pflogparse import PostfixLogfileParser
from ..xlate import XLATOR
-__version__ = '0.3.0'
+__version__ = '0.3.1'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
# -------------------------------------------------------------------------
def __init__(self, appname=None, base_dir=None):
"""Initialize the SetLdapPasswordApplication object."""
+ PostfixLogfileParser.warn_on_parse_error = False
self.pflogparser = PostfixLogfileParser(
appname=appname, base_dir=base_dir, initialized=True)
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.6.0'
+__version__ = '0.6.1'
# =============================================================================
re_pickup = re.compile(r'uid=(?P<uid>\d+)\s+from=<(?P<from>[^>]*)>', re.IGNORECASE)
- warn_on_parse_error = True
+ warn_on_parse_error = False
deliver_commands = (
'postfix/discard', 'postfix/error', 'postfix/local',
terminal_has_colors=terminal_has_colors, initialized=False,
)
- if not self.warn_on_parse_error:
- DeliverAction.warn_on_parse_error = False
- PostfixLogchainInfo.warn_on_parse_error = False
+ if self.warn_on_parse_error:
+ DeliverAction.warn_on_parse_error = True
+ PostfixLogchainInfo.warn_on_parse_error = True
self.reset(no_warnings=True)
LOG.debug(_('Reading file {!r} as an uncompressed file.').format(str(logfile)))
fh = logfile.open('rt', **self.open_args)
-# self,parse(fh)
+ self.parse(fh)
finally:
if fh:
self, command, postfix_id, timestamp=None, host=None, pid=None, message=None):
"""Evaluate a postfix/smtp action log line."""
if postfix_id not in self.chain:
- msg = _('Postfix transaction {!r} does not exists.').format(postfix_id)
- if self.warn_on_parse_error:
+ msg = _('Postfix transaction {!r} for delivering does not exists.').format(postfix_id)
+ if self.warn_on_parse_error or self.verbose > 1:
LOG.warn(msg)
- else:
- LOG.debug(msg)
return
action = DeliverAction.from_log_entry(
msg = _('Did not found Postfix ID {pfid!r} for Message Id {mid!r}.').format(
pfid=postfix_id, mid=m[1])
- if self.warn_on_parse_error:
+ if self.warn_on_parse_error or self.verbose > 1:
LOG.warn(msg)
- else:
- LOG.debug(msg)
return True
msg = _('Did not found Postfix ID {pfid!r} for OpenDKIM log entry.').format(
pfid=postfix_id)
- if self.warn_on_parse_error:
+ if self.warn_on_parse_error or self.verbose > 1:
LOG.warn(msg)
- else:
- LOG.debug(msg)
return True
msg = _('Did not found Postfix ID {pfid!r} for Bounce ID {bid!r}.').format(
pfid=postfix_id, bid=bid)
- if self.warn_on_parse_error:
+ if self.warn_on_parse_error or self.verbose > 1:
LOG.warn(msg)
- else:
- LOG.debug(msg)
return True
_ = XLATOR.gettext
ngettext = XLATOR.ngettext
-__version__ = '0.8.2'
+__version__ = '0.8.3'
LOG = logging.getLogger(__name__)
class DeliverAction(FbGenericBaseObject):
"""A class encapsulating the logged action of a Postix deliverer."""
- warn_on_parse_error = True
+ warn_on_parse_error = False
attributes = (
'command', 'to_address', 'origin_to', 'pid', 'date', 'relay', 'delay_total',
class PostfixLogchainInfo(FbGenericBaseObject):
"""A class for encapsulating the information from a chain of Postfix log entries."""
- warn_on_parse_error = True
+ warn_on_parse_error = False
attributes = (
'client_host', 'client_addr', 'start', 'end', 'message_id', 'postfix_id', 'ehlo',