Commit Graph

1877 Commits

Author SHA1 Message Date
Thomas Lamprecht
874c21874c d/copyright: update years
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 12:18:24 +01:00
Thomas Lamprecht
c5ea4a9c40 bump version to 8.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 12:17:32 +01:00
Thomas Lamprecht
236af93e1e fix unintended interpolation of @' in string
Ensure perl does not interprets @' as variable and tries to
interpolate it into the error message string.

https://perldoc.perl.org/perldiag#Possible-unintended-interpolation-of-%25s-in-string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 12:17:32 +01:00
Stoiko Ivanov
240fadac19 oidc realm: only allow auto-creation of users on primary cluster-node
Only allow auto-creation of OIDC backed users if the node where the
user logs in is the active master.

Reported-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
 [TL: use more telling error message]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 12:08:38 +01:00
Thomas Lamprecht
472f1220f0 oidc realm: add format_description to role-assignment schema
to make our JSON schema api-docs extraction happy.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 11:52:40 +01:00
Stoiko Ivanov
6b8c7457d6 utils: verify_username: allow quarantine logins again
verify_username is used in many places to split into realms (the part
after the last '@') and usernames (everthing before).

The commit disallowing '@' in usernames broke quarantine login
(users login with `localpart@domainname.com@quarantine`)

Fixes: 9665bbc ("utils: user schema: explicitly forbid @ in user-names")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-27 11:08:59 +01:00
Thomas Lamprecht
9308e8ff24 fix various typos
Reported-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 11:03:40 +01:00
Thomas Lamprecht
4e92dcd441 oidc realm: add more flexiple access-role assignment
deprecate the fixed role assignment property and replace it with one
that allows to select the source of the role, for now allow static,
which is equivalent with what we had, and also to query the role from
a role claim, so that the OIDC provider can return the correct role
inside the returned user information.

Tested the dynamic role assignment with keycload by setting up an
'User Attribute' Mapper for a client and added added the respective
user attribute to some test user.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-27 10:46:33 +01:00
Thomas Lamprecht
3132534782 bump version to 8.1.9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 22:14:54 +01:00
Thomas Lamprecht
edfa93d963 auth: make realm regex safer to use
Return a quoted regex that is surrounded by a non-capturing group,
which makes it behave more like expected if used with anchors

I.e., previously a match like /^$valid_pmg_realm_regex$/ would look
like it must be an exact match, but actually only anchor the first
case at the start, the last case at the end and the others nowhere.
As concrete example /^foo|bar|baz$/ allows any string that starts with
foo, any string that ends with baz and any string that contains bar
somewhere, i.e. "foo" is accepted just like "foo123".

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 22:10:19 +01:00
Stoiko Ivanov
9665bbc605 utils: user schema: explicitly forbid @ in user-names
PMGs terms are:
* 'userid' consists of 'username'@'realm'

without this patch it was possible to create a user through the api,
with @ in the username ('foo@bar@pmg'), and it got written to the
user-conf.
Reading that entry was not possible, as the verification on read was
stricter.

This patch forbids '@' in usernames, and additionally drops the
maxLength of 64, as 60 are already enforced by the regex pattern match
(leaving 4 as minimal length for '@pmg'/'@pam').

Potential for regression should be minimal (the users could not be
read-back from the config).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-26 22:00:03 +01:00
Thomas Lamprecht
1ad4ab089d api: user add: fix missing includes and improve error handling
Also switch over to the is_valid_realm method instead of regex
matching.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 21:51:53 +01:00
Stoiko Ivanov
0e10633ff6 api: users: rework userid validation
reuse the existing helpers in PMG::Utils to forbid creating:
* users with an unallowed realm
* passing a different realm than what we receive in the userid
* users in the pam realm

Reported-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-26 20:52:04 +01:00
Stoiko Ivanov
d2c1afc802 api: authrealm: create: add quarantine as reserved realm
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-26 20:50:46 +01:00
Thomas Lamprecht
13aec566a9 only query valid realms if really needed
Avoid having to read the whole realm config for cases where we have
dedicated detection and handling for built-in realms anyway.

As a nice side-effect this should reduce chance that a broken realm
config locks out admins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 20:07:38 +01:00
Thomas Lamprecht
a16e3c0d32 move helper method to get regex for valid realms to Auth::Plugin
Move over the valid_pmg_realm_regex from PMG::Utils to
PMG::Auth::Plugin. For one most use-sites already include the
Auth::Plugin module and we have the is_valid_realm method there too,
so it's only fitting to have similar methods near each other.

Drop the unused $id intermediate variable while at it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 20:05:03 +01:00
Stoiko Ivanov
cb1d593938 cluster: add realms.conf to config-sync
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Stoiko Ivanov
346d79a66e access control: rename realms.cfg to realms.conf
by defining the name once in PMG::Auth::Plugin, and using the sub
there to retrieve it where needed.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Stoiko Ivanov
64c79a77f7 auth: plugin: move schema definitions from Utils to Auth::Plugin
it's the class that actually needs them, and where we want
to keep the definitions.

