]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Setting also the mailhost on picking up a mail
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 Apr 2024 11:49:39 +0000 (13:49 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 11 Apr 2024 11:49:39 +0000 (13:49 +0200)
lib/pp_admintools/handler/pflogparse.py

index 70598e97e2262be9c4c4679c7a2be7a718b46ea5..7f5d5a266f70ed235915bb1b4f8db785881ea557 100644 (file)
@@ -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