Hi all.
Would be greate add this patch to qmail-ldap final release.
ldaplookupfilter function have to be programed, and one note, this patch was created over 20040401 qmail-ldap version.
I traduce my notes to my bad english :D
I will apreciate any help for "ldaplookupfilter" function.
if anybody like i explain the patch better i will do it.
Best Regards.
C�sar Garc�a. Dept. Sistemas, IdecNet S.A. Centro de Gesti�n de Red. Edificio IdecNet. C/Juan XXIII 44. E-35004, Las Palmas de Gran Canaria, Islas Canarias - Espa�a. Tfn: +34 828 111 000 Ext: 340
Ted Zlatanov wrote:
On 15 Jul 2004, [EMAIL PROTECTED] wrote:
I wrote this patch today, but my "c" code is too bad.
I would use English as well, to be consistent with the rest of qmail-ldap.
If the patch is OK with Claudio & co. I can translate it if you wish.
Ted
--- qmail-smtpd.c 2004-07-15 15:03:34.000000000 +0100
+++ qmail-smtpd.c.orig 2004-07-15 12:27:09.000000000 +0100
@@ -262,11 +262,6 @@
stralloc brt = {0};
struct constmap mapbadrcptto;
int gmaok = 0;
-/* Modification cegara */
-int userfilterqueueok = 0;
-stralloc userfilterqueue = {0};
-int userfilter = 0;
-/* Fin de modificacion */
stralloc gma = {0};
struct constmap mapgma;
int rblok = 0;
@@ -375,7 +370,6 @@
if (!case_diffs("STRICT",env_get("SENDERCHECK"))) sendercheck = 3;
}
if (env_get("RCPTCHECK")) rcptcheck = 1;
- if (env_get("USERFILTER")) userfilter = 1;
if (env_get("LDAPSOFTOK")) ldapsoftok = 1;
greeting550 = env_get("550GREETING");
greeting421 = env_get("421GREETING");
@@ -1110,41 +1104,7 @@
} /* else this is relaying, don't do anything */
}
}
-/* What QMAILQUEUE for this user? QMAILQUEUE => control/userfilterqueue*/
- if (userfilter && rcptcheck) {
- if (addrlocals()) {
- char *s;
- logline(3,"Checking if user want filter or not");
- switch (ldaplookupfilter(addr.s, &s)) {
- case 1: /* Filtering this user*/
- logline(3,"The user want to be filtered");
- char tempqueue[256];
- userfilterqueueok =
control_readfile(&userfilterqueue,"control/userfilterqueue",0);
- if (userfilterqueueok == -1) die_control();
- if (userfilterqueueok){
- sprintf(tempqueue, "QMAILQUEUE=%s",userfilterqueue);
- env_put(tempqueue);
- }
- break;
- case 0: /* The user dont want any filter */
- logline(3,"The user dont want any filter");
- env_unset("QMAILQUEUE");
- break;
- case -1:
- default: /* if return != 0 or != 1, maybe attribute is not set in ldap
entry*/
- logline(2,"The user not required any filter, but may be filtered for
QMAILQUEUE enviroment from qmail-smtpd.rules.");
- if (ldapsoftok)
- break;
- err_ldapsoft();
- if (errdisconnect) err_quit();
- return;
- }
- } /* else this is relaying, don't do anything */
- }
-
-
-/* end of modification */
if (!stralloc_cats(&rcptto,"T")) die_nomem();
if (!stralloc_cats(&rcptto,addr.s)) die_nomem();
if (!stralloc_0(&rcptto)) die_nomem();
