all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable
@ 2026-06-08 11:29 Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-api 1/4] config: add log-tracker-base key Stoiko Ivanov
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 11:29 UTC (permalink / raw)
  To: pmg-devel

The recently added input-base parameter for pmg-log-tracker:
9816d19 ("fix #3657: allow scanning a configurable rotated log series")

can be used to change the default location the tracking center uses for
its logs - but setting it in pmg.conf user can directly benefit from that
instead of manually patching MailTracker.pm, or wrapping pmg-log-tracker
in a script that changes the input file/input-base.

tested by setting the parameter via gui, navigating to the tracking
center, and watching execsnopp-bpfcc for the commands which are executed.

pmg-api:

Stoiko Ivanov (2):
  config: add log-tracker-base key
  fix #3657: api: tracking center: explicitly set input base from config

 src/PMG/API2/MailTracker.pm | 5 +++++
 src/PMG/Config.pm           | 7 +++++++
 2 files changed, 12 insertions(+)


pmg-gui:

Stoiko Ivanov (1):
  fix #2091: system options: add log-tracker-base textrow

 js/SystemOptions.js | 6 ++++++
 1 file changed, 6 insertions(+)


pmg-docs:

Stoiko Ivanov (1):
  pmg-log-tracker: mention that input-base can be configured via GUI

 pmg-log-tracker.adoc | 3 +++
 1 file changed, 3 insertions(+)


Summary over all repositories:
  4 files changed, 21 insertions(+), 0 deletions(-)

-- 
Generated by murpp 0.12.0




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH pmg-api 1/4] config: add log-tracker-base key
  2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
@ 2026-06-08 11:29 ` Stoiko Ivanov
  2026-06-08 22:37   ` Thomas Lamprecht
  2026-06-08 11:29 ` [PATCH pmg-api 2/4] fix #3657: api: tracking center: explicitly set input base from config Stoiko Ivanov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 11:29 UTC (permalink / raw)
  To: pmg-devel

makes it possible to override the input-base parameter for
pmg-log-tracker - functionality there was added in:
9816d19 ("fix #3657: allow scanning a configurable rotated log series")

the pattern allows for a input-base with a maximal depth of 6
directories, which should cover all needs.

the default in the config is /var/log/syslog and will be explicitly
provided to pmg-log-tracker if nothing is set in pmg.conf

exposing the option in pmg.conf enables users to use a different
log location for the daily work.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/Config.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index a2ddbb3a..6322774e 100644
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -155,6 +155,12 @@ EODESC
             pattern => '^\p{PosixPrint}{1,998}$',
             default => 'Proxmox Mail Gateway <postmaster>',
         },
+        'log-tracker-base' => {
+            description => "Location of rotated mail logs, input-base argument for pmg-log-tracker",
+            type => 'string',
+            pattern => '^/([^/\0]+\/){0,6}[^/\0]+$',
+            default => '/var/log/syslog',
+        },
     };
 }
 
@@ -175,6 +181,7 @@ sub options {
         dkim_selector => { optional => 1 },
         'dkim-use-domain' => { optional => 1 },
         'admin-mail-from' => { optional => 1 },
+        'log-tracker-base' => { optional => 1 },
     };
 }
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH pmg-api 2/4] fix #3657: api: tracking center: explicitly set input base from config
  2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-api 1/4] config: add log-tracker-base key Stoiko Ivanov
@ 2026-06-08 11:29 ` Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-gui 3/4] fix #2091: system options: add log-tracker-base textrow Stoiko Ivanov
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 11:29 UTC (permalink / raw)
  To: pmg-devel

makes it possible to override the location of logs which are scanned
by pmg-log-tracker.
This should enable admins, to either point the log-tracker to another
location on disk where e.g. a rsyslog daemon combines the logs of
multiple instances, or to only log the mail-facility somewhere and
drop /var/log/syslog logging in favor of journalling.

pmg-log-tracker still uses syslog-files over the journal, as this was
far more performant when we last compared log-file reading to reading
from the journal.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 src/PMG/API2/MailTracker.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PMG/API2/MailTracker.pm b/src/PMG/API2/MailTracker.pm
index 1cc93ef2..5c175300 100644
--- a/src/PMG/API2/MailTracker.pm
+++ b/src/PMG/API2/MailTracker.pm
@@ -41,6 +41,11 @@ my $statmap = {
 my $run_pmg_log_tracker = sub {
     my ($args, $includelog) = @_;
 
+    my $pmg_cfg = PMG::Config->new();
+    my $input_base = $pmg_cfg->get('admin', 'log-tracker-base');
+
+    push @$args, '--input-base', $input_base;
+
     my $logids = {};
 
     if (defined(my $id = $includelog)) {
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH pmg-gui 3/4] fix #2091: system options: add log-tracker-base textrow
  2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-api 1/4] config: add log-tracker-base key Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-api 2/4] fix #3657: api: tracking center: explicitly set input base from config Stoiko Ivanov
