Commit Graph

46 Commits

Author SHA1 Message Date
Thomas Lamprecht
23cd21f350 bump version to 0.3.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 12:45:28 +02:00
Thomas Lamprecht
7932ef3ec1 cargo: require proxmox-notify version 0.5.4
To ensure recent fixes and features are also available here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 12:44:17 +02:00
Maximiliano Sandoval
40f0d9e048 run rustfmt
With rust 2024 edition.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-03-18 11:32:51 +01:00
Maximiliano Sandoval
2155483906 cargo: port to rust 2024 edition
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2025-03-18 11:32:51 +01:00
Thomas Lamprecht
87b85a5b96 bump version to 0.3.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 13:19:14 +01:00
Lukas Wagner
9d10d3d260 buildsys: set setuid bit in installed proxmox-mail-forward binary
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>
2024-11-19 13:17:50 +01:00
Thomas Lamprecht
62399a8e50 bump version to 0.3.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 12:46:03 +01:00
Thomas Lamprecht
6abe14d04b cargo: update dependcy for proxmox-notify to 0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-19 12:44:31 +01:00
Fabian Grünbichler
f58f921e54 bump proxmox-sys to 0.6
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-25 12:58:37 +02:00
Fabian Grünbichler
2cea78177f move .cargo/config to .cargo/config.toml
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>
2024-06-20 12:33:30 +02:00
Fabian Grünbichler
32d813ce44 build: properly use cargo wrapper
to actually get debug symbols with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:27:13 +02:00
Fabian Grünbichler
d4af462220 bump proxmox-notify
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 10:27:03 +02:00
Wolfgang Bumiller
e2efb8b87d bump version to 0.2.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-11 10:03:11 +01:00
Wolfgang Bumiller
105832c758 bump notify to 0.3.1 and sys to 0.5.3 for mail fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-01-11 08:48:50 +01:00
Thomas Lamprecht
3a41576cbc bump version to 0.2.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 17:31:32 +01:00
Lukas Wagner
0451898c05 do not forward on PBS systems if co-installed with PVE
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>
2023-11-21 17:30:07 +01:00
Thomas Lamprecht
0fd9c187e7 bump version to 0.2.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 17:58:50 +01:00
Lukas Wagner
e1088274be update d/control
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>
2023-11-17 17:56:36 +01:00
Lukas Wagner
7333224dd3 feed forwarded mails into proxmox_notify
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>
2023-11-17 17:55:31 +01:00
Thomas Lamprecht
401b9e98f5 buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-23 13:39:23 +02:00
Thomas Lamprecht
63c67a8705 bump version to 0.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:22:04 +02:00
Thomas Lamprecht
e1fc713cc6 update lintian-overrides for debhelper 13+
and don't override the "no manpage" one, we really should get one..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:22:04 +02:00
Thomas Lamprecht
4b48252012 d/control: define compat level via build-depends and raise to 13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:22:04 +02:00
Thomas Lamprecht
e0cd70967f debian: wrap-and-sort -tkn
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:22:04 +02:00
Thomas Lamprecht
7dbc739814 update dependencies for current bookworm state
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:22:04 +02:00
Thomas Lamprecht
11f4d434a5 d/postinst: add debhelper token
results in no change for now

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
fdd03d3375 buildsys: improve DSC target & add sbuild convenience target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
48d85aea5a buildsys: always pre-clean for dsc target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
231e6a6e7b buildsys: use full DEB_VERSION and correct DEB_HOST_ARCH
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
5656d25730 buildsys: improve build-dir target and prerequisites on it
drop automatically setting the cargo version, it's enforced in
d/rules now anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
0b6433f0c9 d/control: reflow description for line length recommendation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Thomas Lamprecht
6d999bd2a4 d/rules: enforce that the debian package version mateches cargo one
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-26 17:21:51 +02:00
Fabian Grünbichler
6cbec56a2c build: also copy .cargo dir
to unbreak source package builds.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-23 11:42:43 +01:00
Fabian Grünbichler
332aa4de1e build: update nix to 0.26
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-23 11:15:26 +01:00
Wolfgang Bumiller
f45f6624c7 bump version to 0.1.1-1 [final]
the previous bump missed the dependency bump

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-28 09:36:00 +01:00
Wolfgang Bumiller
8684dcb447 bump section config dependency to 1.0.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-28 09:36:00 +01:00
Wolfgang Bumiller
068e714070 bump version to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-28 09:32:35 +01:00
Fiona Ebner
1bb79e8a95 pbs user config: allow parsing unknown sections
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>
2022-11-28 09:30:48 +01:00
Thomas Lamprecht
1d5cb0707b d/rules: patch out unnecessary librt linkage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-10 13:08:55 +01:00
Thomas Lamprecht
53de12a741 d/rules: avoid setting DH_VERBOSE by default
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-10 13:07:46 +01:00
Wolfgang Bumiller
cf5c2fc14f bump version to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-10 11:43:05 +01:00
Wolfgang Bumiller
33617e7e02 use setresuid to drop saved-uid as well
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-10 11:41:34 +01:00
Wolfgang Bumiller
5e758590d6 require proxmox-section-config 1.0.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-10 11:31:22 +01:00
Fiona Ebner
6d701dbf28 d/postinst: register binary in .forward
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>
2022-11-10 11:28:26 +01:00
Fiona Ebner
cadc74576d add Debian packaging
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>
2022-11-10 11:28:21 +01:00
Fiona Ebner
28f222cd6e initial commit
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>
2022-11-10 11:28:17 +01:00