Chapter 2. Principles

SMTP from Network                   from local
remote mailserver      
      |
      | 
tcpserver / inetd                      MUA
      |                                 |
      |                                 |
 qmail-smtpd                       qmail-inject
      |                                 |
      |                                 |
       --------------     --------------
                     |   |
                     |   |
                     |   |
                  qmail-queue
                       |
                       |
                   qmail-send

The detailed qmail picture can be found here : http://www.nrg4u.com/qmail/the-big-qmail-picture-103-p1.gif.

Remote mail (via qmail-smtpd) and local mail (via qmail-inject) is queued by delivering the mail to qmail-queue. qmail-queue gets the e-mails from standart input. In compliance with this, qmail-smtpd and qmail-inject writes the e-mails to standart output.

When qSheff is running, the install script move qmail-queue to qmail-queue.orig(If the qmailqueue patch installed qmail-smtd gets qmail-queue/qmail-qsheff path from the environment. See the qmailqueue patch). qmail-queue is linked to qSheff. If you enable qmailqueue patch, qmail-queue will not be moved. qmail executes qSheff instead of qmail-queue and then qSheff delivers email to qmail-queue. By both of these ways, the e-mails sent by qmail-smtpd and qmail-inject are received by qSheff. A system where qSheff is running looks like Figure 2.

SMTP from Network                   from local
remote mailserver      
      |
      | 
tcpserver / inetd                      MUA
      |                                 |
      |                                 |
 qmail-smtpd                       qmail-inject
      |                                 |
      |                                 |
       --------------    ---------------
                     |  |
                     |  |
                     |  |
                    qSheff
                       |
                       |
                  qmail-queue
                       |
                       |
                   qmail-send

After running its own modules, qSheff does one of the following :

If the qSheff configured with --enable-subject-tag option, qSheff will deliver the spam message with a tagged subject.