When using qmail-scanner together with the QMAILQUEUE patch, using the recommended method of enabling qmail-scanner through ":allow,QMAILQUEUE=..." in /etc/tcp.smtp, you're facing the problem that qmail-scanner calls SpamAssassin when using SMTP AUTH because RELAYCLIENT is not set. We still want to use qmail-scanner for these connections (because we want to check for viruses and/or bad attachment types), but tagging _outgoing_ mails as spam doesn't make any sense. Even _if_ your users send out spam (do they?), the recipient has to rely on _his_ anti-spam scanner, not _ours_. Ordinary POP3 logins open up relaying in the tcp.smtp.cdb file, thus causing RELAYCLIENT to be set and QMAILQUEUE not to be set. As this isn't the case with SMTP AUTH, qmail-smtpd is running with QMAILQUEUE set (which causes qmail-smtpd to call qmail-scanner), and with RELAYCLIENT not set as qmail-smtpd handles this internally when using SMTP AUTH. What needs to be done is that the use of SMTP AUTH additionally sets RELAYCLIENT, even if this isn't needed for the actual relaying. That way qmail-scanner knows that the mail is from an authorized source and needs to be scanned for viruses, but it does not send it through SpamAssassin. This patch simply works around this problem through setting RELAYCLIENT in case of a successful authentication.