Hi there,
I don't really know if it's off-topic, but I have a little problem
patching maildrop/main.C and thought some of you guys might point me
into the right direction...
the version of the source code is 1.3.7
I added 2 vars at the top of main.C:
#if USELDAP
...
int use_ldap_recipe = 0;
char *ldap_recipe;
...
#endif
then, in the following switch() that parses the command line params, I
added
...
case 'L':
if (!*optarg && argn < argc) optarg=argv[argn++];
use_ldap_recipe = 1;
break;
...
some line beneath, there's this macro that retrieves user data from
ldap:
#if USELDAP
if ( !found )
{
mdldaprec *rec;
if ( use_ldap )
{
...
(I added two lines here, just for testing purposes:)
ldap_recipe = (char*)malloc(20);
sprintf(ldap_recipe, "1234567890abcdef");
...
#endif
later in the code, it's attempted to read the filter file:
#ifdef DEFAULTEXT
int firstdefault=1;
#endif
name="MAILFILTER";
value=recipe;
SetVar(name, value);
(I added another two lines here, just to see if ldap_recipe actually
contains any data:)
if(strlen(ldap_recipe) < 5)
throw "LDAP_RECIPE SUSPICIOUS...";
now if I build maildrop with --enable-maildropldap and test it sending a
mail to a virtual user who's data is in LDAP using 'maildrop -V5 -L' as
deliveryProgramPath (qmail-ldap attribute for a custom MDA) my mail.log
always contains the message "maildrop: LDAP_RECIPE SUSPICIOUS...".
Could anyone explain why the stuff in the macro where the user data is
been retrieved from LDAP doesnt work? I mean it _has_ to work, 'cos
otherwise the mail wouldn't be delivered, but it is delivered to the
right place (user's Maildir) if I remove the two lines with the
exception.
TIA,
Igor