chiark / gitweb /
set return-path
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Dec 2020 17:05:58 +0000 (17:05 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Dec 2020 17:05:58 +0000 (17:05 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/spec.rs

index 9c9f09e6bf3c16c1f5ff1dbebd050c7844058f2c..b8948ed883718d87e11da659aa26a3563dd47cf5 100644 (file)
@@ -403,6 +403,9 @@ pub mod implementation {
                    ipl: &IPlayerState,
                    token: AccessTokenInfo)
                    -> AccessTokenReport {
+      let sendmail = &config().sendmail;
+      let mut command = Command::new(sendmail);
+
       #[derive(Debug,Serialize)]
       struct CommonData<'r> {
         player_email: &'r str,
@@ -435,6 +438,7 @@ pub mod implementation {
             unix_user: user,
             common,
           };
+          command.args(&["-f", &user]);
           nwtemplates::render("token-unix.tera", &data)
         },
         _ => {
@@ -461,8 +465,6 @@ pub mod implementation {
         Ok::<_,AE>(messagefile)
       })().context("write email to temporary file.")?;
 
-      let sendmail = &config().sendmail;
-      let mut command = Command::new(sendmail);
       command
         .args(&["-oee","-odb","-oi","-t","--"])
         .stdin(messagefile);