@ 2026-06-08 11:29 ` Stoiko Ivanov
  2026-06-08 11:29 ` [PATCH pmg-docs 4/4] pmg-log-tracker: mention that input-base can be configured via GUI Stoiko Ivanov
  2026-06-10  9:25 ` superseded: [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
  4 siblings, 0 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 11:29 UTC (permalink / raw)
  To: pmg-devel

the system options panel seems like the best place to set the location
of the logs.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 js/SystemOptions.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/js/SystemOptions.js b/js/SystemOptions.js
index 517eb71..998dbc7 100644
--- a/js/SystemOptions.js
+++ b/js/SystemOptions.js
@@ -91,6 +91,12 @@ Ext.define('PMG.SystemOptions', {
             renderer: Ext.htmlEncode,
         });
 
+        me.add_text_row('log-tracker-base', gettext("Maillog base name"), {
+            deleteEmpty: true,
+            defaultValue: '/var/log/syslog',
+            renderer: Ext.htmlEncode,
+        });
+
         me.add_proxy_row('http_proxy', gettext('HTTP proxy'));
 
         me.callParent();
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH pmg-docs 4/4] pmg-log-tracker: mention that input-base can be configured via GUI
  2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
                   ` (2 preceding siblings ...)
  2026-06-08 11:29 ` [PATCH pmg-gui 3/4] fix #2091: system options: add log-tracker-base textrow Stoiko Ivanov
@ 2026-06-08 11:29 ` Stoiko Ivanov
  2026-06-10  9:25 ` superseded: [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
  4 siblings, 0 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-08 11:29 UTC (permalink / raw)
  To: pmg-devel

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 pmg-log-tracker.adoc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pmg-log-tracker.adoc b/pmg-log-tracker.adoc
index 60cc6b9..ba182ed 100644
--- a/pmg-log-tracker.adoc
+++ b/pmg-log-tracker.adoc
@@ -22,6 +22,9 @@ Prefer this over `-i` when the system logs mail events to a dedicated file and
 you want to cover rotated logs as well. Compression is detected per file, so
 custom logrotate compression settings are handled.
 
+You can set the `--input-base` parameter used for the Tracking Center at
+__Configuration -> Options -> Maillog base name__.
+
 Start time `-s` and end time `-e` are optional. By default the end time will be
 the current time and the start time will be 0:00 of the current day.
 
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH pmg-api 1/4] config: add log-tracker-base key
  2026-06-08 11:29 ` [PATCH pmg-api 1/4] config: add log-tracker-base key Stoiko Ivanov
@ 2026-06-08 22:37   ` Thomas Lamprecht
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Lamprecht @ 2026-06-08 22:37 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

On 08/06/2026 13:29, Stoiko Ivanov wrote:
> makes it possible to override the input-base parameter for
> pmg-log-tracker - functionality there was added in:
> 9816d19 ("fix #3657: allow scanning a configurable rotated log series")
> 
> the pattern allows for a input-base with a maximal depth of 6
> directories, which should cover all needs.
> 
> the default in the config is /var/log/syslog and will be explicitly
> provided to pmg-log-tracker if nothing is set in pmg.conf
> 
> exposing the option in pmg.conf enables users to use a different
> log location for the daily work.

might be OK, but should be probably root-only to a void leaking
system info indirectly?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* superseded: [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable
  2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
                   ` (3 preceding siblings ...)
  2026-06-08 11:29 ` [PATCH pmg-docs 4/4] pmg-log-tracker: mention that input-base can be configured via GUI Stoiko Ivanov
@ 2026-06-10  9:25 ` Stoiko Ivanov
  4 siblings, 0 replies; 7+ messages in thread
From: Stoiko Ivanov @ 2026-06-10  9:25 UTC (permalink / raw)
  To: pmg-devel


by
https://lore.proxmox.com/pmg-devel/20260609200637.904334-1-s.ivanov@proxmox.com/T/#t

On Mon,  8 Jun 2026 13:29:38 +0200
Stoiko Ivanov <s.ivanov@proxmox.com> wrote:

> The recently added input-base parameter for pmg-log-tracker:
> 9816d19 ("fix #3657: allow scanning a configurable rotated log series")
> 
> can be used to change the default location the tracking center uses for
> its logs - but setting it in pmg.conf user can directly benefit from that
> instead of manually patching MailTracker.pm, or wrapping pmg-log-tracker
> in a script that changes the input file/input-base.
> 
> tested by setting the parameter via gui, navigating to the tracking
> center, and watching execsnopp-bpfcc for the commands which are executed.
> 
> pmg-api:
> 
> Stoiko Ivanov (2):
>   config: add log-tracker-base key
>   fix #3657: api: tracking center: explicitly set input base from config
> 
>  src/PMG/API2/MailTracker.pm | 5 +++++
>  src/PMG/Config.pm           | 7 +++++++
>  2 files changed, 12 insertions(+)
> 
> 
> pmg-gui:
> 
> Stoiko Ivanov (1):
>   fix #2091: system options: add log-tracker-base textrow
> 
>  js/SystemOptions.js | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> 
> pmg-docs:
> 
> Stoiko Ivanov (1):
>   pmg-log-tracker: mention that input-base can be configured via GUI
> 
>  pmg-log-tracker.adoc | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 
> Summary over all repositories:
>   4 files changed, 21 insertions(+), 0 deletions(-)
> 





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-10  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-08 11:29 [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov
2026-06-08 11:29 ` [PATCH pmg-api 1/4] config: add log-tracker-base key Stoiko Ivanov
2026-06-08 22:37   ` Thomas Lamprecht
2026-06-08 11:29 ` [PATCH pmg-api 2/4] fix #3657: api: tracking center: explicitly set input base from config Stoiko Ivanov
2026-06-08 11:29 ` [PATCH pmg-gui 3/4] fix #2091: system options: add log-tracker-base textrow Stoiko Ivanov
2026-06-08 11:29 ` [PATCH pmg-docs 4/4] pmg-log-tracker: mention that input-base can be configured via GUI Stoiko Ivanov
2026-06-10  9:25 ` superseded: [PATCH pmg-api/pmg-docs/pmg-gui 0/4] tracking-center: make input-base configurable Stoiko Ivanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal