chpc-uofu / arbiter2

A daemon that uses cgroups to monitor and manage user behavior on login nodes
GNU General Public License v2.0
60 stars 5 forks source link

Is there a way to set `admin_emails` to localhost while user emails go through `mail_server`? #5

Closed rokyo249 closed 5 months ago

rokyo249 commented 9 months ago

Hi,

I am trying to get Arbiter2 (v2.1.0) to send the copies of all user mail notifications to /var/mail/root instead of a real email address, while notifications to the users should still go to their actual email address through our mail server.

Is there a way to do this? If I set the parameter admin_mails to root@localhost it tries to send this though our mail server (which is configured in the mail_server parameter in the same config.toml) which doesn't know who root@localhost is. However, if I want the user notifications to arrive at the users' mail addresses, I need to have the mail_server parameter set correctly, or they won't arrive. Is there a way to tell Arbiter to not use the mail server for admin_emails but just for everything else?

Thanks and best regards

jay-mckay commented 9 months ago

I don't believe that this behavior is supported currently unfortunately. I don't think this would be very hard to implement, perhaps another mail server entirely for the admin emails could be added as a configuration option. I will take a look and see about the feasibility of adding something like this.

jay-mckay commented 9 months ago

If you are running an MTA on the same host as arbiter (as it appears you are if you are mailing root@localhost), it may be possible to configure forwarding to different addresses there. This would just translate to the local MTA being used as the mail_server in the arbiter configuration, and rules to forward all emails but the admin ones to the regular mail server. I am by no means an expert on this, so please let me know if I am missing something.

rokyo249 commented 7 months ago

I now just made a script that moves all the arbiter mails to a specific folder in the admin mail account, so it doesn't spam the inbox ;-)