move happens in order to not have a cyclical include
(PMG::Auth::Plugin including PMG::Utils for the schema definitions,
and PMG::Utils including PMG::Auth::Plugin to get the realms from its
config file).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Markus Frank
a61c313280 api: users: create user with a specified realm
Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Markus Frank
72ed5338ea api: implement oidc login similar to PVE
Allow OpenID Connect login using the Rust OIDC module.

PMG::API2::OIDC is based on pve-access-control's PVE::API2::OpenId

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Thomas Lamprecht
ec0c721ec1 d/control: update versioned dependency to libpmg-rs-perl
To ensure the Proxmox::RS::OIDC module, which got moved from pve-rs to
the common shared package, is available.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:22:44 +01:00
Markus Frank
0b7140ddd2 api: implement add/update/remove endpoints for authentication realms
Adapted from PVE, i.e. the PMG::API2::AuthRealm module is based on
pve-access-control's PVE::API2::Domains. The base-name AuthRealm was
chosen because a Domain module already exists and as AuthRealm is more
telling and consistent with the terminology we present to the user,
which favors "realm" over "domain".

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:20:40 +01:00
Markus Frank
6ee68a41fb config: add oidc type authentication realm
PMG::Auth::OIDC is based on pve-access-control's PVE::Auth::OpenId and
adds an autocreate-role option. If the autocreate option is enabled, the
user is automatically created with the Audit role. With autocreate-role
this role can be changed.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:20:40 +01:00
Markus Frank
35adacec3d config: add plugin system for authentication realms
To differentiate between usernames, the realm is also stored in the
user.conf file. Old config file syntax can be read, but will be
overwritten after a change.

This is a carryover from PVE. Previously there was no realm for a
username. Now the realm is also stored after an @ sign in user.conf.

Utils generates a list of valid realm names, including any newly added
realms, to ensure proper validation of a specified realm name.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-26 19:20:40 +01:00
Stoiko Ivanov
b5dbb9f9b8 user config: password: unify length constraints and set minlength to 8
to be in line with the requirements from the newer ISO installers and
our recommendations.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-26 13:46:16 +01:00
Stoiko Ivanov
fe880d2424 config: add admin-mail-from to pmg_service_params
thus a change to it triggers a pmg-smtp-filter reload.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2025-02-26 12:26:21 +01:00
Thomas Lamprecht
74fc14a170 bump version to 8.1.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-25 20:24:25 +01:00
Thomas Lamprecht
b3558c4521 d/postinst: version-guard migration to new pending pmg-score location
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-25 20:02:08 +01:00
Stoiko Ivanov
bc33a433c1 d/postinst: move pmg-scores.cf shadow file to new location
not guarding for install-mode, as the file will not exist on a fresh
install (and we need to do the stat(2) for it anyways).

did not add `|| true` to the `mv` invocation, as moving a file failing
probably warrants apt to error out.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 19:58:33 +01:00
Stoiko Ivanov
3ee9b16480 sa-custom: move shadow config to the same directory
keeping the shadow-file in /var/cache breaks their application if
/var/cache is on another filesystem than /etc/mail/spamassassin.
Perl's `rename` function [0], which is a wrapper for rename(2).
`rename` does not work across filesystem boundaries (errors out with
EXDEV).

having `/var` on another filesystem is becoming less common, but
should probably be supported.

Instead of using some other means of file moving, just put the
shadow file in the same directory as pmg-scores.cf.
SpamAssassin only reads files ending in .(cf|pre)$ from its
config-dirs, so having both files in the same directory should not be
an issue. The use of '.new' for the shadow-file follows the naming for
/etc/network/interfaces(.new).

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

tested in a container with a seperate volume for `/var/cache`.

[0] https://perldoc.perl.org/functions/rename
[1] https://github.com/apache/spamassassin/blob/trunk/README

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 19:58:32 +01:00
Stoiko Ivanov
cd011e2339 reinject_local_mail: sign mails with DKIM based on header
as most mails PMG generates locally has an empty envelope-sender,
signing only makes sense when the from-header domain is used as
signing domain.

This fixes #3423, and partially addresses #2971 and #4658 (bounces
generated by postfix directly are not passed through our stack, and
should not be processed in general -  see
https://www.postfix.org/postconf.5.html#internal_mail_filter_classes).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
98de1f61de dkim: signer: log info instead of die'ing when missing domain
for mail locally generated by PMG the signing sources
(envelope-sender, From header) can contain only a local-part
(postmaster) or even be empty (envelope-sender).

While such mail cannot be sensibly signed, it should be treated as if
the domain is not listed in DKIM-domains - by an log message on 'info'
level instead of a `die`.
the sub with the changed behavior is only used in this module, and
sign_entity as external entry-point is only called in eval context,
resulting in a log message on level 'warn'.

so effectively this change should only reduce log-levels for DKIM
failures in these cases from 'warning' to 'info'

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
0cf47f5fcd ruledb: use admin-mail-from where sensible
use the new setting as From header for notifications, but keep
the envelope-sender fixed as 'postmaster'.

add a comment that we do not want to sign a mail released from the
quarantine, as it remains the only use of 'postmaster' without this
fallback, but as above - only for the envelope-sender.

the admin-mail-from setting has to be carried through pmg-smtp-filter
in the msginfo variable as was done for the dkim settings as well.

This changes the From header for Notifications sent from the
rulesystem from: 'postmaster' to 'Proxmox Mail Gateway <postmaster>'
(or the setting of admin-mail-from).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
dc685973b1 smtp-engine: use admin-mail-from as from header for bounces
generate_ndr is currently only used to generate a bounce-mail if the
following occur:
* email is blocked only for part of the receivers
* before-queue-filtering is active - in the after-queue case postfix
  generates the bounces for us.

With this patch the header of the bounce message will contain
'Proxmox Mail Gateway <postmaster>' (or the setting of
admin-mail-from) instead of 'postmaster', but this should not affect
deliverability of these mails.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
ddbab9a86b reports: use admin-mail-from as from header
this sets the admin-mail-from header information for all local emails
generated through the templateing system, which are not already using
the 'mailfrom' setting from the 'spamquar' config-section.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
4a6a3edd65 config: add admin-mail-from key
To be used as From header for mails generated by the PMG stack.
Currently this is hardcoded to postmaster in a few places, and
Proxmox Mail Gateway <postmaster> in a few other places..

While PMG generates mails as the mail-system and postmaster is a
good choice for such mails, users sometimes wish to customize the
e-mail shown e.g. in the backup-notification and the daily admin
report.

The set value will be used in the header only, following the similar
setting 'mailfrom' in the 'spamquar' setting.
I decided against reusing the existing setting, as it's specifically
tied to a category.

The format is restricted by regex to printable ascii-characters for
now[1], as being more permissive later (even allowing all unicode
printables) is easy. The length restriction to 998 characters ist due
to a few SMTP-RFCs [2].

Envelope-from addresses for mail generated by will remain empty or
'postmaster'.

This is a first step towards DKIM signing those mails.

Users will have to opt-in to it and use a email with domain-part to
get DKIM signing.

I decided against changing the current behavior of using 'postmaster'
without domain, as this makes postfix complete the address with
'@$myorigin.$mydomain'[0], and I've seen quite a few installations
which set those settings in their main.cf.in templates.

