public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version
@ 2025-05-23 12:26 Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 1/3] import mail-parser from bookworm Lukas Wagner
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

This series packages the newest version of the `mail-parser` crate along
with its new `hashify` dep for Debian Trixie.

The second part of the series adapts proxmox-notify to the changes in `mail-parser`'s
API.

debcargo-conf:

Lukas Wagner (3):
  import mail-parser from bookworm
  package hashify 0.2.6
  update mail-parser to 0.11.0

 src/hashify/debian/changelog                  |  6 ++
 src/hashify/debian/copyright                  | 37 +++++++++
 src/hashify/debian/copyright.debcargo.hint    | 49 ++++++++++++
 src/hashify/debian/debcargo.toml              |  2 +
 src/mail-parser/debian/changelog              | 17 ++++
 src/mail-parser/debian/copyright              | 49 ++++++++++++
 .../debian/copyright.debcargo.hint            | 77 +++++++++++++++++++
 src/mail-parser/debian/debcargo.toml          |  2 +
 8 files changed, 239 insertions(+)
 create mode 100644 src/hashify/debian/changelog
 create mode 100644 src/hashify/debian/copyright
 create mode 100644 src/hashify/debian/copyright.debcargo.hint
 create mode 100644 src/hashify/debian/debcargo.toml
 create mode 100644 src/mail-parser/debian/changelog
 create mode 100644 src/mail-parser/debian/copyright
 create mode 100644 src/mail-parser/debian/copyright.debcargo.hint
 create mode 100644 src/mail-parser/debian/debcargo.toml


proxmox:

Lukas Wagner (3):
  notify: smtp: move building of forwarded mails to separate function
  notify: smtp: add test for building forwarded messages
  notify: update mail-parser dependency to 0.11

 Cargo.toml                                    |   2 +-
 proxmox-notify/src/endpoints/smtp.rs          | 221 ++++++++++--------
 proxmox-notify/src/lib.rs                     |   3 +-
 proxmox-notify/testdata/test1.msg             | 104 +++++++++
 .../test_forward_message_from_raw.ref         |  95 ++++++++
 5 files changed, 331 insertions(+), 94 deletions(-)
 create mode 100644 proxmox-notify/testdata/test1.msg
 create mode 100644 proxmox-notify/testdata/test_forward_message_from_raw.ref


Summary over all repositories:
  13 files changed, 570 insertions(+), 94 deletions(-)

-- 
Generated by git-murpp 0.8.1


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH debcargo-config 1/3] import mail-parser from bookworm
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 2/3] package hashify 0.2.6 Lukas Wagner
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 src/mail-parser/debian/changelog              | 11 +++
 src/mail-parser/debian/copyright              | 49 ++++++++++++
 .../debian/copyright.debcargo.hint            | 77 +++++++++++++++++++
 src/mail-parser/debian/debcargo.toml          |  2 +
 4 files changed, 139 insertions(+)
 create mode 100644 src/mail-parser/debian/changelog
 create mode 100644 src/mail-parser/debian/copyright
 create mode 100644 src/mail-parser/debian/copyright.debcargo.hint
 create mode 100644 src/mail-parser/debian/debcargo.toml

