Here you can find my patches for qmail 1.03. If you are interested in a modern SMTP engine for qmail featuring IPv6 support and everything below have a look at Qsmtp.
Another small thing that may help you today is my qmail-send.service file for systemd.
I've put some of the fixes below as well as some other fixes into a GitHub repository.
if (!smtps) { stralloc *sa = ehlokw.sa; unsigned int len = ehlokw.len; /* look for STARTTLS among EHLO keywords */ for ( ; len && case_diffs(sa->s, "STARTTLS"); ++sa, --len) ; if (!len) { if (!servercert) return 0; out("ZNo TLS achieved while "); out(servercert); out(" exists"); smtptext.len = 0; TLS_QUIT; } }
qmail-inject can parse the message header to determine the recipients of a mail. You can also pass it a list of recipients on command line so it will ignore the recipients stated in the header. This is e.g. used when you redirect a mail by a .qmail file. But even if those recipients will not be used the header fields will still be parsed and a bounce is generated on failure.
If a mail is injected from network with the broken header field "To: foo: bar, baz" then this would be delivered fine as the recipient is given in the SMTP transmission. If it could not be directly delivered but is forwarded to another user by a .qmail file or a virtualdomain alias then this mail is passed through "qmail-inject -a newrecipient". Nevertheless the header fields are parsed, the error is raised and the message is bounced. This leads to ugly bounces with the message "qmail-inject: fatal: unable to parse this line:". Since the message is of course spam the bounce will bounce again and annoy the postmaster. This patch changes qmail-inject to totally ignore the lines with recipients (To:, Cc:, Bcc) if the recipients were passed as arguments. In this case the mail will be routed to the original recipient and can there be handled.