Email Distribution Lists within cPanel
A client of mine recently asked if I could setup an e-mail distribution list for them. They don’t regularly use a robust email client so setting up the distribution list that way was a no go. This wouldn’t have worked for them anyway because they wanted an actual email address that would receive mail and then deliver that mail to certain users. I could have set up forwarders but that really what was called for in this instance. They are hosted on a site that uses cPanel and their email accounts are configured within cPanel on their host. They wanted two distribution lists, one to go to the executives: firstname.lastname@example.org, and another to go to the sales people (and also the executives): email@example.com.
First you need to create two new mail accounts, one for each of your “distribution lists”, in this case firstname.lastname@example.org and email@example.com. This can be done in the “Email Accounts” item of the “Mail” section on cPanel.
The nice thing about doing it this way (as opposed to creating a forwarder, or some other method) is that you can nest the lists. You see my client wanted the executives to also receive the sales emails. I can create the executives list and then use that address within the sales list. Pretty cool (plus I don’t have to maintain the same people within two lists). I’m a lazy programmer at heart and this makes my life easier maintaining the lists.
So after creating the two new email accounts, we’ll start with the firstname.lastname@example.org first. Go into “User-Level Filtering” within the “Mail” section of cPanel (be sure that you go into “User-Level Filtering” and not “Account-Level Filtering”). Find the email account you just created (email@example.com in our case here) and click on the “Manage Filters” link for that account. This will take you to a screen showing all of the filters for that email account (of which there shouldn’t be any). Click the “Create a new filter” button. This should open a page similar to the one below.
Enter an appropriate name into the “Filter Name” text box (I entered “Distribution List”). Within this page you can setup all sorts of rules for email filtering but none of those other rules/filters interest us because we only want to create a distribution list. Any email that comes to into this account, we want it to be delivered to a list of people we choose. So create one rule that is set to “Any Recipient”, “matches regex” with a RegEx value of “.*”. This just says that anything that comes into this account addressed to anyone (whether in the “To” field, the “CC” field, and it even works if it is in the “BCC” field) this rule will be applied.
Now down below you can add your “Members” to your “Distribution List”. Be sure to select “Redirect to Email” in the dropdown box. This will then display a textbox. Enter the first person’s email address in this box. As a note, this a redirect of any and all email to firstname.lastname@example.org and not a forward. Nothing will ever get into the inbox of email@example.com. To add more people to receive these emails, simply click the “+” button and repeat the steps above. Click the “Create” button when done and that’s it. Now anything emailed to firstname.lastname@example.org will be delivered to Bob, Alice, and Carol.
Now repeat the process above to create your sales distribution list. Add the email addresses of all your sales people and then we also need to add email@example.com because the client wants the executives to also receive any email directed to the salespeople.
I’ve tested this and it works just like I would want it. Another nice thing about this if someone receiving an email from firstname.lastname@example.org replies to the email, the email will come from their email account but if they happened to “reply all”, their fellow executives will also see their response.