From: Frank Brehm Date: Thu, 11 Apr 2024 11:49:39 +0000 (+0200) Subject: Setting also the mailhost on picking up a mail X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=1ca7862974c3b184b42e9c7ebd8f0f84b1fe24d4;p=pixelpark%2Fpp-admin-tools.git Setting also the mailhost on picking up a mail --- diff --git a/lib/pp_admintools/handler/pflogparse.py b/lib/pp_admintools/handler/pflogparse.py index 70598e9..7f5d5a2 100644 --- a/lib/pp_admintools/handler/pflogparse.py +++ b/lib/pp_admintools/handler/pflogparse.py @@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__) _ = XLATOR.gettext ngettext = XLATOR.ngettext -__version__ = '0.5.3' +__version__ = '0.5.4' # ============================================================================= @@ -290,8 +290,8 @@ class PostfixLogfileParser(HandlingObject): # ------------------------------------------------------------------------- def eval_postfix_entry( - self, postfix_id, timestamp=None, host=None, command=None, pid=None, - message=None, smtpd_done=False): + self, postfix_id, timestamp=None, host=None, command=None, + pid=None, message=None, smtpd_done=False): """Evaluate a log line with a given Postfix-Id.""" # Eval Postfix entry from smtpd ... if command == 'postfix/smtpd' and pid: @@ -324,7 +324,7 @@ class PostfixLogfileParser(HandlingObject): return if command == 'postfix/pickup': - if self._eval_pickup(postfix_id, message, timestamp, pid): + if self._eval_pickup(host, postfix_id, message, timestamp, pid): return if command == 'opendkim': @@ -394,7 +394,7 @@ class PostfixLogfileParser(HandlingObject): return True # ------------------------------------------------------------------------- - def _eval_pickup(self, postfix_id, message, timestamp, pid): + def _eval_pickup(self, host, postfix_id, message, timestamp, pid): m = self.re_pickup.search(message) if not m: @@ -410,6 +410,7 @@ class PostfixLogfileParser(HandlingObject): smtpd_pid=pid, pickup_from=m['from'], pickup_uid=m['uid'], + mailhost=host, ) self.chain[postfix_id] = chain