How to set up a separate mail submission port (MSP) with Qmail

Because a lot of ISPs have started blocking outgoing port 25 (SMTP) for their users, it's become slightly more difficult to send mail over SMTP via, say, a remotely hosted mail server. If you're using qmail with Bill Shupp's QMail Toaster patch, I've provided instructions here that let you set up an alternate port for authenticated outgoing e-mail, but not incoming e-mail, as specified in RFC 2476.

  1. Download and apply this patch to your netqmail-1.05 source after applying the qmail-toaster patch.
  2. Duplicate your qmail-smtpd service into a new qmail-smtpsubmit service, and change the following in the new service:
  • Change port "25" or "smtp" to "587", which is the standard submission port.
  • Add SUBMISSION="" to the beginning of the "exec tcpserver" line in the run script. For example, here are the contents of my /service/qmail-smtpd/run script:
#!/bin/sh
SUBMISSION="" exec /usr/local/bin/envuidgid vpopmail \
    /usr/local/bin/tcpserver -vHRU \
    -c20 0 587 \
    /usr/local/bin/recordio \
    /var/qmail/bin/qmail-smtpd /var/qmail/vpopmail/bin/vchkpw /bin/true 2>&1
  • Change the log directory in the log/run script to be qmail-smtpsubmit instead of qmail-smtpd.