Browse Source

Set receiver address based on the user's type (either Admin or 150)

mario forzanini 2 years ago
parent
commit
249c3b0baa
1 changed files with 6 additions and 2 deletions
  1. 6 2
      lcmlog-server

+ 6 - 2
lcmlog-server

@@ -2,8 +2,6 @@
 
 DIR         = "/var/local/log/lcmlog-data"
 FROM_DOMAIN = "lcm.mi.infn.it"
-TO_ADDRESS  = "working@lcm.mi.infn.it"
-REPLY_TO    = True              # Does this make sense?
 
 import os
 import os.path
@@ -74,6 +72,12 @@ def main():
                                 log = sys.stdin.read()      # Read the log content
                                 if optional_line == "MAIL":
                                         send_mail = True
+                                        if kind == "Admin":
+                                                TO_ADDRESS = "admins@lcm.mi.infn.it"
+                                                REPLY_TO   = True
+                                        else:
+                                                TO_ADDRESS = "working@lcm.mi.infn.it"
+                                                REPLY_TO   = True
                                 else:
                                         send_mail = False
                                         # optional_line consumes the input but it is not