public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 3/4] server: use configured email-from for sending mail
Date: Thu, 16 Dec 2021 10:59:23 +0100	[thread overview]
Message-ID: <8300ab22-adb3-0e70-4083-a330a5bd751a@proxmox.com> (raw)
In-Reply-To: <20211214124408.17003-4-h.laimer@proxmox.com>

comment inline

On 12/14/21 13:44, Hannes Laimer wrote:
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>   src/server/email_notifications.rs | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/server/email_notifications.rs b/src/server/email_notifications.rs
> index 1e7650b0..0dc0cba5 100644
> --- a/src/server/email_notifications.rs
> +++ b/src/server/email_notifications.rs
> @@ -235,6 +235,10 @@ fn send_job_status_mail(
>       text: &str,
>   ) -> Result<(), Error> {
>   
> +    let _lock = crate::config::node::lock()?;
if you only read from the config, you do not need to lock it

we normally atomically replace the config on change, so a read
should always result in a valid config


> +    let (config, _) = crate::config::node::config()?;
> +    let from = config.email_from;
> +
>       // Note: OX has serious problems displaying text mails,
>       // so we include html as well
>       let html = format!("<html><body><pre>\n{}\n<pre>", handlebars::html_escape(text));
> @@ -248,7 +252,7 @@ fn send_job_status_mail(
>           &subject,
>           Some(&text),
>           Some(&html),
> -        None,
> +        from.as_deref(),
>           Some(&author),
>       )?;
>   





  reply	other threads:[~2021-12-16  9:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 12:44 [pbs-devel] [PATCH proxmox-backup 0/4] close #3162: add options to configure mail_from address Hannes Laimer
2021-12-14 12:44 ` [pbs-devel] [PATCH proxmox-backup 1/4] config: add email-from to NodeConfig Hannes Laimer
2021-12-14 12:44 ` [pbs-devel] [PATCH proxmox-backup 2/4] api2: make email-from updatable Hannes Laimer
2021-12-14 12:44 ` [pbs-devel] [PATCH proxmox-backup 3/4] server: use configured email-from for sending mail Hannes Laimer
2021-12-16  9:59   ` Dominik Csapak [this message]
2021-12-14 12:44 ` [pbs-devel] [PATCH proxmox-backup 4/4] ui: add new options tab under configuration Hannes Laimer
2021-12-16 10:04   ` Dominik Csapak

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=8300ab22-adb3-0e70-4083-a330a5bd751a@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pbs-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