[0] https://www.postfix.org/postconf.5.html#internal_mail_filter_classes
[1] https://perldoc.perl.org/perlrecharclass
[2] https://www.rfc-editor.org/rfc/rfc5322#section-2.1.1

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-25 18:28:17 +01:00
Stoiko Ivanov
008368a851 utils: drop unneeded PMX_header_ct
The variable was introduced in a early version of c320d56 ("utils:
content-type: don't fallback to header information for magic"
without realizing that the PMX_magic|glob_ct variables are only set
for MIME-Parts with bodyhandle - and expecting to replace the
header-lookup in multiple places. As the header is also present and
needed for MIME-Parts without bodyhandle (parts that have subparts
have no bodyhandle) - drop the variable, in order to cause less
confusion.

Also drop '$magic' as part of the nested if-condition, as it is
already checked in the if one line above.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-25 17:49:08 +01:00
Stoiko Ivanov
178143df66 ruledb: content-type: do not rely on PMX_header_ct
As noted in the cover-letter for v3 of the series introducing this [0]
the PMX_magic_ct, PMX_glob_ct and PMX_header_ct are only set if there
is a bodyhandle for a mime-part, which only exists if the part has no
sub-parts.

[0]: https://lore.proxmox.com/pmg-devel/74a089b6-d858-4525-9822-da58b9c8f4d7@proxmox.com/T/#t

However we want to match on content-types even for mail-parts which
have no bodyhandle:
* our internal regression-test suite has a mail with `message/partial`
  set
* there are probably sensible uses for matching `multipart/related`
  parts (e.g. when trying to get a negated match.

Noticed during a check of our regression-tests.

Fixes: c320d56 ("utils: content-type: don't fallback to header information for magic")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-25 17:48:33 +01:00
Stoiko Ivanov
4847b03d91 ruledb: content-type: drop unreachable fallback for only_content
the default of 'only_content' gets set when fetching the entries from
the database in load_attr - and it defaults to false, making the `// 1`
even more confusing.

Noticed while debugging another issue, and considered if this false
setting might be the cause.

Fixes: af418f4 ("ruledb: content-type: add flag for matching only based on magic/content")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-25 17:47:47 +01:00
Thomas Lamprecht
758e2e80fb d/changelog: fix spelling error in last entry
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-22 17:35:12 +01:00
Stoiko Ivanov
e33a8a7522 d/triggers: add interest in spamassassin updates
currently an update to SpamAssassin does not reload any of the
services.

This patch simply adds interest-noawait on a trigger activated by
proxmox-spamassassin, which in turn reloads all services (as already
done for updates to pve-common, and in PVE on updates on other
packages that affect the API).

Technically it might only be necessary to reload pmg-smtp-filter,
pmgproxy and pmgdaemon, to get the benefits of a new spamassassin
version, but reloading all services seems more robust in the long run.

[0] https://git.dpkg.org/cgit/dpkg/dpkg.git/tree/doc/spec/triggers.txt
[1] https://manpages.debian.org/bookworm/dpkg-dev/deb-triggers.5.en.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-21 18:37:59 +01:00
Thomas Lamprecht
571254f046 bump version to 8.1.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-21 18:22:22 +01:00
Thomas Lamprecht
a528517b40 ruledb: disclaimer: coding style improvements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-21 18:05:31 +01:00
Stoiko Ivanov
b961581e83 fix #2709: ruledb: match-field: optionally restrict to top mime-part
The current Match Field (header) what-objects always traverse each
mime-part of a mail.
This can be inconvenient, and causes unexpected matches when you
forward a message as attachment(message/rfc822).

following the patches for adding a Disclaimer on top of a mail from an
implementation point of view, this simply adds an optional
top-level-only attribute for the MatchField object, which is disabled
by default for backwards-compatibility.

Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-21 18:01:28 +01:00
Stoiko Ivanov
af418f434b ruledb: content-type: add flag for matching only based on magic/content
our current content-type matching is sensibly quite cautious in
matching if any available information indicates a potential match:
* mime-type detection based on file contents
* mime-type detection based on file suffix
* content-type header

Sometimes this can lead to surprises (e.g. when a MUA sets the
filetype of a pdf to application/octet-stream (the default type if no
information is available), or a filter for zip-files matching
docx-files.

This change gives users the option to restrict matching only on the
content as detected by xdg_mime_get_mime_type_for_data.

This is a fix for the intial request in #2691 and addresses the
suggestion from Friedrich from:
https://bugzilla.proxmox.com/show_bug.cgi?id=5618#c2

matches on the other items can be created with Match Field objects
(for the content-type header) and Filename (for the match based on the
provided filename - combinations of those should give us the complete
flexibility.

inspired by the changes for disclaimer released with PMG 8.1:
51d1507 ("fix #2430: ruledb disclaimer: make separator configurable")

Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-21 18:01:28 +01:00
Stoiko Ivanov
c320d56091 utils: content-type: don't fallback to header information for magic
file-type detection based on content/magic is the single piece of
information not determined by the headers of the e-mail, and thus not
directly controlled by the sender.

this patch removes the fallback to the content-type header mime-type
in case magic_mime_type_for_file does not detect the type.

one exception to this is trying to eagerly gain information from
archives - where we want to try to unpack an archive if the header
says it is an archive but the content is not detected as such.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-21 18:01:28 +01:00
Stoiko Ivanov
3bcf02c204 ruledb: disclaimer: simplify update-case
as one object(_id) belongs is of one object type, we can safely remove
all associated attribut entries from the database at once instead of
running 2 separate statements to delete each individually

noticed this while adding new attribut entries to the content-type
check.

Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2025-02-21 18:01:28 +01:00
Stoiko Ivanov
0345bd6ba8 fix #6126: do not deliver/delete quarantined mails multiple times
This was reported through our enterprise support and was easy to
reproduce.

When clicking on the action-links in the spamreport multiple times the
action was equally done multiple times, which was surprising
especially when you deliver a quarantined mail more than once.

As quarantined mail-files are not deleted upon deliver/delete (mails
can have multiple recipients), but asynchronously after the quarantine
lifetime they are only marked with status 'D'.

Use this information to prevent multiple deliveries and superfluous
database updates.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>
2025-02-21 17:59:03 +01:00
Stoiko Ivanov
db2b1f64f5 quarantine: add receiver to delivery/delete log-messages
The question: "What happened to the quarantined e-mail" comes up every
now and then in our support-channels, and it always feels a bit clumsy
to explain how to get to the fitting logline, by referring to the
general timeframe when a user did the request and to look for the
queue-ids and quarantine-file-ids for identifying a particular mail.

Adding the receiver of the mail to the log lines should make this a
bit more straight-forward.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>
2025-02-21 17:58:55 +01:00