Posts Tagged ‘djb’

Running second instance of qmail

Tuesday, February 5th, 2008

Running several instances of qmail on one server is quite straight forward process. Although there are several ways to do it, I prefer the following one. My goal was to setup second instance of qmail serving SMTP AUTH (587/tcp) requests along with regular SMTP (25/tcp). I mean no separate queues, same dispatcher, same IP, but different ports. Note, that qmail was installed and configured using Life With Qmail (LWQ) instructions.

1. Let’s stop qmail:

  1. svc -d /var/service/qmail-*

2. Copy existing qmail-smtpd directory and call it differently – let’s say qmail-smtpdauth:

  1. cp -R /var/qmail/supervise/qmail-smtpd /var/qmail/supervise/qmail-smtpdauth

3. Edit the run file located in the qmail-smtpdauth and make necessary changes, like changing port number and similar.

4. You may definitely want to have separate log files for the secondary instance:

  1. mkdir /var/log/qmail/qmail-smtpdauth
  2. chown qmaill /var/log/qmail/qmail-smtpdauth

5. Edit /var/qmail/supervise/qmail-smtpdauth/log/run file and make it log to /var/log/qmail/qmail-smtpdauth.

6. Fire up new instance:

  1. ln -s /var/qmail/supervise/qmail-smtpdauth /var/service

7. Check the new instance is up and running:

  1. sockstat -4 | grep 587
  2. qmaild tcpserver 2246 3 tcp4 10.0.12.1:587 *:*

ezmlm & mailing group being subscriber of another mailing group

Thursday, January 24th, 2008

Let’s say there is ezmlm created mailing group (dev at kaba1ah dot org) and it is included into another ezmlm based group (office at kaba1ah dot org). If you send a message to office at kaba1ah dot org delivery to dev at kaba1ah dot org will be rejected with the following error:

  1. failure: ezmlm-reject:_fatal:_List_address_must_be_in_To:_or_Cc:_(#5.7.0)/

In order to bypass this error check .qmail-office which is responsible for office at kaba1ah dot org mailing list. I use vpopmail so the requested file is located at /home/vpopmail/domains/kaba1ah.org/.qmail-office and replace

  1. |/usr/local/bin/ezmlm-reject '/home/vpopmail/domains/kaba1ah.org/office'

with

  1. |/usr/local/bin/ezmlm-reject -T '/home/vpopmail/domains/kaba1ah.org/office'

Note -T added after ezmlm-reject. This would do the trick. Just out of curiosity: according to man ezmlm-reject:

  1. -T Do not require the list  address in the “To:'' or “Cc:'' header(s).

Finally, here is an entry in ezmlm FAQ:

8.1 Requiring the list address in To:/Cc: headers.

SPAM or junk mail is usually sent by mailing a single message to a large number of (unwilling) recipients. As such, it usually does not contain the E-mail address of all recipients (remember, junk mailers pay for these address lists). By rejecting messages that do not have the list address in the To: or Cc: header(s) a large fraction of spam to the list can be filtered out.

This filter function is activated by default, but will work only if you specify the list directory on the ezmlm-reject(1) command line. To disable this restriction, remove the “DIR” argument from the ezmlm-reject(1) command line, or add the “-T” switch.

By default, this error is logged, and an error message is sent to the sender. Since virtually all the failures will be SPAM and virtually all spam has a faked SENDER, most of these error messages will go to the postmaster. Thus, you may want to use the ezmlm-reject “-q” switch (quiet) to suppress the sender notification.