A previous commit removed the part which sets the bit.
Without the bit we cannot read the notification config, because
Postfix invokes forwarding binaries as 'nobody'.
Fixes: 32d813ce44 ("build: properly use cargo wrapper")
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
With the newly built-in targets/matchers, we should not add
a target/matcher manually any more. In fact, this broke mail
forwarding on PBS because 'default-matcher' already existed as a
built-in and could thus not be created.
We now simply do an early return.
Also initialize notify-context before instantiating the config,
since that already requires the context to be set.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
proxmox-schema and proxmox-section config is not required anymore.
add new dependency to proxmox-notify.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
[ TL: notify got bumped to 0.3 ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This allows us to send notifications for events from daemons that are
not under our control, e.g. zed, smartd, cron. etc...
For mail-based notification targets (sendmail, soon smtp) the mail is
forwarded as is, including all headers.
All other target types will try to parse the email to extra subject
and text body.
On PBS, where proxmox-notify is not yet fully integrated,
we simply add a default target/matcher to an empty config. That way
the behavior should be unchanged - mails will be forwarded to
root@pam.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Previously, configs with entries for tokens could not be parsed
successfully, so extracting the mail for the root user failed.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Similar to how it is done for pve-manager in PVE. If pvemailforward is
detected, nothing is done. An adapted pve-manager will cleanly handle
the switchover for PVE installations.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
It is a setuid binary owned by root, since the initial step of reading
the configuration files on both PVE and PBS requires higher privileges
which can't be mapped easily otherwise.
Used parts of the packaging in proxmox-backup as a basis.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
It is intended to replace the current pvemailforward binary+script in
PVE and also be used in PBS. The implemenation is largely based on the
pvemailforward script to try and keep behavior mostly the same in PVE.
To read the config in PBS, the binary would need to belong to
backup:backup with setuid and setgid bits (proxmox-backup is 700 owned
by backup:backup and user.cfg is 640 owned by root:backup). To read
the configs in PVE the setgid bit for www-data would need to be set.
To avoid this issue, the helper will be a root-owned setuid binary and
set the effective UID to the real UID, after reading in the config
files.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>