Commit 6443ee35 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

All mails sent by server have the same sender

parent 0ad0a931
......@@ -228,11 +228,11 @@ let string_of_user {user_domain; user_name} =
let underscorize x =
String.map (function '-' -> '_' | c -> c) x
let send_email from to_ subject body =
let send_email recipient subject body =
let contents =
Netsendmail.compose
~from_addr:("Belenios public server", from)
~to_addrs:[to_, to_]
~from_addr:("Belenios public server", "noreply@belenios.org")
~to_addrs:[recipient, recipient]
~in_charset:`Enc_utf8 ~out_charset:`Enc_utf8
~subject body
in
......
......@@ -123,6 +123,6 @@ val string_of_user : user -> string
val underscorize : string -> string
val send_email : string -> string -> string -> string -> unit Lwt.t
val send_email : string -> string -> string -> unit Lwt.t
val split_identity : string -> string * string
......@@ -62,7 +62,7 @@ module Make (D : ELECTION_DATA) (M : RANDOM with type 'a t = 'a Lwt.t) : WEB_ELE
~service:Web_services.election_home x |> rewrite_prefix
in
let body = Mail_templates.confirmation user title hash url1 url2 in
send_email "noreply@belenios.org" email subject body
send_email email subject body
let do_cast rawballot (user, date) =
let voters = Lwt_io.lines_of_file (!spool_dir / uuid / "voters.txt") in
......
......@@ -427,7 +427,7 @@ let generate_password title url id =
let hashed = sha256_hex (salt ^ password) in
let body = Mail_templates.password title login password url in
let subject = "Your password for election " ^ title in
send_email "noreply@belenios.org" email subject body >>
send_email email subject body >>
return (salt, hashed)
let handle_password se uuid ~force voters =
......@@ -750,7 +750,7 @@ let () =
in
let body = Mail_templates.credential title login cred url in
let subject = "Your credential for election " ^ title in
lwt () = send_email "noreply@belenios.org" email subject body in
lwt () = send_email email subject body in
return @@ S.add pub_cred accu
) S.empty se.se_voters
in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment