From ward@ba.be Tue Sep 26 08:35:02 2000 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["4012" "Tue" "26" "September" "2000" "10:30:53" "+0200" "Ward Vandewege" "ward@ba.be" "<38079394@toto.iv>" "72" "patch for qmail 1.03" "^From:" nil nil "9" nil nil nil nil nil] nil) Return-Path: Delivered-To: nelson@desk.crynwr.com Received: (qmail 30426 invoked from network); 26 Sep 2000 08:35:02 -0000 Received: from ns1.crynwr.com (HELO ns.crynwr.com) (192.203.178.14) by desk.crynwr.com with SMTP; 26 Sep 2000 08:35:02 -0000 Received: (qmail 11135 invoked by uid 500); 26 Sep 2000 08:32:08 -0000 Delivered-To: nelson@ns.crynwr.com Received: (qmail 11132 invoked by alias); 26 Sep 2000 08:32:08 -0000 Delivered-To: alias-qmail-nelson@qmail.org Received: (qmail 11129 invoked from network); 26 Sep 2000 08:32:08 -0000 Received: from hercules.telenet-ops.be (HELO smtp.pandora.be) (195.130.132.33) by www.qmail.org with SMTP; 26 Sep 2000 08:32:08 -0000 Received: (qmail 24867 invoked from network); 26 Sep 2000 08:31:31 -0000 Received: from unknown (HELO ba.be) ([195.130.158.45]) (envelope-sender ) by hercules.telenet-ops.be (qmail-ldap-1.03) with SMTP for ; 26 Sep 2000 08:31:31 -0000 Return-Path: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_145591428==_" From: Ward Vandewege To: nelson@qmail.org Subject: patch for qmail 1.03 Date: Tue, 26 Sep 2000 10:30:53 +0200 --=====================_145591428==_ Content-Type: text/plain; charset="us-ascii"; format=flowed Hi, I've just implemented a small patch to qmail, which I thought might be useful to the world. I have duplicated the 'badmailfrom' code for recipients, that is, by placing an e-mail address in a file 'badmailto' in the control directory, email for this user will not even be accepted, the traffic will not pass over the line. This is very useful in a setup where you have one qmail box accepting all the e-mail, and then passing it on to another (q)mail box behind it. With standard qmail, if the user does not exist (anymore) on the second box, the first box will simply accept the mail, and the second will produce a bounce message to the sender. This is not a problem for a small amount of mail, but if someone decides to send massive amounts of email to this user (bounces from a spam-message that used this user's address as the 'from', e.g.), your line might get filled with unnessary traffic. This patch blocks email for specific users in an e-mail domain you accept mail for, before the email even transfers the line. Bye for now, Ward. --=====================_145591428==_ Content-Type: application/octet-stream; name="qmail1.03bmt.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="qmail1.03bmt.patch" LS0tIHFtYWlsLTEuMDMvcW1haWwtc210cGQuYwlNb24gSnVuIDE1IDEyOjUzOjE2IDE5OTgKKysr IHFtYWlsLTEuMDNibXQvcW1haWwtc210cGQuYwlUdWUgU2VwIDI2IDA5OjM4OjA5IDIwMDAKQEAg LTUwLDYgKzUwLDcgQEAKIHZvaWQgc3RyYXluZXdsaW5lKCkgeyBvdXQoIjQ1MSBTZWUgaHR0cDov L3BvYm94LmNvbS9+ZGpiL2RvY3Mvc210cGxmLmh0bWwuXHJcbiIpOyBmbHVzaCgpOyBfZXhpdCgx KTsgfQogCiB2b2lkIGVycl9ibWYoKSB7IG91dCgiNTUzIHNvcnJ5LCB5b3VyIGVudmVsb3BlIHNl bmRlciBpcyBpbiBteSBiYWRtYWlsZnJvbSBsaXN0ICgjNS43LjEpXHJcbiIpOyB9Cit2b2lkIGVy cl9ibXQoKSB7IG91dCgiNTUzIHNvcnJ5LCB0aGlzIHJlY2lwaWVudCBoYXMgZXhjZWVkZWQgdGhl IG1haWwgcXVvdGEgKCM1LjcuMSlcclxuIik7IH0KIHZvaWQgZXJyX25vZ2F0ZXdheSgpIHsgb3V0 KCI1NTMgc29ycnksIHRoYXQgZG9tYWluIGlzbid0IGluIG15IGxpc3Qgb2YgYWxsb3dlZCByY3B0 aG9zdHMgKCM1LjcuMSlcclxuIik7IH0KIHZvaWQgZXJyX3VuaW1wbCgpIHsgb3V0KCI1MDIgdW5p bXBsZW1lbnRlZCAoIzUuNS4xKVxyXG4iKTsgfQogdm9pZCBlcnJfc3ludGF4KCkgeyBvdXQoIjU1 NSBzeW50YXggZXJyb3IgKCM1LjUuNClcclxuIik7IH0KQEAgLTk2LDYgKzk3LDkgQEAKIGludCBi bWZvayA9IDA7CiBzdHJhbGxvYyBibWYgPSB7MH07CiBzdHJ1Y3QgY29uc3RtYXAgbWFwYm1mOwor aW50IGJtdG9rID0gMDsKK3N0cmFsbG9jIGJtdCA9IHswfTsKK3N0cnVjdCBjb25zdG1hcCBtYXBi bXQ7CiAKIHZvaWQgc2V0dXAoKQogewpAQCAtMTE2LDYgKzEyMCwxMSBAQAogICBpZiAoYm1mb2sg PT0gLTEpIGRpZV9jb250cm9sKCk7CiAgIGlmIChibWZvaykKICAgICBpZiAoIWNvbnN0bWFwX2lu aXQoJm1hcGJtZixibWYucyxibWYubGVuLDApKSBkaWVfbm9tZW0oKTsKKworICBibXRvayA9IGNv bnRyb2xfcmVhZGZpbGUoJmJtdCwiY29udHJvbC9iYWRtYWlsdG8iLDApOworICBpZiAoYm10b2sg PT0gLTEpIGRpZV9jb250cm9sKCk7CisgIGlmIChibXRvaykKKyAgICBpZiAoIWNvbnN0bWFwX2lu aXQoJm1hcGJtdCxibXQucyxibXQubGVuLDApKSBkaWVfbm9tZW0oKTsKICAKICAgaWYgKGNvbnRy b2xfcmVhZGludCgmZGF0YWJ5dGVzLCJjb250cm9sL2RhdGFieXRlcyIpID09IC0xKSBkaWVfY29u dHJvbCgpOwogICB4ID0gZW52X2dldCgiREFUQUJZVEVTIik7CkBAIC0yMDgsNiArMjE3LDE3IEBA CiAgIHJldHVybiAwOwogfQogCitpbnQgYm10Y2hlY2soKQoreworICBpbnQgajsKKyAgaWYgKCFi bXRvaykgcmV0dXJuIDA7CisgIGlmIChjb25zdG1hcCgmbWFwYm10LGFkZHIucyxhZGRyLmxlbiAt IDEpKSByZXR1cm4gMTsKKyAgaiA9IGJ5dGVfcmNocihhZGRyLnMsYWRkci5sZW4sJ0AnKTsKKyAg aWYgKGogPCBhZGRyLmxlbikKKyAgICBpZiAoY29uc3RtYXAoJm1hcGJtdCxhZGRyLnMgKyBqLGFk ZHIubGVuIC0gaiAtIDEpKSByZXR1cm4gMTsKKyAgcmV0dXJuIDA7Cit9CisKIGludCBhZGRyYWxs b3dlZCgpCiB7CiAgIGludCByOwpAQCAtMjU4LDYgKzI3OCw3IEBACiAgIH0KICAgZWxzZQogICAg IGlmICghYWRkcmFsbG93ZWQoKSkgeyBlcnJfbm9nYXRld2F5KCk7IHJldHVybjsgfQorICBpZiAo Ym10Y2hlY2soKSkgeyBlcnJfYm10KCk7IHJldHVybjsgfQogICBpZiAoIXN0cmFsbG9jX2NhdHMo JnJjcHR0bywiVCIpKSBkaWVfbm9tZW0oKTsKICAgaWYgKCFzdHJhbGxvY19jYXRzKCZyY3B0dG8s YWRkci5zKSkgZGllX25vbWVtKCk7CiAgIGlmICghc3RyYWxsb2NfMCgmcmNwdHRvKSkgZGllX25v bWVtKCk7Cg== --=====================_145591428==_ Content-Type: text/plain; charset="us-ascii"; format=flowed ---------- I code therefore I am. --=====================_145591428==_--