]> git.proxmox.com Git - pmg-api.git/log
pmg-api.git
2 months agoconfig: improve variable names in max_filters getter
Thomas Lamprecht [Wed, 21 Feb 2024 14:09:42 +0000 (15:09 +0100)]
config: improve variable names in max_filters getter

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agosmtp-filter: log pre-fork worker settings on start up
Thomas Lamprecht [Wed, 21 Feb 2024 14:03:23 +0000 (15:03 +0100)]
smtp-filter: log pre-fork worker settings on start up

The used pre-fork worker setting can be nice to have for debugging
reasons, so output them on start up.

Just print to stdout, in testmode this becomes visible on the console
and in production mode systemd will route it to the journal.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofilter: skip warning about max_filters on low-memory if manually set
Thomas Lamprecht [Wed, 21 Feb 2024 14:00:05 +0000 (15:00 +0100)]
filter: skip warning about max_filters on low-memory if manually set

The get_max_filters method gets called on module load to fill the
default value used, at that stage we cannot know if the admin set
max_filters manually or not, so the warning might be bogus and thus
annoying.

Move it over to the smtp-filter executable's startup code, as there we
can check the config if it's max_filters is set or not.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoconfig: adjust max_filters calculation to reflect current memory usage
Markus Frank [Thu, 18 Jan 2024 14:55:32 +0000 (15:55 +0100)]
config: adjust max_filters calculation to reflect current memory usage

Change max_filters calculation for systems with recommended memory
setup (>4GB).

The values of 2816 and 150 are based on testing with 4GB, 6GB & 8GB
memory configurations, large and small numbers of added objects and
sending multiple mails simultaneously.

On setups with less memory, it is difficult to completely prevent OOM kills.
So for these setups the calculation remains similar, but a warning is sent.

Related OOM killer problem found in forum:
https://forum.proxmox.com/threads/123531/

Signed-off-by: Markus Frank <m.frank@proxmox.com>
2 months agoRuleCache: reorganize to keep group structure
Dominik Csapak [Fri, 9 Feb 2024 12:54:26 +0000 (13:54 +0100)]
RuleCache: reorganize to keep group structure

Currently we 'or' combine all objects of a type (from/to/what/when)
regardless of group, so we only keep a single list of all objects.

Since we want to introduce different logic (and/invert) we want to keep
the configured group structure. This patch does this, without changing
the current matching logic (still all 'or'-ed).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[S.I.: fix 2 typos in commit-message]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agoRuleCache: remove unnecessary copying of marks
Dominik Csapak [Fri, 9 Feb 2024 12:54:25 +0000 (13:54 +0100)]
RuleCache: remove unnecessary copying of marks

two things that are wrong here
* what_match_targets never returns a non empty list
* we copy the list just returned just to append it to itself again

My guess is that we meant to copy the original list, not the just
acquired one, and append it to the one just received. But that never did
make a difference, since we only ever check for defined-ness on that
exact list, and the only Object that this applies to (Spam) always
returns an empty list with the spaminfo (so it's always defined in that
case).

Since this was always the behavior AFAICT, just remove the unnecessary
copy of the list for now. If we encounter any actual bugs with that, we
can still implement it back in the right way (copy the original list).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoreport: Add /etc/pmg/dkim/domains
Maximiliano Sandoval [Wed, 27 Dec 2023 09:09:18 +0000 (10:09 +0100)]
report: Add /etc/pmg/dkim/domains

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agofix #4811: rule db: test regex validity on save
Dominik Csapak [Thu, 21 Dec 2023 12:05:08 +0000 (13:05 +0100)]
fix #4811: rule db: test regex validity on save

and warn only when it's an invalid regex on execution, because users may
have previously had such rules. Otherwise, pmg-smtp-filter will restart
every time it encounters such a rule.

When testing, 'die' if the regex execution 'warns', so that users cannot
enter a semi-invalid or very wrong regex like '^*foo$'.

do so for every rule type that uses a regex to match

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[S.I.: add short comment in test_regex sub ]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2 months agofix #4818: utils: Don't set minLength for username
Maximiliano Sandoval [Tue, 5 Sep 2023 12:54:43 +0000 (14:54 +0200)]
fix #4818: utils: Don't set minLength for username

This matches pve-access-control/src/PVE/Auth/Plugin.pm.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
3 months agoruledb disclaimer: if/elsif code cleanup
Dominik Csapak [Tue, 9 Jan 2024 13:59:02 +0000 (14:59 +0100)]
ruledb disclaimer: if/elsif code cleanup

by pulling out the text/{html,plain} regex directly in the elsif
condition, since the else there does not do anything

the comment now goes into the top-level else part, but the idea is the
same

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 months agoruledb disclaimer: cleanup trailing whitespace
Dominik Csapak [Tue, 9 Jan 2024 13:59:01 +0000 (14:59 +0100)]
ruledb disclaimer: cleanup trailing whitespace

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agobump version to 8.0.11
Wolfgang Bumiller [Tue, 2 Jan 2024 11:53:54 +0000 (12:53 +0100)]
bump version to 8.0.11

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agotemplates: postfix: fix master.cf.in syntax error
Stoiko Ivanov [Tue, 2 Jan 2024 11:27:00 +0000 (12:27 +0100)]
templates: postfix: fix master.cf.in syntax error

the whitespace for postfix parameters is only allowed in main.cf.in,
not when specifying options as cli-arguments to processes in
master.cf.in

Noticed while rolling out the change on a system which gets more
traffic on the internal port.

Fixes: 4f3c6d958b1711cbf1423f6ee00abb6a5dff59bb
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agobump version to 8.0.10
Wolfgang Bumiller [Tue, 2 Jan 2024 10:52:12 +0000 (11:52 +0100)]
bump version to 8.0.10

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agotemplates: postfix: forbid_bare_newline on external port
Stoiko Ivanov [Tue, 2 Jan 2024 10:30:39 +0000 (11:30 +0100)]
templates: postfix: forbid_bare_newline on external port

This patch addresses the smtp-smuggling vulnerability [0,1], with the
recommended fix by postfix upstream [2].

Disallowing bare linefeeds instead of crlf should not be a problem
with any standards-compliant MTA.
The internal port allows bare linefeed, since internal clients
(mail-scripts written ages ago, some ancient embedded systems) might
not adhere to the protocol. Additionally the mail-proxy allowlist (the
ip and cidr entries, are the only ones applicable here) is also added
to the global exceptions.

Currently the updated postfix-packages are not published in the
security repositories but only as stable updates [3,4]
However postfix ignores unknown configuration parameters and only
prints a warning to the journal - so the changes to the templates can
already be shipped, for those users who have the stable-updates mirror
enabled.

Tested with the current postfix in bookworm, then updating to the one
in bookworm-updates and running tests with netcat (verified with nc -C
that it still works with the correct line-termination):
```
$ nc -6  pmgtest 25
220 pmgtest.proxmox.com ESMTP Proxmox
EHLO pmgsender.proxmox.com
521 5.5.2 pmgtest.proxmox.com Error: bare <LF> received
```

[0] https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/
[1] https://nvd.nist.gov/vuln/detail/CVE-2023-51764
[2] https://www.postfix.org/smtp-smuggling.html
[3] https://security-tracker.debian.org/tracker/CVE-2023-51764
[4] https://lists.debian.org/debian-stable-announce/2023/12/msg00004.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agobump version to 8.0.9
Fabian Grünbichler [Fri, 22 Dec 2023 10:18:15 +0000 (11:18 +0100)]
bump version to 8.0.9

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agotemplates: postfix: mitigate smtpsmuggling vulnerability
Stoiko Ivanov [Fri, 22 Dec 2023 09:57:26 +0000 (10:57 +0100)]
templates: postfix: mitigate smtpsmuggling vulnerability

by disabling pipelining on the external port.
The fix in the postfix config for the smtp-smuggling vulnerability [0]
follows the current recommendation of postfix upstream [1].

by using `smtpd_data_restrictions` instead of the newer
`smtpd_forbid_unauth_pipelining` the fix works for both PMG 7 and 8.

Tested with a handcrafted smtp-smuggling-session and verifying that:
* without the fix I get 2 mails
* with the fix I get 1 mail when sending to the external port, but
  still 2 mails when sending to the internal port

[0] https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/
[1] https://www.postfix.org/smtp-smuggling.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agobump version to 8.0.8
Fabian Grünbichler [Wed, 20 Dec 2023 09:58:58 +0000 (10:58 +0100)]
bump version to 8.0.8

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agopmg7to8: check for proper grub meta-package for bootmode
Stoiko Ivanov [Fri, 15 Dec 2023 18:08:16 +0000 (19:08 +0100)]
pmg7to8: check for proper grub meta-package for bootmode

This should catch installations from our ISO on non-ZFS in uefi mode,
which won't get the updated grub efi binary installed upon upgrade,
because grub-pc is installed instead of grub-efi-amd64.

follows commit 67c655b9333714f31d5115de80961a2abc4b6506 in pve-manager

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agopmg7to8: Add check for dkms modules
Stoiko Ivanov [Fri, 15 Dec 2023 17:34:12 +0000 (18:34 +0100)]
pmg7to8: Add check for dkms modules

... and warn if at least one is present and PMG is running not running
in a container.

follows commit 0329876ccf1d78b848897718bb0c2337c6a55fbb in pve-manager

with the change that the dkms check is skipped if
proxmox-mailgateway-container is the installed meta-package (as we do
for the kernel checks).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agoapi: quarantine: include descriptions for KAM rules in the spaminfo
Dominik Csapak [Fri, 14 Apr 2023 11:06:38 +0000 (13:06 +0200)]
api: quarantine: include descriptions for KAM rules in the spaminfo

so that the KAM rules also get a description instead of '-'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 months agobump pmg-rs dep to 0.7.5
Wolfgang Bumiller [Thu, 7 Dec 2023 12:49:30 +0000 (13:49 +0100)]
bump pmg-rs dep to 0.7.5

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump pmg-rs dep to 0.7.4
Wolfgang Bumiller [Wed, 6 Dec 2023 11:42:21 +0000 (12:42 +0100)]
bump pmg-rs dep to 0.7.4

for ACME EAB support and openssl-probe env var fixup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agocli: acme: expose acme eab options on the cli
Folke Gleumes [Tue, 14 Nov 2023 14:14:08 +0000 (15:14 +0100)]
cli: acme: expose acme eab options on the cli

interactively ask for external account binding credentials if either:
* the ca requests it
* a custom ca is used

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoapi: acme: deprecate tos endpoint in favor of new meta endpoint
Folke Gleumes [Tue, 14 Nov 2023 14:14:07 +0000 (15:14 +0100)]
api: acme: deprecate tos endpoint in favor of new meta endpoint

The ToS endpoint ignored data that is needed to detect if EAB needs to
be used. Instead of adding a new endpoint that does the same request,
the tos endpoint is deprecated and replaced by the meta endpoint,
that returns all information returned by the directory.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoapi: acme: add eab parameters
Folke Gleumes [Tue, 14 Nov 2023 14:14:06 +0000 (15:14 +0100)]
api: acme: add eab parameters

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
5 months agoapt: use `apt changelog` for changelog fetching
Fabian Grünbichler [Tue, 4 Jul 2023 09:45:04 +0000 (11:45 +0200)]
apt: use `apt changelog` for changelog fetching

support for it got added to Proxmox repositories, so there is no need to use
custom logic and manual fetching for this anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 months agoreduce the logging level of certain messages
Maximiliano Sandoval [Fri, 22 Sep 2023 09:58:32 +0000 (11:58 +0200)]
reduce the logging level of certain messages

The (re)started messages happen whenever the service is started. These
messages do not indicate any error.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
7 months agouser quarantine: use raw pmail for ticket assembly
Stoiko Ivanov [Wed, 13 Sep 2023 16:20:46 +0000 (18:20 +0200)]
user quarantine: use raw pmail for ticket assembly

Currently, the quarantine report does not work if the recipient has
some encodable characters in their local part - e.g.
'some&other@domain.example'

When clicking on the links on the report the user gets still logged
in, the ticket _is_ valid after all, however their quarantine list is
empty, as the API call to `/quarantine/spamusers` returns 403 due to
the (encoded) username from the ticket not matching the (by the API
decoded) one from the request quarantine.

With this patch the username, which is includes in the ticket,
remains 'some&other@domain.example' instead of the encoded
'some&amp;other@domain.example', thus the access check user
comparission work with the correct value again and the listing works
as expected

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
 [ TL: commit message additions and rewordings ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agoutils: check if file changed before reusing its hash
Maximiliano Sandoval [Thu, 31 Aug 2023 14:41:13 +0000 (16:41 +0200)]
utils: check if file changed before reusing its hash

We cache the hash of this file, it makes sense to first check if the
file changed via `stat` and recompute the hash if needed.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
7 months agofix #4944: api/pbs remote: Add a port config
Maximiliano Sandoval [Mon, 4 Sep 2023 13:54:37 +0000 (15:54 +0200)]
fix #4944: api/pbs remote: Add a port config

Allows to set a port via

    pmgbackup proxmox-backup remote set REMOTE --port PORT

The client perl-module is shared with Proxmox VE, where the required
bits for this to work are already implemented.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
9 months agobump version to 8.0.7
Fabian Grünbichler [Tue, 1 Aug 2023 09:55:46 +0000 (11:55 +0200)]
bump version to 8.0.7

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agohandle pve-kernel -> proxmox-kernel rename
Fabian Grünbichler [Tue, 18 Jul 2023 08:34:22 +0000 (10:34 +0200)]
handle pve-kernel -> proxmox-kernel rename

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agobump version to 8.0.6
Fabian Grünbichler [Tue, 25 Jul 2023 09:33:03 +0000 (11:33 +0200)]
bump version to 8.0.6

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agocluster: fingerprint parsing: adapt to changed openssl output
Stoiko Ivanov [Mon, 24 Jul 2023 11:06:24 +0000 (13:06 +0200)]
cluster: fingerprint parsing: adapt to changed openssl output

currently updating the fingerprints using `pmgcm update-fingerprints`
runs into an error indicating that parsing of the remote node's
fingerprint fails

The error is due to changed output in openssl's x509 command,
introduced in commit:
91034b68b39e3525f09fb263b9272de410a3ba4c
in openssl upstream [0]

Note that in that case it would equally work to change the parameter
from `-sha256` to `-SHA256` in the `openssl x509` command above

The change seems small enough to warrant pulling it into stable-7 as
well (although the issue should not occur in systems upgraded
according to our howtos).

[0] https://github.com/openssl/openssl/commit/91034b68b39e3525f09fb263b9272de410a3ba4c

Reported-by: Martin Maurer <martin@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Removed redundant A-F from regular expression.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agofixup changelog length
Thomas Lamprecht [Tue, 11 Jul 2023 15:54:04 +0000 (17:54 +0200)]
fixup changelog length

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.5
Thomas Lamprecht [Tue, 11 Jul 2023 15:52:12 +0000 (17:52 +0200)]
bump version to 8.0.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoutils: cleanup some comments and use statements
Thomas Lamprecht [Tue, 11 Jul 2023 15:07:09 +0000 (17:07 +0200)]
utils: cleanup some comments and use statements

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoreport: group use statements
Stoiko Ivanov [Fri, 7 Jul 2023 16:54:28 +0000 (18:54 +0200)]
report: group use statements

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agosystem report: skip irrelevant files in /etc/pmg/templates
Stoiko Ivanov [Fri, 7 Jul 2023 16:54:27 +0000 (18:54 +0200)]
system report: skip irrelevant files in /etc/pmg/templates

This patch removes:
* templates which have no changes to the ones in
  /var/lib/pmg/templates
* files generated by ucf

from the report. Unmodified files are reported, so that the user can
remove them.

This should make providing support a bit easier - as currenlty I'd
copy each template from the report to `diff` it with the version in
the package, for finding out if there is something relevant.

the new dump_template sub was copied from dir_to_text, in order to
explicitly write which files are skipped.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
 [T: merge in helper method for getting the unmodified templates ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agopmg7to8: notify about unmodified templates
Stoiko Ivanov [Fri, 7 Jul 2023 16:54:26 +0000 (18:54 +0200)]
pmg7to8: notify about unmodified templates

I considered making this a warning, but since unmodified files get
updated to the new versions in /var/lib/pmg/templates by ucf a notice
seems more appropriate.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
 [T: merge in helper method for getting the unmodified templates ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotree-wide: make slurp mode as local as possible for future-proofing
Fiona Ebner [Mon, 10 Jul 2023 11:36:47 +0000 (13:36 +0200)]
tree-wide: make slurp mode as local as possible for future-proofing

similar to what PMG/TFAConfig.pm already does.

Otherwise, sub-routine calls would still be affected leading to
unexpected results, like the issue fixed by commit "cluster config:
restrict slurp scope to avoid issue parsing network interfaces".

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
10 months agocluster config: restrict slurp scope to avoid issue parsing network interfaces
Fiona Ebner [Mon, 10 Jul 2023 11:36:46 +0000 (13:36 +0200)]
cluster config: restrict slurp scope to avoid issue parsing network interfaces

As reported in the community forum [0], there is an edge case, where
querying the network interfaces would not work. In particular, this
could happen if the hostname cannot be resolved to a non-loopback IP
(when installing PMG on Debian and forgetting to adapt /etc/hosts for
example).

The issue manifested as follows:
- When setting up the RESTEnvironemnt, the cluster config is read.
- This reader uses slurp mode by setting the line ending to undef
  locally.
- But the subroutine call PVE::Network::get_local_ip() is still part
  of that local context.
- When resolving the hostname to a non-loopback IP address failed, the
  function would read (via the PVE::INotify module) the network
  interfaces file.
- As part of that, /proc/net/dev was read all at once, while the
  interface parsing code expects it line-by-line.
- The result for reading network interfaces was cached without having
  detected the interfaces in /proc/net/dev.
- When a new request came in, the cached result was used (even
  changing the file to invalidate the cache would only work as long
  as the cluster config file exists, because otherwise, there would be
  an attempt to read the cluster config which would read the updated
  version of the interfaces file while slurping again).

[0]: https://forum.proxmox.com/threads/129958/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
10 months agobump version to 8.0.4
Thomas Lamprecht [Mon, 3 Jul 2023 10:41:49 +0000 (12:41 +0200)]
bump version to 8.0.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agofix #4815: pmgsh: fix calling the api paths directly
Dominik Csapak [Mon, 3 Jul 2023 08:28:19 +0000 (10:28 +0200)]
fix #4815: pmgsh: fix calling the api paths directly

if we get a command directly, we don't initialize the $rpcenv
variable anymore.

To fix it, make it a local variable of the pmg_command function.
We now make one extra '->get()' call per command (as opposed to
once per program), but that shouldn't cost us anything really.

Reported in the forum: https://forum.proxmox.com/threads/.130008/

Fixes: 1583283 ("pmgsh: initialize RPC/REST environment late")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [S.I: add bugreference, fixes trailer and shorten forum link]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agostatistics: fix update virusinfo
Dominik Csapak [Fri, 30 Jun 2023 08:27:48 +0000 (10:27 +0200)]
statistics: fix update virusinfo

by moving the closing parenthesis to the correct place

Fixes: 9972a7c ("postgresql compat: cast result from EXTRACT to INTEGER")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agobump version to 8.0.3
Thomas Lamprecht [Wed, 28 Jun 2023 15:42:38 +0000 (17:42 +0200)]
bump version to 8.0.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agopmgpolicy, pmg-smtp-filter: set sensible PATH
Stoiko Ivanov [Wed, 28 Jun 2023 15:38:04 +0000 (17:38 +0200)]
pmgpolicy, pmg-smtp-filter: set sensible PATH

these 2 services are the only ones that don't have this set (the
additions are copied over from pmgproxy)

with bookworm pmgpolicy throws an error (when invoking 'journalctl'
via run_command (in PMG::Utils::scan_journal_for_rbl_rejects)

did not come to a conclusion why it just resurfaced now, and ran fine
in a bullseye environment

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agocomplete changelog for 8.0.2
Thomas Lamprecht [Wed, 28 Jun 2023 11:49:00 +0000 (13:49 +0200)]
complete changelog for 8.0.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.2
Thomas Lamprecht [Wed, 28 Jun 2023 06:35:42 +0000 (08:35 +0200)]
bump version to 8.0.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoapi: include tfa lock status in user list
Wolfgang Bumiller [Wed, 28 Jun 2023 07:19:35 +0000 (09:19 +0200)]
api: include tfa lock status in user list

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotfa: add totp-locked and tfa-locked-until to list return schema
Wolfgang Bumiller [Wed, 28 Jun 2023 07:15:55 +0000 (09:15 +0200)]
tfa: add totp-locked and tfa-locked-until to list return schema

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoaccess control: add missing TFAConfig module imports
Wolfgang Bumiller [Tue, 27 Jun 2023 14:18:21 +0000 (16:18 +0200)]
access control: add missing TFAConfig module imports

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agousers: add endpoint for unlocking the TFA of a user
Wolfgang Bumiller [Tue, 27 Jun 2023 14:18:07 +0000 (16:18 +0200)]
users: add endpoint for unlocking the TFA of a user

add /access/users/<userid>/unlock-tfa api call which can be used for
unlocking a user after their TFA got locked due to many failed
consecutive retries.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotfa: enable lockout of users
Wolfgang Bumiller [Tue, 27 Jun 2023 14:13:57 +0000 (16:13 +0200)]
tfa: enable lockout of users

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump pmg-rs dependency to 0.7.2
Wolfgang Bumiller [Tue, 27 Jun 2023 14:08:05 +0000 (16:08 +0200)]
bump pmg-rs dependency to 0.7.2

Required for the following methods:
- authentication_verify2
- api_unlock_tfa
- tfa_lock_status

Also enables lockout.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/rules: tell dh-systemd to also not stop the no-start service on upgrade
Thomas Lamprecht [Wed, 28 Jun 2023 07:14:01 +0000 (09:14 +0200)]
d/rules: tell dh-systemd to also not stop the no-start service on upgrade

otherwise it stops them all, which can be wrong (if one is doing
something just now) and also noisy (prints quite some warnings)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/postinst: better anchor matches for section & property detection
Thomas Lamprecht [Wed, 28 Jun 2023 06:36:18 +0000 (08:36 +0200)]
d/postinst: better anchor matches for section & property detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.1
Thomas Lamprecht [Wed, 28 Jun 2023 06:04:53 +0000 (08:04 +0200)]
bump version to 8.0.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: fix setting version & release metadata for pmgcfg generation
Thomas Lamprecht [Wed, 28 Jun 2023 06:04:44 +0000 (08:04 +0200)]
buildsys: fix setting version & release metadata for pmgcfg generation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/source: set format to 3.0 (native)
Thomas Lamprecht [Wed, 28 Jun 2023 05:46:25 +0000 (07:46 +0200)]
d/source: set format to 3.0 (native)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.0
Thomas Lamprecht [Tue, 27 Jun 2023 16:20:34 +0000 (18:20 +0200)]
bump version to 8.0.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agopam: set PAM_RHOST
Wolfgang Bumiller [Tue, 27 Jun 2023 13:39:08 +0000 (15:39 +0200)]
pam: set PAM_RHOST

This allows pam modules to restrict users by host. For
instance, you could restrict root@pam to only 127.0.0.1.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoauth: set PAM context to 'proxmox-mailgateway-auth'
Wolfgang Bumiller [Tue, 27 Jun 2023 13:39:07 +0000 (15:39 +0200)]
auth: set PAM context to 'proxmox-mailgateway-auth'

This allows configuring PAM authentication for PMG via
/etc/pam.d/proxmox-mailgateway-auth

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoreport: adapt to changes in SpamAssassin DNS api
Stoiko Ivanov [Tue, 27 Jun 2023 09:00:27 +0000 (11:00 +0200)]
report: adapt to changes in SpamAssassin DNS api

SpamAssassin 4.0 changed the way it does DNS-lookups a bit (switched
to asynchronous lookups) - this broke pmg-system-report, since we use
the SpamAssassin API to check that DNS-resolution works.  The reason
for this is that SA used to take only the first entry from
/etc/resolv.conf - and SA being able to do correct resolution is
critical for it to work.

This patch fixes the incompatible use of the DNS-API, but does not
change to the asynchronous model.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
10 months agopostgresql compat: cast result from EXTRACT to INTEGER
Stoiko Ivanov [Mon, 26 Jun 2023 20:45:10 +0000 (22:45 +0200)]
postgresql compat: cast result from EXTRACT to INTEGER

Postgresql has changed the return type of the EXTRACT function to
numeric from float8 [0] in version 14, and I strongly assume that this
change is the reason why:
`SELECT EXTRACT (EPOCH FROM now());`
now returns a floating point instead of an integer value, which in
turn is not accepted in the prepared statements throughout our
codebase.

[0] https://www.postgresql.org/docs/release/14.0/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agocluster: fix rsync invocation
Stoiko Ivanov [Mon, 26 Jun 2023 20:45:09 +0000 (22:45 +0200)]
cluster: fix rsync invocation

Since rsync 3.2.4, the syntax to give multiple files in one parameter
does not work anymore, so list them explicitly

Inspired by  commit 9697997575e25e188a0993a0e4fc7f33f6602928
in pve-cluster

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agopmg7to8: skip kernel checks for pmg-mailgateway-container
Stoiko Ivanov [Mon, 26 Jun 2023 20:59:40 +0000 (22:59 +0200)]
pmg7to8: skip kernel checks for pmg-mailgateway-container

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agopmg sources: update dist to bookworm
Stoiko Ivanov [Mon, 26 Jun 2023 18:22:28 +0000 (20:22 +0200)]
pmg sources: update dist to bookworm

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agopmg7to8: only inform about timesync options
Stoiko Ivanov [Mon, 26 Jun 2023 17:02:50 +0000 (19:02 +0200)]
pmg7to8: only inform about timesync options

PMG does not install any time synchronization service in a default
install - so a warning if it's not present is not warranted.

Keep the informational messages anyways, since having a synchronized
clock does yield benefits for internet-connected services.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
(cherry picked from commit a4b75cda8e739d576e9878a6a0b8e2d5f21b5ca2)
(cherry picked from commit 60f27abd216abcda163c6bb64fbfac1688a4fd01)
[S.Ivanov: squash whitespace change in]
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agopmg7to8: also ignore proposed-updates to ignored suite suffixes
Stoiko Ivanov [Mon, 26 Jun 2023 17:02:37 +0000 (19:02 +0200)]
pmg7to8: also ignore proposed-updates to ignored suite suffixes

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
(cherry picked from commit d2c130aba2bc392c3433fe29bf507c1e782235cd)
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 months agod/postinst: remove re-generation of unique machine-ID for old ISOs
Thomas Lamprecht [Mon, 26 Jun 2023 16:27:41 +0000 (18:27 +0200)]
d/postinst: remove re-generation of unique machine-ID for old ISOs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.0~1
Thomas Lamprecht [Mon, 26 Jun 2023 15:37:14 +0000 (17:37 +0200)]
bump version to 8.0.0~1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agodbtools: grant permissions public schema for created databases
Dominik Csapak [Mon, 26 Jun 2023 14:10:26 +0000 (16:10 +0200)]
dbtools: grant permissions public schema for created databases

since postgres 15, the public schema is not world writeable anymore for
security reasons. In our environment, where the db is not externaly
reachable and no database users should exists except the ones we create,
we can safely give the permissions again to be able to use
the root/www-data user without modification of the remaining
code/privileges for postgres.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/postinst: notify via stdout when hard-coding defaults
Thomas Lamprecht [Mon, 26 Jun 2023 15:36:07 +0000 (17:36 +0200)]
d/postinst: notify via stdout when hard-coding defaults

Suggested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agodebian/postinst: add old default values on upgrade to 8.x
Dominik Csapak [Mon, 26 Jun 2023 13:42:49 +0000 (15:42 +0200)]
debian/postinst: add old default values on upgrade to 8.x

in /etc/pmg/pmg.conf for
advfilter
use_bayes
use_awl

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agopmg7to8: sync over changes from stable-7 branch
Thomas Lamprecht [Mon, 26 Jun 2023 15:19:25 +0000 (17:19 +0200)]
pmg7to8: sync over changes from stable-7 branch

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agointroduce pmg7to8 cli helper
Dominik Csapak [Mon, 26 Jun 2023 12:30:43 +0000 (14:30 +0200)]
introduce pmg7to8 cli helper

mostly copied from pve7to8 (without the pve specific tests) with some
notable additions to check some basic things for the pmg upgrade:
* check if the cluster is healthy
* check if the services are stopped(pre-upgrade)/started(post-upgrade)
* check if the db was upgraded (post upgrade)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoconfig: disable advanced statistic filters by default
Dominik Csapak [Fri, 23 Jun 2023 12:21:02 +0000 (14:21 +0200)]
config: disable advanced statistic filters by default

If the (documented) behaviour is not known, it is rather unexpected and
confusing. So disable by default.

Note that this is a breaking change, since enabling them is just a
config switch, it shouldn't be much of a problem.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agoconfig: disable awl and bayes by default
Dominik Csapak [Fri, 23 Jun 2023 12:21:01 +0000 (14:21 +0200)]
config: disable awl and bayes by default

Since most often they don't help in a default setup without manually
training with many examples.

Note that this is a breaking change, and a config rewrite will
trigger a deletion of bayes and awl databases.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agopmgsh: initialize RPC/REST environment late
Thomas Lamprecht [Mon, 26 Jun 2023 13:12:22 +0000 (15:12 +0200)]
pmgsh: initialize RPC/REST environment late

other wise a (s)build gets broken in restricted & clean environments.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: add DSC & sbuild convenience target
Thomas Lamprecht [Mon, 26 Jun 2023 12:19:28 +0000 (14:19 +0200)]
buildsys: add DSC & sbuild convenience target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agodrop executable flag from perl modules
Thomas Lamprecht [Mon, 26 Jun 2023 12:17:58 +0000 (14:17 +0200)]
drop executable flag from perl modules

mostly for consistency and my dircolors highlighting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/control: wrap-and-sort -tkn
Thomas Lamprecht [Mon, 26 Jun 2023 12:00:25 +0000 (14:00 +0200)]
d/control: wrap-and-sort -tkn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/control: add missing libapt-pkg-perl build-dependency
Thomas Lamprecht [Mon, 26 Jun 2023 12:00:10 +0000 (14:00 +0200)]
d/control: add missing libapt-pkg-perl build-dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: rework doc-gen cleanup and makefile inclusion
Thomas Lamprecht [Mon, 26 Jun 2023 09:53:22 +0000 (11:53 +0200)]
buildsys: rework doc-gen cleanup and makefile inclusion

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/control: avoid versioned build-dependencies with a -1 revision
Thomas Lamprecht [Mon, 26 Jun 2023 09:52:36 +0000 (11:52 +0200)]
d/control: avoid versioned build-dependencies with a -1 revision

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: expand clean target
Thomas Lamprecht [Mon, 26 Jun 2023 09:45:03 +0000 (11:45 +0200)]
buildsys: expand clean target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: use $(MAKE) variable for sub-make calls
Thomas Lamprecht [Mon, 26 Jun 2023 09:44:54 +0000 (11:44 +0200)]
buildsys: use $(MAKE) variable for sub-make calls

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: derive upload dist automatically
Thomas Lamprecht [Mon, 26 Jun 2023 09:40:43 +0000 (11:40 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobuildsys: build-dir: split-out and generate atomically
Thomas Lamprecht [Mon, 26 Jun 2023 09:36:38 +0000 (11:36 +0200)]
buildsys: build-dir: split-out and generate atomically

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agomakefile: convert to use simple parenthesis
Thomas Lamprecht [Mon, 26 Jun 2023 09:30:09 +0000 (11:30 +0200)]
makefile: convert to use simple parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agod/control: depend on rsyslog
Thomas Lamprecht [Mon, 26 Jun 2023 08:43:00 +0000 (10:43 +0200)]
d/control: depend on rsyslog

required for our current tracking center implementation, a central
feature for PMG, which uses rsyslog log files and format.

Note that we evaluated switching to the journal there, but that was
deemed to be too slow (albeit could have only been start-up time
penalty) – anyhow, as of now this is a requirement to get the full
functionality, once the log-tracker can understand other formats in
an efficient way too we can add those as alternatives.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agotemplates: postgresql.conf: drop removed config-setting
Stoiko Ivanov [Fri, 23 Jun 2023 08:06:32 +0000 (10:06 +0200)]
templates: postgresql.conf: drop removed config-setting

was deprecated with 14 and removed with postgresql 15 [0]

[0] https://www.postgresql.org/docs/current/release-15.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoupdate postgresql dependency to 15
Stoiko Ivanov [Fri, 23 Jun 2023 08:05:53 +0000 (10:05 +0200)]
update postgresql dependency to 15

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 7.3-4
Thomas Lamprecht [Fri, 2 Jun 2023 08:30:36 +0000 (10:30 +0200)]
bump version to 7.3-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agod/maintscripts: prevent aborting on errors in some commands
Stoiko Ivanov [Fri, 31 Mar 2023 11:27:47 +0000 (13:27 +0200)]
d/maintscripts: prevent aborting on errors in some commands

in case something goes wrong it is often better to not leave the
packaging state broken.

failure in the commands masked by this patch are either transient
(pmgconfig sync -restart 1 failing when services are masked), or will
be noticed quite instantly (failed database or config initialization
upon first install)

the deb-systemd-invoke change was based on a quick grep in
/var/lib/dpkg/info on my system

I quickly considered masking even more errors (e.g. related to the ucf
handling) - but they don't seem to cause issues (in the past 3 years)
- and if something breaks there it is probably worth to get a report

reported in our community forum:
https://forum.proxmox.com/threads/.125088/

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
11 months agoruledb: match field: validate regular expressions on addition
Dominik Csapak [Fri, 14 Apr 2023 09:14:58 +0000 (11:14 +0200)]
ruledb: match field: validate regular expressions on addition

Do not save rules if they die during an execution test, which is done
by using them once on an empty string.

Since users may have saved already invalid ones, only warn if we
encounter such a regex in 'parse_entity' during execution instead of
dying. Otherwise pmg-smtp-filter will exit and restart, possibly
leading to wrongly denying mails (and possibly sending out NDRs)
before spam checking was done.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
 [ T: touch up commit subject/message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agobump version to 7.3-3
Thomas Lamprecht [Tue, 28 Mar 2023 05:42:30 +0000 (07:42 +0200)]
bump version to 7.3-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agoquarantine: delete Delivered-To and Return-Path when reinjecting
Stoiko Ivanov [Mon, 27 Mar 2023 19:18:13 +0000 (21:18 +0200)]
quarantine: delete Delivered-To and Return-Path when reinjecting

The removal of those 2 headers was dropped in the recent rework for
quarantine delivery.
Leading to mails from quarantine being bounced by postfix 'local'
delivery agent (as the comment in the original code stated)

Reproduced by delivering a mail from quarantine to a postfix instance,
which routes it to a local account

Fixes: e51fe74 ("quarantine: use reinject_local_mail to deliver quarantined mail")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>