public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 many 0/8] notifications: add SMTP endpoint
Date: Thu, 31 Aug 2023 16:30:14 +0200	[thread overview]
Message-ID: <20230831143022.685011-1-l.wagner@proxmox.com> (raw)

This patch series adds support for a new notification endpoint type,
smtp. As the name suggests, this new endpoint allows PVE to talk
to SMTP server directly, without using the system's MTA (postfix).

On the Rust side, these patches add a new dependency to the `lettre`
crate for SMTP communication. This crate was chosen as it is:
  - by far the most popular mailing crate for Rust
  - well maintained
  - has reasonable dependencies
  - has async support, enabling us to asyncify the proxmox-notify
    crate at some point, if needed

These patches are based on top of the `system mail` patch series [1].
From [1], we need the patches for `proxmox` and `proxmox-perl-rs`.
If `pve-docs` from [1] is not applied first, there might be a small conflict,
however that one should be trivial to resolve.

Tested against
  - the gmail SMTP server
  - the posteo SMTP server

Changes since v1:
  - Rebased on top of [1]
  - Added a mechanism for mails forwarded by `proxmox-mail-forward`
    These are forwarded inline as "message/rfc822" to avoid having 
    to rewrite mail headers (otherwise, some SMTP relays might reject the 
    mail, because the `From` header of the forwarded mail does not match the
    mail account)

[1] https://lists.proxmox.com/pipermail/pve-devel/2023-August/058956.html



proxmox:

Lukas Wagner (3):
  notify: add 'smtp' endpoint
  notify: add api for smtp endpoints
  notify: fix typo in doc comments

 Cargo.toml                                  |   1 +
 proxmox-notify/Cargo.toml                   |   4 +-
 proxmox-notify/src/api/mod.rs               |  48 +++
 proxmox-notify/src/api/smtp.rs              | 373 ++++++++++++++++++++
 proxmox-notify/src/config.rs                |  23 ++
 proxmox-notify/src/endpoints/common/mail.rs |  24 ++
 proxmox-notify/src/endpoints/common/mod.rs  |   2 +
 proxmox-notify/src/endpoints/mod.rs         |   4 +
 proxmox-notify/src/endpoints/sendmail.rs    |  22 +-
 proxmox-notify/src/endpoints/smtp.rs        | 260 ++++++++++++++
 proxmox-notify/src/lib.rs                   |  19 +-
 11 files changed, 761 insertions(+), 19 deletions(-)
 create mode 100644 proxmox-notify/src/api/smtp.rs
 create mode 100644 proxmox-notify/src/endpoints/common/mail.rs
 create mode 100644 proxmox-notify/src/endpoints/common/mod.rs
 create mode 100644 proxmox-notify/src/endpoints/smtp.rs


proxmox-perl-rs:

Lukas Wagner (1):
  notify: add bindings for smtp API calls

 common/src/notify.rs | 110 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)


pve-manager:

Lukas Wagner (1):
  notify: add API routes for smtp endpoints

 PVE/API2/Cluster/Notifications.pm | 337 ++++++++++++++++++++++++++++++
 1 file changed, 337 insertions(+)


proxmox-widget-toolkit:

Lukas Wagner (2):
  panel: notification: add gui for SMTP endpoints
  panel: notification: fix `gettext` calls

 src/Makefile                        |   2 +
 src/Schema.js                       |   5 +
 src/panel/EmailRecipientPanel.js    |  89 +++++++++++++
 src/panel/NotificationConfigView.js |  10 +-
 src/panel/SendmailEditPanel.js      |  69 ++--------
 src/panel/SmtpEditPanel.js          | 192 ++++++++++++++++++++++++++++
 6 files changed, 304 insertions(+), 63 deletions(-)
 create mode 100644 src/panel/EmailRecipientPanel.js
 create mode 100644 src/panel/SmtpEditPanel.js


pve-docs:

Lukas Wagner (1):
  notifications: document SMTP endpoints

 notifications.adoc | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)


Summary over all repositories:
  20 files changed, 1540 insertions(+), 82 deletions(-)

-- 
murpp v0.4.0





             reply	other threads:[~2023-08-31 14:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 14:30 Lukas Wagner [this message]
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox 1/8] notify: add 'smtp' endpoint Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox 2/8] notify: add api for smtp endpoints Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox 3/8] notify: fix typo in doc comments Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox-perl-rs 4/8] notify: add bindings for smtp API calls Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 pve-manager 5/8] notify: add API routes for smtp endpoints Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox-widget-toolkit 6/8] panel: notification: add gui for SMTP endpoints Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 proxmox-widget-toolkit 7/8] panel: notification: fix `gettext` calls Lukas Wagner
2023-08-31 14:30 ` [pve-devel] [PATCH v2 pve-docs 8/8] notifications: document SMTP endpoints Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230831143022.685011-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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