Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

iam running a postfix mailserver with 2 domains, one real and one virtual domain with Virtual Users, my question is how can i send a "admin message" to all Users of my Mailserver? So i can inform them about Updates/Downtimes ect.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You need to create a distribution list or alias that points to all users. If you are configuring Postfix manually, you can create a new list in /etc/aliases, for example:

allusers: user1, user2, user3

...and just include all users in that alias. Don't forget to use newaliases when you've saved your new /etc/aliases file (should be force of habit by now). You should create scripts to automatically maintain such a distribution list that know how to enumerate all the users on your system. For example if all valid users are in /etc/passwd, you could parse that, or if they all have home directories in /home/, you could list those.

This can be a pain to maintain. You can achieve the same result with a Mailman mailing list using the command-line mailman tools, but you still need to maintain the list of users yourself. More on those here: http://www.gnu.org/software/mailman/site.html

If you are using a GUI administration tool, such as webmin or cpanel, etc., they all have a "send mail to all users" feature.

If you use LDAP as a backend for postfix or to store information about users, mail accounts, mail aliases, and mailing lists, you can create a mailing list/alias using something like a "dynamic group" in LDAP (Google for LDAP dynamic group) and have the abovementioned distribution list automatically generate by your LDAP server. It doesn't sound like you're using LDAP though...

Unfortunately, in the general case of a manually-configured Postfix on a system with potentially many local users, Postfix doesn't necessarily have an enumeration of users ahead of time. For example, it may have to look the username up in getpwent, LDAP, etc. on-demand as mail arrives, depending on your configuration. Sorry to be the bearer of bad news.

EDIT: By the way, if you use the /etc/aliases method, be sure to create a special filter rule for that address in your spam filter to prevent mail coming from the outside from going to it. That way you won't make it easy for spammers.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.