Browse Source

Fix log_mail function

Tuc mail command implementation is different from the one on the
cluster
mario forzanini 2 years ago
parent
commit
c72be5c5c6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lcmlog-server

+ 2 - 2
lcmlog-server

@@ -237,10 +237,10 @@ def log_hash(name):
 def log_mail(kind, user_name, date, tags, log):
 	if REPLY_TO:
                 subprocess.run('printf "%s\n" ' + f'{shlex.quote(log)} | mail -s "Log{kind} {date} {tags}" ' +
-                               f'-r {user}@{FROM_DOMAIN} -a "Reply-to: {TO_ADDRESS}" -- {TO_ADDRESS}', shell=True)
+                               f'-r {user_name}@{FROM_DOMAIN} -S replyto="{TO_ADDRESS}" {TO_ADDRESS}', shell=True)
 	else:
                 subprocess.run('printf "%s\n" ' + f'{shlex.quote(log)} | mail -s "Log{kind} {date} {tags}" ' +
-                               f'-r {user}@{FROM_DOMAIN} -- {TO_ADDRESS}', shell=True)
+                               f'-r {user_name}@{FROM_DOMAIN} {TO_ADDRESS}', shell=True)
 	return