diff --git a/src/mail-parser/debian/changelog b/src/mail-parser/debian/changelog
new file mode 100644
index 0000000000..8944fae562
--- /dev/null
+++ b/src/mail-parser/debian/changelog
@@ -0,0 +1,11 @@
+rust-mail-parser (0.8.2-1~bpo11+1) proxmox-rust; urgency=medium
+
+  * build for Proxmox Bookworm based releases
+
+ -- Proxmox Support Team <support@proxmox.com>  Fri, 20 Oct 2023 17:23:24 +0200
+
+rust-mail-parser (0.8.2-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
+
+  * Package mail-parser 0.8.2 from crates.io using debcargo 2.6.0
+
+ -- Lukas Wagner <l.wagner@proxmox.com>  Fri, 25 Aug 2023 14:10:10 +0200
diff --git a/src/mail-parser/debian/copyright b/src/mail-parser/debian/copyright
new file mode 100644
index 0000000000..28fc2722c2
--- /dev/null
+++ b/src/mail-parser/debian/copyright
@@ -0,0 +1,49 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: mail-parser
+Upstream-Contact: Stalwart Labs <hello@stalw.art>
+Source: https://github.com/stalwartlabs/mail-parser
+
+Files: *
+Copyright: 2020-2022 Stalwart Labs <hello@stalw.art>
+License: Apache-2.0 or MIT
+
+Files: tests/legacy/*
+Copyright: 2010 Hunny Software, Inc.
+License: UNKNOWN-LICENSE;
+
+Files: tests/malformed/*
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
+License: MIT
+
+Files: tests/thirdparty/*
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
+License: MIT
+
+Files: debian/*
+Copyright:
+ 2023 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2023 Lukas Wagner <l.wagner@proxmox.com>
+License: Apache-2.0 or MIT
+
+License: Apache-2.0
+ Debian systems provide the Apache 2.0 license in
+ /usr/share/common-licenses/Apache-2.0
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff --git a/src/mail-parser/debian/copyright.debcargo.hint b/src/mail-parser/debian/copyright.debcargo.hint
new file mode 100644
index 0000000000..f0379206ac
--- /dev/null
+++ b/src/mail-parser/debian/copyright.debcargo.hint
@@ -0,0 +1,77 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: mail-parser
+Upstream-Contact: Stalwart Labs <hello@stalw.art>
+Source: https://github.com/stalwartlabs/mail-parser
+
+Files: *
+Copyright: FIXME (overlay) UNKNOWN-YEARS Stalwart Labs <hello@stalw.art>
+License: Apache-2.0 or MIT
+Comment:
+ FIXME (overlay): Since upstream copyright years are not available in
+ Cargo.toml, they were extracted from the upstream Git repository. This may not
+ be correct information so you should review and fix this before uploading to
+ the archive.
+
+Files: README.md
+Copyright: 2020-2022, Stalwart Labs Ltd.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: src/decoders/base64.rs
+Copyright: 2005, 2006, 2007 Nick Galbreath -- nickg [at] modp [dot] com
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: tests/legacy/COPYING
+Copyright: 2010 Hunny Software, Inc.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: tests/malformed/COPYING
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: tests/thirdparty/COPYING
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: debian/*
+Copyright:
+ 2023 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2023 Lukas Wagner <l.wagner@proxmox.com>
+License: Apache-2.0 or MIT
+
+License: Apache-2.0
+ Debian systems provide the Apache 2.0 license in
+ /usr/share/common-licenses/Apache-2.0
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff --git a/src/mail-parser/debian/debcargo.toml b/src/mail-parser/debian/debcargo.toml
new file mode 100644
index 0000000000..d69a1a27b7
--- /dev/null
+++ b/src/mail-parser/debian/debcargo.toml
@@ -0,0 +1,2 @@
+overlay = "."
+uploaders = ["Lukas Wagner <l.wagner@proxmox.com>"]
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH debcargo-config 2/3] package hashify 0.2.6
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 1/3] import mail-parser from bookworm Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 3/3] update mail-parser to 0.11.0 Lukas Wagner
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 src/hashify/debian/changelog               |  6 +++
 src/hashify/debian/copyright               | 37 ++++++++++++++++
 src/hashify/debian/copyright.debcargo.hint | 49 ++++++++++++++++++++++
 src/hashify/debian/debcargo.toml           |  2 +
 4 files changed, 94 insertions(+)
 create mode 100644 src/hashify/debian/changelog
 create mode 100644 src/hashify/debian/copyright
 create mode 100644 src/hashify/debian/copyright.debcargo.hint
 create mode 100644 src/hashify/debian/debcargo.toml

diff --git a/src/hashify/debian/changelog b/src/hashify/debian/changelog
new file mode 100644
index 0000000000..8c18462399
--- /dev/null
+++ b/src/hashify/debian/changelog
@@ -0,0 +1,6 @@
+rust-hashify (0.2.6-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
+
+  * Team upload.
+  * Package hashify 0.2.6 from crates.io using debcargo 2.7.8
+
+ -- Lukas Wagner <l.wagner@proxmox.com>  Fri, 23 May 2025 09:17:31 +0000
diff --git a/src/hashify/debian/copyright b/src/hashify/debian/copyright
new file mode 100644
index 0000000000..d8c93122a7
--- /dev/null
+++ b/src/hashify/debian/copyright
@@ -0,0 +1,37 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: hashify
+Upstream-Contact: Stalwart Labs <hello@stalw.art>
+Source: https://github.com/stalwartlabs/hashify
+
+Files: *
+Copyright: 2025 Stalwart Labs <hello@stalw.art>
+License: Apache-2.0 or MIT
+
+Files: debian/*
+Copyright:
+ 2025 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2025 Lukas Wagner <l.wagner@proxmox.com>
+License: Apache-2.0 or MIT
+
+License: Apache-2.0
+ Debian systems provide the Apache 2.0 license in
+ /usr/share/common-licenses/Apache-2.0
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff --git a/src/hashify/debian/copyright.debcargo.hint b/src/hashify/debian/copyright.debcargo.hint
new file mode 100644
index 0000000000..b98f1d1a72
--- /dev/null
+++ b/src/hashify/debian/copyright.debcargo.hint
@@ -0,0 +1,49 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: hashify
+Upstream-Contact: Stalwart Labs <hello@stalw.art>
+Source: https://github.com/stalwartlabs/hashify
+
+Files: *
+Copyright: FIXME (overlay) UNKNOWN-YEARS Stalwart Labs <hello@stalw.art>
+License: Apache-2.0 or MIT
+Comment:
+ FIXME (overlay): Since upstream copyright years are not available in
+ Cargo.toml, they were extracted from the upstream Git repository. This may not
+ be correct information so you should review and fix this before uploading to
+ the archive.
+
+Files: README.md
+Copyright: 2025, Stalwart Labs LLC
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: debian/*
+Copyright:
+ 2025 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2025 Lukas Wagner <l.wagner@proxmox.com>
+License: Apache-2.0 or MIT
+
+License: Apache-2.0
+ Debian systems provide the Apache 2.0 license in
+ /usr/share/common-licenses/Apache-2.0
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff --git a/src/hashify/debian/debcargo.toml b/src/hashify/debian/debcargo.toml
new file mode 100644
index 0000000000..d69a1a27b7
--- /dev/null
+++ b/src/hashify/debian/debcargo.toml
@@ -0,0 +1,2 @@
+overlay = "."
+uploaders = ["Lukas Wagner <l.wagner@proxmox.com>"]
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH debcargo-config 3/3] update mail-parser to 0.11.0
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 1/3] import mail-parser from bookworm Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 2/3] package hashify 0.2.6 Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 1/3] notify: smtp: move building of forwarded mails to separate function Lukas Wagner
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 src/mail-parser/debian/changelog              |  6 +++
 src/mail-parser/debian/copyright              | 12 ++---
 .../debian/copyright.debcargo.hint            | 48 +++++++++----------
 3 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/src/mail-parser/debian/changelog b/src/mail-parser/debian/changelog
index 8944fae562..8ce77ca578 100644
--- a/src/mail-parser/debian/changelog
+++ b/src/mail-parser/debian/changelog
@@ -1,3 +1,9 @@
+rust-mail-parser (0.11.0-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
+
+  * Package mail-parser 0.11.0 from crates.io using debcargo 2.7.8
+
+ -- Lukas Wagner <l.wagner@proxmox.com>  Fri, 23 May 2025 09:20:24 +0000
+
 rust-mail-parser (0.8.2-1~bpo11+1) proxmox-rust; urgency=medium
 
   * build for Proxmox Bookworm based releases
diff --git a/src/mail-parser/debian/copyright b/src/mail-parser/debian/copyright
index 28fc2722c2..9d69c2c37a 100644
--- a/src/mail-parser/debian/copyright
+++ b/src/mail-parser/debian/copyright
@@ -4,25 +4,25 @@ Upstream-Contact: Stalwart Labs <hello@stalw.art>
 Source: https://github.com/stalwartlabs/mail-parser
 
 Files: *
-Copyright: 2020-2022 Stalwart Labs <hello@stalw.art>
+Copyright: 2020-2025 Stalwart Labs <hello@stalw.art>
 License: Apache-2.0 or MIT
 
-Files: tests/legacy/*
+Files: resources/eml/legacy/*
 Copyright: 2010 Hunny Software, Inc.
 License: UNKNOWN-LICENSE;
 
-Files: tests/malformed/*
+Files: resources/eml/malformed/*
 Copyright: 2003-2018 Dovecot authors, licensed under MIT.
 License: MIT
 
-Files: tests/thirdparty/*
+Files: resources/eml/thirdparty/*
 Copyright: 2003-2018 Dovecot authors, licensed under MIT.
 License: MIT
 
 Files: debian/*
 Copyright:
- 2023 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
- 2023 Lukas Wagner <l.wagner@proxmox.com>
+ 2023-2025 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2023-2025 Lukas Wagner <l.wagner@proxmox.com>
 License: Apache-2.0 or MIT
 
 License: Apache-2.0
diff --git a/src/mail-parser/debian/copyright.debcargo.hint b/src/mail-parser/debian/copyright.debcargo.hint
index f0379206ac..c8bc20f790 100644
--- a/src/mail-parser/debian/copyright.debcargo.hint
+++ b/src/mail-parser/debian/copyright.debcargo.hint
@@ -13,7 +13,28 @@ Comment:
  the archive.
 
 Files: README.md
-Copyright: 2020-2022, Stalwart Labs Ltd.
+Copyright: 2020, Stalwart Labs LLC
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: resources/eml/legacy/COPYING
+Copyright: 2010 Hunny Software, Inc.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: resources/eml/malformed/COPYING
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
+License: UNKNOWN-LICENSE; FIXME (overlay)
+Comment:
+ FIXME (overlay): These notices are extracted from files. Please review them
+ before uploading to the archive.
+
+Files: resources/eml/thirdparty/COPYING
+Copyright: 2003-2018 Dovecot authors, licensed under MIT.
 License: UNKNOWN-LICENSE; FIXME (overlay)
 Comment:
  FIXME (overlay): These notices are extracted from files. Please review them
@@ -26,31 +47,10 @@ Comment:
  FIXME (overlay): These notices are extracted from files. Please review them
  before uploading to the archive.
 
-Files: tests/legacy/COPYING
-Copyright: 2010 Hunny Software, Inc.
-License: UNKNOWN-LICENSE; FIXME (overlay)
-Comment:
- FIXME (overlay): These notices are extracted from files. Please review them
- before uploading to the archive.
-
-Files: tests/malformed/COPYING
-Copyright: 2003-2018 Dovecot authors, licensed under MIT.
-License: UNKNOWN-LICENSE; FIXME (overlay)
-Comment:
- FIXME (overlay): These notices are extracted from files. Please review them
- before uploading to the archive.
-
-Files: tests/thirdparty/COPYING
-Copyright: 2003-2018 Dovecot authors, licensed under MIT.
-License: UNKNOWN-LICENSE; FIXME (overlay)
-Comment:
- FIXME (overlay): These notices are extracted from files. Please review them
- before uploading to the archive.
-
 Files: debian/*
 Copyright:
- 2023 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
- 2023 Lukas Wagner <l.wagner@proxmox.com>
+ 2023-2025 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
+ 2023-2025 Lukas Wagner <l.wagner@proxmox.com>
 License: Apache-2.0 or MIT
 
 License: Apache-2.0
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox 1/3] notify: smtp: move building of forwarded mails to separate function
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
                   ` (2 preceding siblings ...)
  2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 3/3] update mail-parser to 0.11.0 Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 2/3] notify: smtp: add test for building forwarded messages Lukas Wagner
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

This allows us to write some tests for it.

No behavioral changes intended.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-notify/src/endpoints/smtp.rs | 189 ++++++++++++++-------------
 1 file changed, 97 insertions(+), 92 deletions(-)

diff --git a/proxmox-notify/src/endpoints/smtp.rs b/proxmox-notify/src/endpoints/smtp.rs
index b88e6c95..2f4bad3c 100644
--- a/proxmox-notify/src/endpoints/smtp.rs
+++ b/proxmox-notify/src/endpoints/smtp.rs
@@ -251,98 +251,8 @@ impl Endpoint for SmtpEndpoint {
                     .map_err(|err| Error::NotifyFailed(self.name().into(), Box::new(err)))?
             }
             #[cfg(feature = "mail-forwarder")]
-            Content::ForwardedMail { ref raw, title, .. } => {
-                use lettre::message::header::ContentTransferEncoding;
-                use lettre::message::Body;
-                use tracing::error;
-
-                let parsed_message = mail_parser::Message::parse(raw)
-                    .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
-
-                let root_part = parsed_message
-                    .part(0)
-                    .ok_or_else(|| Error::Generic("root message part not present".to_string()))?;
-
-                let raw_body = parsed_message
-                    .raw_message()
-                    .get(root_part.offset_body..root_part.offset_end)
-                    .ok_or_else(|| Error::Generic("could not get raw body content".to_string()))?;
-
-                // We assume that the original message content is already properly
-                // encoded, thus we add the original message body in 'Binary' encoding.
-                // This prohibits lettre from trying to re-encode our raw body data.
-                // lettre will automatically set the `Content-Transfer-Encoding: binary` header,
-                // which we need to remove. The actual transfer encoding is later
-                // copied from the original message headers.
-                let body =
-                    Body::new_with_encoding(raw_body.to_vec(), ContentTransferEncoding::Binary)
-                        .map_err(|_| Error::Generic("could not create body".into()))?;
-                let mut message = email_builder
-                    .subject(title)
-                    .body(body)
-                    .map_err(|err| Error::NotifyFailed(self.name().into(), Box::new(err)))?;
-                message
-                    .headers_mut()
-                    .remove_raw("Content-Transfer-Encoding");
-
-                // Copy over all headers that are relevant to display the original body correctly.
-                // Unfortunately this is a bit cumbersome, as we use separate crates for mail parsing (mail-parser)
-                // and creating/sending mails (lettre).
-                // Note: Other MIME-Headers, such as Content-{ID,Description,Disposition} are only used
-                // for body-parts in multipart messages, so we can ignore them for the messages headers.
-                // Since we send the original raw body, the part-headers will be included any way.
-                for header in parsed_message.headers() {
-                    let header_name = header.name.as_str();
-                    // Email headers are case-insensitive, so convert to lowercase...
-                    let value = match header_name.to_lowercase().as_str() {
-                        "content-type" => {
-                            if let mail_parser::HeaderValue::ContentType(ct) = header.value() {
-                                // mail_parser does not give us access to the full decoded and unfolded
-                                // header value, so we unfortunately need to reassemble it ourselves.
-                                // Meh.
-                                let mut value = ct.ctype().to_string();
-                                if let Some(subtype) = ct.subtype() {
-                                    value.push('/');
-                                    value.push_str(subtype);
-                                }
-                                if let Some(attributes) = ct.attributes() {
-                                    use std::fmt::Write;
-
-                                    for attribute in attributes {
-                                        let _ = write!(
-                                            &mut value,
-                                            "; {}=\"{}\"",
-                                            attribute.0, attribute.1
-                                        );
-                                    }
-                                }
-                                Some(value)
-                            } else {
-                                None
-                            }
-                        }
-                        "content-transfer-encoding" | "mime-version" => {
-                            if let mail_parser::HeaderValue::Text(text) = header.value() {
-                                Some(text.to_string())
-                            } else {
-                                None
-                            }
-                        }
-                        _ => None,
-                    };
-
-                    if let Some(value) = value {
-                        match HeaderName::new_from_ascii(header_name.into()) {
-                            Ok(name) => {
-                                let header = HeaderValue::new(name, value);
-                                message.headers_mut().insert_raw(header);
-                            }
-                            Err(e) => error!("could not set header: {e}"),
-                        }
-                    }
-                }
-
-                message
+            Content::ForwardedMail { ref raw, .. } => {
+                build_forwarded_message(email_builder, self.name(), raw)?
             }
         };
 
@@ -371,3 +281,98 @@ impl Endpoint for SmtpEndpoint {
         self.config.disable.unwrap_or_default()
     }
 }
+
+/// Construct a lettre `Message` from a raw email message.
+#[cfg(feature = "mail-forwarder")]
+fn build_forwarded_message(
+    email_builder: lettre::message::MessageBuilder,
+    endpoint_name: &str,
+    raw: &[u8],
+) -> Result<Message, Error> {
+    use lettre::message::header::ContentTransferEncoding;
+    use lettre::message::Body;
+    use tracing::error;
+
+    let parsed_message = mail_parser::Message::parse(raw)
+        .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
+
+    let root_part = parsed_message
+        .part(0)
+        .ok_or_else(|| Error::Generic("root message part not present".to_string()))?;
+
+    let raw_body = parsed_message
+        .raw_message()
+        .get(root_part.offset_body..root_part.offset_end)
+        .ok_or_else(|| Error::Generic("could not get raw body content".to_string()))?;
+
+    // We assume that the original message content is already properly
+    // encoded, thus we add the original message body in 'Binary' encoding.
+    // This prohibits lettre from trying to re-encode our raw body data.
+    // lettre will automatically set the `Content-Transfer-Encoding: binary` header,
+    // which we need to remove. The actual transfer encoding is later
+    // copied from the original message headers.
+    let body = Body::new_with_encoding(raw_body.to_vec(), ContentTransferEncoding::Binary)
+        .map_err(|_| Error::Generic("could not create body".into()))?;
+    let mut message = email_builder
+        .subject(parsed_message.subject().unwrap_or_default())
+        .body(body)
+        .map_err(|err| Error::NotifyFailed(endpoint_name.into(), Box::new(err)))?;
+    message
+        .headers_mut()
+        .remove_raw("Content-Transfer-Encoding");
+
+    // Copy over all headers that are relevant to display the original body correctly.
+    // Unfortunately this is a bit cumbersome, as we use separate crates for mail parsing (mail-parser)
+    // and creating/sending mails (lettre).
+    // Note: Other MIME-Headers, such as Content-{ID,Description,Disposition} are only used
+    // for body-parts in multipart messages, so we can ignore them for the messages headers.
+    // Since we send the original raw body, the part-headers will be included any way.
+    for header in parsed_message.headers() {
+        let header_name = header.name.as_str();
+        // Email headers are case-insensitive, so convert to lowercase...
+        let value = match header_name.to_lowercase().as_str() {
+            "content-type" => {
+                if let mail_parser::HeaderValue::ContentType(ct) = header.value() {
+                    // mail_parser does not give us access to the full decoded and unfolded
+                    // header value, so we unfortunately need to reassemble it ourselves.
+                    // Meh.
+                    let mut value = ct.ctype().to_string();
+                    if let Some(subtype) = ct.subtype() {
+                        value.push('/');
+                        value.push_str(subtype);
+                    }
+                    if let Some(attributes) = ct.attributes() {
+                        use std::fmt::Write;
+
+                        for attribute in attributes {
+                            let _ = write!(&mut value, "; {}=\"{}\"", attribute.0, attribute.1);
+                        }
+                    }
+                    Some(value)
+                } else {
+                    None
+                }
+            }
+            "content-transfer-encoding" | "mime-version" => {
+                if let mail_parser::HeaderValue::Text(text) = header.value() {
+                    Some(text.to_string())
+                } else {
+                    None
+                }
+            }
+            _ => None,
+        };
+
+        if let Some(value) = value {
+            match HeaderName::new_from_ascii(header_name.into()) {
+                Ok(name) => {
+                    let header = HeaderValue::new(name, value);
+                    message.headers_mut().insert_raw(header);
+                }
+                Err(e) => error!("could not set header: {e}"),
+            }
+        }
+    }
+
+    Ok(message)
+}
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox 2/3] notify: smtp: add test for building forwarded messages
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
                   ` (3 preceding siblings ...)
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 1/3] notify: smtp: move building of forwarded mails to separate function Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 3/3] notify: update mail-parser dependency to 0.11 Lukas Wagner
  2025-05-26 14:01 ` [pve-devel] applied: [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Thomas Lamprecht
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-notify/src/endpoints/smtp.rs          |  32 ++++++
 proxmox-notify/testdata/test1.msg             | 104 ++++++++++++++++++
 .../test_forward_message_from_raw.ref         |  95 ++++++++++++++++
 3 files changed, 231 insertions(+)
 create mode 100644 proxmox-notify/testdata/test1.msg
 create mode 100644 proxmox-notify/testdata/test_forward_message_from_raw.ref

diff --git a/proxmox-notify/src/endpoints/smtp.rs b/proxmox-notify/src/endpoints/smtp.rs
index 2f4bad3c..7ad85de8 100644
--- a/proxmox-notify/src/endpoints/smtp.rs
+++ b/proxmox-notify/src/endpoints/smtp.rs
@@ -376,3 +376,35 @@ fn build_forwarded_message(
 
     Ok(message)
 }
+
+#[cfg(all(test, feature = "mail-forwarder"))]
+mod tests {
+    use lettre::message::header::Date;
+
+    use super::*;
+
+    #[test]
+    fn test_forward_message_from_raw() {
+        let input = "testdata/test1.msg";
+        let reference = "testdata/test_forward_message_from_raw.ref";
+
+        let mut email_builder =
+            Message::builder().from("Sender <sender@example.com>".parse().unwrap());
+
+        email_builder = email_builder.to("Recipient <recipient@example.com>".parse().unwrap());
+
+        let raw_mail = std::fs::read(input).unwrap();
+        let mut message = build_forwarded_message(email_builder, "test", &raw_mail).unwrap();
+
+        // The Date header contains the current time, let's just remove it
+        // for this test.
+        message.headers_mut().remove::<Date>();
+
+        let formatted = message.formatted();
+
+        // Uncomment to update the reference file.
+        // std::fs::write(reference, &formatted).unwrap();
+
+        assert_eq!(formatted, std::fs::read(reference).unwrap());
+    }
+}
diff --git a/proxmox-notify/testdata/test1.msg b/proxmox-notify/testdata/test1.msg
new file mode 100644
index 00000000..634e7522
--- /dev/null
+++ b/proxmox-notify/testdata/test1.msg
@@ -0,0 +1,104 @@
+From root@host.example.com  Fri May 23 11:59:32 2025
+Return-Path: <root@host.example.com>
+X-Original-To: root
+Delivered-To: root@host.example.com
+Received: by host.example.com (Postfix, from userid 0)
+	id 25CE920081A; Fri, 23 May 2025 11:59:32 +0200 (CEST)
+Content-Type: multipart/alternative;
+	boundary="----_=_NextPart_002_1747994372"
+MIME-Version: 1.0
+Subject: vzdump backup status (host.example.com): backup successful 
+From: Proxmox VE <root@host.example.com>
+To: root@host.example.com
+Date: Fri, 23 May 2025 11:59:32 +0200
+Auto-Submitted: auto-generated;
+Message-Id: <20250523095932.25CE920081A@host.example.com>
+
+This is a multi-part message in MIME format.
+
+------_=_NextPart_002_1747994372
+Content-Type: text/plain;
+	charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+
+Details
+=======
+VMID    Name         Status    Time    Size           Filename                                                       
+187     smtp-sink    ok        11s     430.758 MiB    /var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst    
+
+Total running time: 11s
+Total size: 430.758 MiB
+
+Logs
+====
+vzdump 187 --compress zstd --notes-template '{{guestname}}' --remove 0 --storage local --mode snapshot --notification-mode notification-system --node host
+
+
+187: 2025-05-23 11:59:21 INFO: Starting Backup of VM 187 (lxc)
+187: 2025-05-23 11:59:21 INFO: status = stopped
+187: 2025-05-23 11:59:21 INFO: backup mode: stop
+187: 2025-05-23 11:59:21 INFO: ionice priority: 7
+187: 2025-05-23 11:59:21 INFO: CT Name: smtp-sink
+187: 2025-05-23 11:59:21 INFO: including mount point rootfs ('/') in backup
+187: 2025-05-23 11:59:21 INFO: creating vzdump archive '/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst'
+187: 2025-05-23 11:59:32 INFO: Total bytes written: 1519319040 (1.5GiB, 135MiB/s)
+187: 2025-05-23 11:59:32 INFO: archive file size: 430MB
+187: 2025-05-23 11:59:32 INFO: adding notes to backup
+187: 2025-05-23 11:59:32 INFO: Finished Backup of VM 187 (00:00:11)
+
+
+
+------_=_NextPart_002_1747994372
+Content-Type: text/html;
+	charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+<html>
+    <body>
+        
+        <h1 style="font-size: 1.2em">Details</h1>
+        <table style="border: 1px solid;border-collapse=collapse;">
+            <tr>
+                <th style="border: 1px solid;border-collapse=collapse;">VMID</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Name</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Status</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Time</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Size</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Filename</th>
+            </tr>
+        
+            <tr>
+                <td style="border: 1px solid;border-collapse=collapse;">187</th>
+                <td style="border: 1px solid;border-collapse=collapse;">smtp-sink</th>
+                <td style="border: 1px solid;border-collapse=collapse;">ok</th>
+                <td style="border: 1px solid;border-collapse=collapse;">11s</th>
+                <td style="border: 1px solid;border-collapse=collapse;">430.758 MiB</th>
+                <td style="border: 1px solid;border-collapse=collapse;">/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst</th>
+            </tr>
+        
+        </table>
+        <br/>
+        Total running time: 11s<br/>
+        Total size: 430.758 MiB<br/>
+        <h1 style="font-size: 1.2em">Logs</h1>
+        <pre>vzdump 187 --compress zstd --notes-template &#x27;{{guestname}}&#x27; --remove 0 --storage local --mode snapshot --notification-mode notification-system --node host
+
+
+187: 2025-05-23 11:59:21 INFO: Starting Backup of VM 187 (lxc)
+187: 2025-05-23 11:59:21 INFO: status &#x3D; stopped
+187: 2025-05-23 11:59:21 INFO: backup mode: stop
+187: 2025-05-23 11:59:21 INFO: ionice priority: 7
+187: 2025-05-23 11:59:21 INFO: CT Name: smtp-sink
+187: 2025-05-23 11:59:21 INFO: including mount point rootfs (&#x27;/&#x27;) in backup
+187: 2025-05-23 11:59:21 INFO: creating vzdump archive &#x27;/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst&#x27;
+187: 2025-05-23 11:59:32 INFO: Total bytes written: 1519319040 (1.5GiB, 135MiB/s)
+187: 2025-05-23 11:59:32 INFO: archive file size: 430MB
+187: 2025-05-23 11:59:32 INFO: adding notes to backup
+187: 2025-05-23 11:59:32 INFO: Finished Backup of VM 187 (00:00:11)
+
+</pre>
+    </body>
+</html>
+
+------_=_NextPart_002_1747994372--
diff --git a/proxmox-notify/testdata/test_forward_message_from_raw.ref b/proxmox-notify/testdata/test_forward_message_from_raw.ref
new file mode 100644
index 00000000..79fede27
--- /dev/null
+++ b/proxmox-notify/testdata/test_forward_message_from_raw.ref
@@ -0,0 +1,95 @@
+From: Sender <sender@example.com>
+To: Recipient <recipient@example.com>
+Subject: vzdump backup status (host.example.com): backup successful
+Content-Type: multipart/alternative;
+ boundary="----_=_NextPart_002_1747994372"
+MIME-Version: 1.0
+
+This is a multi-part message in MIME format.
+
+------_=_NextPart_002_1747994372
+Content-Type: text/plain;
+	charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+
+Details
+=======
+VMID    Name         Status    Time    Size           Filename                                                       
+187     smtp-sink    ok        11s     430.758 MiB    /var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst    
+
+Total running time: 11s
+Total size: 430.758 MiB
+
+Logs
+====
+vzdump 187 --compress zstd --notes-template '{{guestname}}' --remove 0 --storage local --mode snapshot --notification-mode notification-system --node host
+
+
+187: 2025-05-23 11:59:21 INFO: Starting Backup of VM 187 (lxc)
+187: 2025-05-23 11:59:21 INFO: status = stopped
+187: 2025-05-23 11:59:21 INFO: backup mode: stop
+187: 2025-05-23 11:59:21 INFO: ionice priority: 7
+187: 2025-05-23 11:59:21 INFO: CT Name: smtp-sink
+187: 2025-05-23 11:59:21 INFO: including mount point rootfs ('/') in backup
+187: 2025-05-23 11:59:21 INFO: creating vzdump archive '/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst'
+187: 2025-05-23 11:59:32 INFO: Total bytes written: 1519319040 (1.5GiB, 135MiB/s)
+187: 2025-05-23 11:59:32 INFO: archive file size: 430MB
+187: 2025-05-23 11:59:32 INFO: adding notes to backup
+187: 2025-05-23 11:59:32 INFO: Finished Backup of VM 187 (00:00:11)
+
+
+
+------_=_NextPart_002_1747994372
+Content-Type: text/html;
+	charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+<html>
+    <body>
+        
+        <h1 style="font-size: 1.2em">Details</h1>
+        <table style="border: 1px solid;border-collapse=collapse;">
+            <tr>
+                <th style="border: 1px solid;border-collapse=collapse;">VMID</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Name</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Status</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Time</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Size</th>
+                <th style="border: 1px solid;border-collapse=collapse;">Filename</th>
+            </tr>
+        
+            <tr>
+                <td style="border: 1px solid;border-collapse=collapse;">187</th>
+                <td style="border: 1px solid;border-collapse=collapse;">smtp-sink</th>
+                <td style="border: 1px solid;border-collapse=collapse;">ok</th>
+                <td style="border: 1px solid;border-collapse=collapse;">11s</th>
+                <td style="border: 1px solid;border-collapse=collapse;">430.758 MiB</th>
+                <td style="border: 1px solid;border-collapse=collapse;">/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst</th>
+            </tr>
+        
+        </table>
+        <br/>
+        Total running time: 11s<br/>
+        Total size: 430.758 MiB<br/>
+        <h1 style="font-size: 1.2em">Logs</h1>
+        <pre>vzdump 187 --compress zstd --notes-template &#x27;{{guestname}}&#x27; --remove 0 --storage local --mode snapshot --notification-mode notification-system --node host
+
+
+187: 2025-05-23 11:59:21 INFO: Starting Backup of VM 187 (lxc)
+187: 2025-05-23 11:59:21 INFO: status &#x3D; stopped
+187: 2025-05-23 11:59:21 INFO: backup mode: stop
+187: 2025-05-23 11:59:21 INFO: ionice priority: 7
+187: 2025-05-23 11:59:21 INFO: CT Name: smtp-sink
+187: 2025-05-23 11:59:21 INFO: including mount point rootfs (&#x27;/&#x27;) in backup
+187: 2025-05-23 11:59:21 INFO: creating vzdump archive &#x27;/var/lib/vz/dump/vzdump-lxc-187-2025_05_23-11_59_21.tar.zst&#x27;
+187: 2025-05-23 11:59:32 INFO: Total bytes written: 1519319040 (1.5GiB, 135MiB/s)
+187: 2025-05-23 11:59:32 INFO: archive file size: 430MB
+187: 2025-05-23 11:59:32 INFO: adding notes to backup
+187: 2025-05-23 11:59:32 INFO: Finished Backup of VM 187 (00:00:11)
+
+</pre>
+    </body>
+</html>
+
+------_=_NextPart_002_1747994372--
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] [PATCH proxmox 3/3] notify: update mail-parser dependency to 0.11
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
                   ` (4 preceding siblings ...)
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 2/3] notify: smtp: add test for building forwarded messages Lukas Wagner
@ 2025-05-23 12:26 ` Lukas Wagner
  2025-05-26 14:01 ` [pve-devel] applied: [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Thomas Lamprecht
  6 siblings, 0 replies; 8+ messages in thread
From: Lukas Wagner @ 2025-05-23 12:26 UTC (permalink / raw)
  To: pve-devel

Thanks to the regression tests introduced in the previous commit we can
be certain that everything works as it should.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 Cargo.toml                           |  2 +-
 proxmox-notify/src/endpoints/smtp.rs | 12 ++++++------
 proxmox-notify/src/lib.rs            |  3 ++-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 71763c5a..9b91dde0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -90,7 +90,7 @@ ldap3 = { version = "0.11", default-features = false }
 lettre = "0.11.1"
 libc = "0.2.107"
 log = "0.4.17"
-mail-parser = "0.8.2"
+mail-parser = "0.11"
 native-tls = "0.2"
 nix = "0.26.1"
 openssl = "0.10"
diff --git a/proxmox-notify/src/endpoints/smtp.rs b/proxmox-notify/src/endpoints/smtp.rs
index 7ad85de8..b684d8ca 100644
--- a/proxmox-notify/src/endpoints/smtp.rs
+++ b/proxmox-notify/src/endpoints/smtp.rs
@@ -293,17 +293,16 @@ fn build_forwarded_message(
     use lettre::message::Body;
     use tracing::error;
 
-    let parsed_message = mail_parser::Message::parse(raw)
+    let parsed_message = mail_parser::MessageParser::default()
+        .parse(raw)
         .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
 
     let root_part = parsed_message
         .part(0)
         .ok_or_else(|| Error::Generic("root message part not present".to_string()))?;
 
-    let raw_body = parsed_message
-        .raw_message()
-        .get(root_part.offset_body..root_part.offset_end)
-        .ok_or_else(|| Error::Generic("could not get raw body content".to_string()))?;
+    let raw_body = &parsed_message.raw_message()
+        [root_part.offset_body as usize..root_part.offset_end as usize];
 
     // We assume that the original message content is already properly
     // encoded, thus we add the original message body in 'Binary' encoding.
@@ -345,7 +344,8 @@ fn build_forwarded_message(
                         use std::fmt::Write;
 
                         for attribute in attributes {
-                            let _ = write!(&mut value, "; {}=\"{}\"", attribute.0, attribute.1);
+                            let _ =
+                                write!(&mut value, "; {}=\"{}\"", attribute.name, attribute.value);
                         }
                     }
                     Some(value)
diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs
index 12e59474..38d21618 100644
--- a/proxmox-notify/src/lib.rs
+++ b/proxmox-notify/src/lib.rs
@@ -232,7 +232,8 @@ impl Notification {
     }
     #[cfg(feature = "mail-forwarder")]
     pub fn new_forwarded_mail(raw_mail: &[u8], uid: Option<u32>) -> Result<Self, Error> {
-        let message = mail_parser::Message::parse(raw_mail)
+        let message = mail_parser::MessageParser::default()
+            .parse(raw_mail)
             .ok_or_else(|| Error::Generic("could not parse forwarded email".to_string()))?;
 
         let title = message.subject().unwrap_or_default().into();
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

* [pve-devel] applied: [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version
  2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
                   ` (5 preceding siblings ...)
  2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 3/3] notify: update mail-parser dependency to 0.11 Lukas Wagner
@ 2025-05-26 14:01 ` Thomas Lamprecht
  6 siblings, 0 replies; 8+ messages in thread
From: Thomas Lamprecht @ 2025-05-26 14:01 UTC (permalink / raw)
  To: pve-devel, Lukas Wagner

On Fri, 23 May 2025 14:26:09 +0200, Lukas Wagner wrote:
> This series packages the newest version of the `mail-parser` crate along
> with its new `hashify` dep for Debian Trixie.
> 
> The second part of the series adapts proxmox-notify to the changes in `mail-parser`'s
> API.
> 
> debcargo-conf:
> 
> [...]

Applied, thanks!

[1/3] import mail-parser from bookworm
      (no commit info)
[1/3] notify: smtp: move building of forwarded mails to separate function
      commit: 6d28188a3b0309837d6fbc73925681291131228d
[3/3] update mail-parser to 0.11.0
      (no commit info)
[3/3] notify: update mail-parser dependency to 0.11
      commit: a5caa6e12585db53de0e019f1fdd2a4ef875e551


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


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

end of thread, other threads:[~2025-05-26 14:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-23 12:26 [pve-devel] [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 1/3] import mail-parser from bookworm Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 2/3] package hashify 0.2.6 Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH debcargo-config 3/3] update mail-parser to 0.11.0 Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 1/3] notify: smtp: move building of forwarded mails to separate function Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 2/3] notify: smtp: add test for building forwarded messages Lukas Wagner
2025-05-23 12:26 ` [pve-devel] [PATCH proxmox 3/3] notify: update mail-parser dependency to 0.11 Lukas Wagner
2025-05-26 14:01 ` [pve-devel] applied: [PATCH debcargo-config/proxmox 0/6] package `mail-parser` for trixie; update proxmox-notify for newest mail-parser version Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal