1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-18 19:49:40 +00:00

- Update qmail-spamcontrol to 2.4.14, finally with STARTTLS support

Full ChangeLog at:
	http://www.fehcom.de/qmail/spamcontrol.html
This commit is contained in:
Renato Botelho 2006-05-29 13:32:06 +00:00
parent b8bb9a6d26
commit 5e5767703e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=163839
6 changed files with 13 additions and 324 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= qmail
PORTVERSION= ${QMAIL_VERSION}.${SPAMCONTROL_VERSION}
PORTREVISION= 1
PORTREVISION= 0
CATEGORIES= mail
MASTER_SITES+= http://www.fehcom.de/qmail/spamcontrol/:spamcontrol
PKGNAMESUFFIX= -spamcontrol
@ -21,7 +21,7 @@ EXTRA_PATCHES+= ${MASTERDIR}/files/patch-install.c
# Distfiles
QMAIL_DIST= ${PORTNAME}-${QMAIL_VERSION}${EXTRACT_SUFX}
SPAMCONTROL_DIST= spamcontrol-${SPAMCONTROL_VERSION}_tgz.bin
SPAMCONTROL_VERSION= 2317
SPAMCONTROL_VERSION= 2414
LATEST_LINK= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
SLAVE_SPAMCONTROL= yes

View File

@ -1,282 +0,0 @@
--- ../orig/qmail-smtpd.c.patch Sat Oct 8 10:08:32 2005
+++ qmail-smtpd.c.patch Thu Oct 13 08:37:17 2005
@@ -1,8 +1,6 @@
---- qmail-smtpd.c.orig 1998-06-15
-+++ qmail-smtpd.c 2005-10-08
---- .././qmail-1.03/qmail-smtpd.c Mon Jun 15 12:53:16 1998
-+++ ../qmail-1.03.2317/qmail-smtpd.c Sat Oct 8 15:07:19 2005
-@@ -20,14 +20,51 @@
+--- qmail-smtpd.c.orig Thu Oct 13 08:36:39 2005
++++ qmail-smtpd.c Thu Oct 13 08:36:20 2005
+@@ -20,14 +20,54 @@
#include "now.h"
#include "exit.h"
#include "rcpthosts.h"
@@ -20,6 +18,9 @@
+#define CRAM_MD5
+#define AUTHSLEEP 5
+#define RECIPIENTS550
++// <Added by Garga>
++#define LOCALMFREQAUTH
++// </Added by Garga>
+
+#define MIMETYPE_LEN 9
+#define LOADER_LEN 5
@@ -55,7 +56,7 @@
int safewrite(fd,buf,len) int fd; char *buf; int len;
{
int r;
-@@ -48,9 +85,6 @@
+@@ -48,9 +88,6 @@
void die_control() { out("421 unable to read controls (#4.3.0)\r\n"); flush(); _exit(1); }
void die_ipme() { out("421 unable to figure out my IP addresses (#4.3.0)\r\n"); flush(); _exit(1); }
void straynewline() { out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n"); flush(); _exit(1); }
@@ -65,7 +66,7 @@
void err_unimpl() { out("502 unimplemented (#5.5.1)\r\n"); }
void err_syntax() { out("555 syntax error (#5.5.4)\r\n"); }
void err_wantmail() { out("503 MAIL first (#5.5.1)\r\n"); }
-@@ -58,6 +92,114 @@
+@@ -58,6 +95,114 @@
void err_noop() { out("250 ok\r\n"); }
void err_vrfy() { out("252 send some mail, i'll try my best\r\n"); }
void err_qqt() { out("451 qqt failure (#4.3.0)\r\n"); }
@@ -180,7 +181,7 @@
stralloc greeting = {0};
-@@ -76,6 +218,7 @@
+@@ -76,6 +221,7 @@
smtp_greet("221 "); out("\r\n"); flush(); _exit(0);
}
@@ -188,7 +189,7 @@
char *remoteip;
char *remotehost;
char *remoteinfo;
-@@ -85,10 +228,30 @@
+@@ -85,10 +231,30 @@
stralloc helohost = {0};
char *fakehelo; /* pointer into helohost, or 0 */
@@ -220,7 +221,7 @@
}
int liphostok = 0;
-@@ -97,6 +260,39 @@
+@@ -97,6 +263,42 @@
stralloc bmf = {0};
struct constmap mapbmf;
@@ -248,6 +249,9 @@
+char *localmfcheck;
+char *mfdnscheck;
+char *reqauth;
++// <Added by Garga>
++char *localmf_reqauth;
++// </Added by Garga>
+
+int maxrcptcount = 0;
+int flaglocal = -1;
@@ -260,7 +264,7 @@
void setup()
{
char *x;
-@@ -111,17 +307,24 @@
+@@ -111,17 +313,24 @@
if (timeout <= 0) timeout = 1;
if (rcpthosts_init() == -1) die_control();
@@ -286,7 +290,7 @@
remoteip = env_get("TCPREMOTEIP");
if (!remoteip) remoteip = "unknown";
local = env_get("TCPLOCALHOST");
-@@ -131,11 +334,72 @@
+@@ -131,11 +340,80 @@
if (!remotehost) remotehost = "unknown";
remoteinfo = env_get("TCPREMOTEINFO");
relayclient = env_get("RELAYCLIENT");
@@ -338,6 +342,14 @@
+ qhpsi = env_get("QHPSI");
+ if (!qhpsi) qhpsi = "unknown";
+
++// <Added by Garga>
++#ifdef LOCALMFREQAUTH
++ localmf_reqauth = env_get("LOCALMFREQAUTH");
++#else
++ localmf_reqauth = 0;
++#endif
++// </Added by Garga>
++
+#ifdef RELAYMAILFROM
+ if (!relayclient) {
+ relaymailfromok = control_readfile(&relaymailfrom,"control/relaymailfrom",0);
@@ -360,7 +372,7 @@
int addrparse(arg)
char *arg;
-@@ -151,12 +415,17 @@
+@@ -151,12 +429,17 @@
i = str_chr(arg,'<');
if (arg[i])
arg += i + 1;
@@ -378,17 +390,12 @@
/* strip source route */
if (*arg == '@') while (*arg) if (*arg++ == ':') break;
-@@ -199,12 +468,106 @@
+@@ -199,12 +482,106 @@
int bmfcheck()
{
+ int i;
- int j;
-- if (!bmfok) return 0;
-- if (constmap(&mapbmf,addr.s,addr.len - 1)) return 1;
-- j = byte_rchr(addr.s,addr.len,'@');
-- if (j < addr.len)
-- if (constmap(&mapbmf,addr.s + j,addr.len - j - 1)) return 1;
++ int j;
+ int k = 0;
+ char subvalue;
+
@@ -439,7 +446,12 @@
+int bhelocheck()
+{
+ int i;
-+ int j;
+ int j;
+- if (!bmfok) return 0;
+- if (constmap(&mapbmf,addr.s,addr.len - 1)) return 1;
+- j = byte_rchr(addr.s,addr.len,'@');
+- if (j < addr.len)
+- if (constmap(&mapbmf,addr.s + j,addr.len - j - 1)) return 1;
+ int k = 0;
+ char subvalue;
+
@@ -490,7 +502,7 @@
return 0;
}
-@@ -216,54 +579,205 @@
+@@ -216,54 +593,219 @@
return r;
}
@@ -511,7 +523,6 @@
+ j = byte_rchr(addr.s,addr.len,'@');
+ if (j < addr.len)
+ if (!str_diffn(localmfcheck,addr.s+j+1,addr.len-j-1)) return 1;
-+ else return 0;
+ }
+ return addrallowed();
+}
@@ -586,6 +597,18 @@
+ }
+}
+
++// <Added by Garga>
++int mailfromallowed()
++{
++ int r;
++
++ r = rcpthosts(mailfrom.s,strlen(mailfrom.s));
++ if (r == -1) die_control();
++
++ return ((r == 1) ? 0 : 1);
++}
++// </Added by Garga>
++
+#ifdef RELAYMAILFROM
+int rmfcheck()
+{
@@ -632,7 +655,6 @@
- flagbarf = bmfcheck();
- seenmail = 1;
+ flagsize = 0;
-+ rcptcount = 0;
+ mailfrom_parms(arg);
+ seenmail++;
+ if (relayclient) {
@@ -669,6 +691,9 @@
+ if (flagbarf) { err_bmf("Reject::ORIG::Bad_Mailfrom:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
+ if (flagdnsmf > 0) { err_mfdns("Reject::ORIG::DNS_MF:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
+ if (reqauth) if (!flagauth) { err_authreq("Reject::ORIG::Missing_Auth:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
++ // <Added by Garga>
++ if (localmf_reqauth && !flagauth && !mailfromallowed()) { err_authreq("Reject::ORIG::Local_MailFrom_Req_Auth:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
++ // </Added by Garga>
+ flagrcpt = rcptallowed();
+ if (!flagrcpt) { err_recipient("Reject::RCPT::Failed_Rcptto:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); flagerrcpts++; return; }
+ if (tarpitcount && flagerrcpts >= tarpitcount) { err_rcpts("Reject::RCPT::Toomany_Rcptto:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
@@ -679,6 +704,7 @@
- if (!addrallowed()) { err_nogateway(); return; }
+ flagrcpt = brtcheck();
+ if (flagrcpt) { err_brcptto("Reject::RCPT::Bad_Rcptto:",remoteip,remotehost,helohost.s,mailfrom.s,addr.s); return; }
++ if (mailfrom.len == 1 && rcptcount > 1) { err_bounce("Reject::ORIG::Invalid_Nullsender:",remoteip,remotehost,helohost.s,addr.s); return; }
+ if (flagsize) { err_size(); log5("Reject::DATA::Invalid_Size:",remoteip,remotehost,helohost.s,addr.s); return; }
+
if (!stralloc_cats(&rcptto,"T")) die_nomem();
@@ -706,7 +732,7 @@
int saferead(fd,buf,len) int fd; char *buf; int len;
{
-@@ -279,11 +793,69 @@
+@@ -279,11 +821,69 @@
substdio ssin = SUBSTDIO_FDBUF(saferead,0,ssinbuf,sizeof ssinbuf);
struct qmail qqt;
@@ -777,7 +803,7 @@
if (bytestooverflow)
if (!--bytestooverflow)
qmail_fail(&qqt);
-@@ -316,8 +888,8 @@
+@@ -316,8 +916,8 @@
if (flagmaybex) if (pos == 7) ++*hops;
if (pos < 2) if (ch != "\r\n"[pos]) flagmaybey = 0;
if (flagmaybey) if (pos == 1) flaginheader = 0;
@@ -787,7 +813,13 @@
if (ch == '\n') { pos = 0; flagmaybex = flagmaybey = flagmaybez = 1; }
}
switch(state) {
-@@ -378,26 +950,269 @@
+@@ -373,31 +973,275 @@
+ if (!seenmail) { err_wantmail(); return; }
+ if (!rcptto.len) { err_wantrcpt(); return; }
+ seenmail = 0;
++ rcptcount = 0;
+ if (databytes) bytestooverflow = databytes + 1;
+ if (qmail_open(&qqt) == -1) { err_qqt(); return; }
qp = qmail_qp(&qqt);
out("354 go ahead\r\n");
@@ -994,7 +1026,7 @@
+
+ if (!user.len || !pass.len) return err_input();
+ return authenticate();
-+}
+ }
+#endif
+
+struct authcmd {
@@ -1049,10 +1081,10 @@
+ case 1:
+ err_authfail("Reject::ORIG::Failed_Auth:",remoteip,remotehost,helohost.s,user.s,authcmds[i].text);
+ }
- }
-
-+/* this file is too long --------------------------------------------- GO ON */
++}
+
++/* this file is too long --------------------------------------------- GO ON */
+
struct commands smtpcommands[] = {
{ "rcpt", smtp_rcpt, 0 }
, { "mail", smtp_mail, 0 }
@@ -1061,7 +1093,7 @@
, { "quit", smtp_quit, flush }
, { "helo", smtp_helo, flush }
, { "ehlo", smtp_ehlo, flush }
-@@ -408,8 +1223,11 @@
+@@ -408,8 +1252,11 @@
, { 0, err_unimpl, flush }
} ;

View File

@ -3,6 +3,6 @@ by Erwin Hoffmann (feh@fehcom.de).
Some SpamControl features: smtp-auth (plain, login and cram-md5),
requirement of brackets on addresses, qmail-queue, bigtodo, moreipme,
recipients...
recipients, STARTTLS...
WWW: http://www.fehcom.de/qmail/spamcontrol.html

View File

@ -163,12 +163,8 @@ LDAP_PARAMS= ALTQUEUE BIGBROTHER BIGTODO BIND_8_COMPAT\
.elif defined(SLAVE_SPAMCONTROL)
OPTIONS+= RELAYMAILFROM "Open relay based on mailfrom" off \
QUITASAP "Close session in case of a filter condition" off \
REQBRACKETS "Require brackets in <addresses>" on \
VERP "VERP addresses for recipients" on \
RECIPIENTS550 "Get a 550 reply instead of a deferred bounce" off \
LOCALMFREQAUTH "Require auth when from is @ your domains" off \
AUTHCRAM "Aditional CRAM-MD5 support" off \
MOREIPME "Additional control files moreipme & notipme" off \
BIGTODO "Bruce Guenter's BigToDo patch" off
.endif
@ -261,16 +257,14 @@ DOCFILES_WRKDIR+= TLS.readme
.elif defined(SLAVE_SPAMCONTROL)
DOCFILES_WRKDIR_doc+= FILES.spamcontrol HISTORY.spamcontrol \
INSTALL.spamcontrol LICENSE.spamcontrol \
LOGGING.spamcontrol Makefile.djbdns README.auth \
README.bigtodo README.bouncemaxbytes README.djbdns \
README.doublebouncetrim README.moreipme \
README.qmailqueue README.recipients README.spamcontrol \
LOGGING.spamcontrol Makefile.djbdns README.bigtodo \
README.bouncemaxbytes README.clamav README.djbdns \
README.doublebouncetrim README.mav README.moreipme \
README.qmailqueue README.recipients \
README.wildmat README_spamcontrol.html \
RELEASE_22.spamcontrol RELEASE_23.spamcontrol \
SMTPREPLY.spamcontrol TESTING.spamcontrol \
TODO.spamcontrol badloadertypes badmailfrom \
badmimetypes badrcptto conf-spamcontrol \
install_spamcontrol.sh tarpitcount
SMTPREPLY.spamcontrol TODO.spamcontrol badloadertypes \
badmailfrom badmimetypes badrcptto tarpitcount
SCRIPTS+= qmail-alias2recipients qmail-pwd2recipients \
qmail-users2recipients qmail-vpopmail2recipients
.endif
@ -419,12 +413,6 @@ SELECTED_OPTIONS+= relaymailfrom=yes
SELECTED_OPTIONS+= relaymailfrom=no
. endif
. if defined(WITH_QUITASAP)
SELECTED_OPTIONS+= quitasap=yes
. else
SELECTED_OPTIONS+= quitasap=no
. endif
. if !defined(WITHOUT_REQBRACKETS)
SELECTED_OPTIONS+= reqbrackets=yes
. else
@ -437,24 +425,6 @@ SELECTED_OPTIONS+= verp=yes
SELECTED_OPTIONS+= verp=no
. endif
. if defined(WITH_RECIPIENTS550)
SELECTED_OPTIONS+= recipients550=yes
. else
SELECTED_OPTIONS+= recipients550=no
. endif
. if defined(WITH_LOCALMFREQAUTH)
SELECTED_OPTIONS+= localmfreqauth=yes
. else
SELECTED_OPTIONS+= localmfreqauth=no
. endif
. if defined(WITH_AUTHCRAM)
SELECTED_OPTIONS+= cram_md5=yes
. else
SELECTED_OPTIONS+= cram_md5=no
. endif
. if defined(WITH_MOREIPME)
SELECTED_OPTIONS+= moreipme=yes
. else

View File

@ -55,9 +55,9 @@ SIZE (qmail/qmail-ldap-1.03-20060201.patch.gz) = 270788
MD5 (qmail/qmail-mysql-1.1.15.patch) = c0298550475f928e82881e574e905313
SHA256 (qmail/qmail-mysql-1.1.15.patch) = 3d2b6a08fb149d6c9fe6c8250e87edd6c4d4b2b0417f03adf5cf4202bbadc53f
SIZE (qmail/qmail-mysql-1.1.15.patch) = 67602
MD5 (qmail/spamcontrol-2317_tgz.bin) = c68915008cbf9c16c3b4bb7185b047bc
SHA256 (qmail/spamcontrol-2317_tgz.bin) = 86f628398411d6d71a76e653e992e8d0acbe58a20978ea0668f22cb722bbdd03
SIZE (qmail/spamcontrol-2317_tgz.bin) = 120429
MD5 (qmail/spamcontrol-2414_tgz.bin) = c7569fd045ce8181423e287d64feb3cd
SHA256 (qmail/spamcontrol-2414_tgz.bin) = 0be01c1dd45001dba13e23fbba3277b1de14db061345006269689646488f39dc
SIZE (qmail/spamcontrol-2414_tgz.bin) = 121789
MD5 (qmail/qmail-1.03-tls-20021228-renato.patch) = be15cd5eaff7aa3cd88aee962febadc6
SHA256 (qmail/qmail-1.03-tls-20021228-renato.patch) = ab0de8f744241dcb7f5ee207fc7eab4f067bf42812deb85f9eb0050ac49e6e23
SIZE (qmail/qmail-1.03-tls-20021228-renato.patch) = 42095

View File

@ -34,6 +34,7 @@ bin/qmail-inject
%%LDAP%%bin/qmail-ldaplookup
bin/qmail-local
bin/qmail-lspawn
%%SPAMCONTROL%%bin/qmail-mfrules
bin/qmail-newmrh
bin/qmail-newu
bin/qmail-pop3d