Common subdirectories: messagewall/conf and messagewall_new/conf Common subdirectories: messagewall/contrib and messagewall_new/contrib Common subdirectories: messagewall/doc and messagewall_new/doc Common subdirectories: messagewall/man and messagewall_new/man Common subdirectories: messagewall/profiles and messagewall_new/profiles diff -u messagewall/smtp.c messagewall_new/smtp.c --- messagewall/smtp.c 2002-10-18 17:24:16.000000000 +0200 +++ messagewall_new/smtp.c 2003-01-26 12:39:13.000000000 +0100 @@ -724,6 +724,8 @@ unsigned int u; int atsign; struct messagewall_special_user_t *special_user; + int qmail_dash; + struct firestring_estr_t qmail_dash_addr; atsign = firestring_estr_strchr(&clients[client].to[0],'@',0); atsign++; @@ -734,6 +736,41 @@ break; special_user = special_user->next; } + + /* -try to match qmail wildcard addresses- + * if a mail comes in to collin-messagewallhack@mulliner.org first the + * full address is checked, if no special user is found + * "-messagewallhack" is removed then collin@mulliner.org is checked, + * after that mulliner.org is checked. + */ + if (special_user == NULL) { + qmail_dash = firestring_estr_strchr(&clients[client].to[0],'-',0); + if (qmail_dash > -1 && atsign > qmail_dash) { + firestring_estr_alloc(&qmail_dash_addr, clients[client].to[0].l); + firestring_strncpy(qmail_dash_addr.s, clients[client].to[0].s, qmail_dash+1); + qmail_dash_addr.l = qmail_dash; + firestring_estr_estrcat(&qmail_dash_addr, &clients[client].to[0], atsign-1); + + firestring_estr_0(&qmail_dash_addr); + + /* + * show the address without the dash part + */ + + /* fprintf(stderr, "qmail-ext-addr: %s\n", qmail_dash_addr.s); */ + + u = dbase_text_hash(&qmail_dash_addr,0); + special_user = special_user_hash[u]; + while (special_user != NULL) { + if (firestring_estr_estrcasecmp(&qmail_dash_addr,&special_user->address,0) == 0) + break; + special_user = special_user->next; + } + + firestring_estr_free(&qmail_dash_addr); + } + } + if (special_user == NULL) { /* * no specific address match, check for domain match