qmail + vpopmail + ezmlm + mysql: ezmlm list-making notes

I've been setting up nginx, qmail, vpopmail, ezmlm-idx, etc., on my new VPS on slicehost (yay, slicehost!), and figured I'd post my notes in case they're useful to anyone else, since finding even tiny bits and pieces helped along the way and kept me from tearing my hair out while trying to work out how everything fits together. *vbg*

These are my (very brief) notes about how to set up a new mailing list in ezmlm, when using vpopmail's virtual domains with a mysql backend. (Yes, I realize I haven't posted about the parts of the server set up that came first, but these are the most complete notes I have at the moment. *g*)


Conventions used in this post (replace with the appropriate values for your setup as needed in the commands below):

  • Anything surrounded by less than and greater than brackets <like this> is to be replaced with your information as described inbetween the brackets. For example, if you're setting up the news@example.com list, when you see <list name>, you should type news in its place.
  • $ is the just a placeholder for the shell prompt. This is just a visual cue that you’re typing the commands that follow it in at the shell prompt.
  • Anything in brackets ([]) is optional, and only if you need to include it for your set up.

To create a new list

Create the tables for the list in mysql:

$ ezmlm-mktab -d <list name table prefix> | mysql -u <mysqluser> -p -f <database> [-h <host>]

N.B. The list name table prefix (what will be prepended to the standard table names in mysql that ezmlm-mktab creates for the list) doesn't have to match the name of the list. I'm using a combination of the list name and an abbreviation for the domain name, so I can have multiple lists with the same name on different domain names and not run into a table naming convention clash (e.g. news@example.com and news@example2.com would have table name prefixes like e_news and e2_news) how to buy cialis online in australia.

Switch to the superuser:

$ su

Tell ezmlm to maintain the list using the mysql backend:

$ ezmlm-make -6 <host>:<port>:<user>:<password>:<database>:<list name table prefix> /var/vpopmail/domains/<domain name>/<list name> /var/vpopmail/domains/<domain name>/.qmail-<list name> <list name> <domain name>

Set the owner's email:

$ ezmlm-make -+ -e5 <owner's email> /var/vpopmail/domains/<domain name>/<list name>

Set the other list properties:

$ ezmlm-make -+ -eADfHIJmopRStx /var/vpopmail/domains/<domain name>/<list name>

(The options for ezmlm-make are here, but the short description of what this combination does is make a moderated list with no archive to which only the moderators can post; an announcement list, in effect.)

To edit the subject line prefix (it defaults to the list name, e.g. list of list@domain.com):

$ nano /var/vpopmail/domains/<domain name>/<list name>/prefix

To edit the footer info (text you want to appear at the bottom of every email sent to the list, like subscription/unsubscription info):

$ nano /var/vpopmail/domains/<domain name>/<list name>/text/trailer

To manually subscribe someone at the command line (no confirmation required):

$ ezmlm-sub -m /var/vpopmail/domains/<domain name>/<list name> <email to subscribe to the list>

Add a moderator:

$ ezmlm-sub -m /var/vpopmail/domains/<domain name>/<list name>/mod <moderator's email>

Gotchas:

  • All .qmail* files need to be chmod'd 700 (not executable) – I discovered that when I got errors like this: Uh-oh:_.qmail_has_prog_delivery_but_has_x_bit_set
  • vpopmail has to be compiled & set up as the user/group combo you set up for vpopmail, because it runs as that user; therefore, all files in the /var/vpopmail directories need to be owned by that user and group
  • Make sure to add ezmlm to your PATH, or the shell will tell you that the program doesn't exist and won't let you do anything. (Well, you could, but you'd have to type /usr/local/bin/ezmlm/ezmlm-make every time instead of ezmlm-make. *g*) If you use bash, add this to your .bashrc: export PATH=$PATH:/usr/local/bin/ezmlm (Assuming you installed ezmlm in the default location.)
  • If you're having connection issues, and you know you've got the username and password right (because you've tried logging in to mysql directly with them, right? *vbg*), you might have some permission issues for that user; make sure it has the "lock tables" privs (tip from here)
  • My database user's privileges in mysql: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES on <database>.* to '<user>'@'<host>' identified by '<password>';

Leave a Reply