From ad9a6c64ba19522bf721195183abe07fba5429bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 2 May 2007 21:37:27 +0000 Subject: [PATCH] * added masquerade domain feature. --- citadel/debian/changelog | 22 ++++++++++++++++------ citadel/internet_addressing.c | 15 +++++++++++---- citadel/msgbase.c | 2 +- citadel/routines2.c | 3 +++ citadel/serv_vcard.c | 3 ++- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/citadel/debian/changelog b/citadel/debian/changelog index 76db37597..c645680db 100644 --- a/citadel/debian/changelog +++ b/citadel/debian/changelog @@ -1,24 +1,34 @@ +citadel (7.10-1) unstable; urgency=low + + * update to actual Citadel SVN. many new features. see Packages changelog. + + -- Wilfried Goesgens Sun, 29 Apr 2007 13:01:00 +0200 + + citadel (7.08-15) unstable; urgency=high * fix permission bug - -- Wilfried Goesgens Fri, 06 Apr 2007 19:07:00 +0000 + -- Wilfried Goesgens Fri, 06 Apr 2007 19:07:00 +0000 + citadel (7.07-14) unstable; urgency=low + + * update to actual Citadel SVN. many new features. see Packages changelog. - * update to actual Citadel SVN. many new features. see Packages changelog. - - -- Wilfried Goesgens Fri, 06 Apr 2007 19:07:00 +0000 + -- Wilfried Goesgens Fri, 06 Apr 2007 19:07:00 +0000 + citadel (7.06-13) stable; urgency=high * fixed location of key files - -- Wilfried Goesgens Sun, 1 Apr 2007 11:09:00 +0100 + -- Wilfried Goesgens Sun, 1 Apr 2007 11:09:00 +0100 citadel (7.06-12) stable; urgency=high * updated mime-parser - -- Wilfried Goesgens Mon, 21 Mar 2007 11:09:00 +0100 + -- Wilfried Goesgens Mon, 21 Mar 2007 11:09:00 +0100 + citadel (7.06-11) unstable; urgency=low * fixes to the configure script. diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 41666dfef..3bbf82454 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -94,6 +94,10 @@ int CtdlHostAlias(char *fqdn) { && (!strcasecmp(&fqdn[strlen(fqdn)-strlen(host)], host))) return(hostalias_directory); + if ( (!strcasecmp(type, "masqdomain")) + && (!strcasecmp(&fqdn[strlen(fqdn)-strlen(host)], host))) + return(hostalias_masq); + } return(hostalias_nomatch); @@ -564,7 +568,7 @@ void directory_key(char *key, char *addr) { /* Return nonzero if the supplied address is in a domain we keep in * the directory */ -int IsDirectory(char *addr) { +int IsDirectory(char *addr, int allow_masq_domains) { char domain[256]; int h; @@ -573,6 +577,9 @@ int IsDirectory(char *addr) { h = CtdlHostAlias(domain); + if ( (h == hostalias_masq) && allow_masq_domains) + return(1); + if ( (h == hostalias_localhost) || (h == hostalias_directory) ) { return(1); } @@ -598,7 +605,7 @@ void CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) { lprintf(CTDL_DEBUG, "Dir: %s --> %s\n", internet_addr, citadel_addr); - if (IsDirectory(internet_addr) == 0) return; + if (IsDirectory(internet_addr, 0) == 0) return; directory_key(key, internet_addr); @@ -637,7 +644,7 @@ int CtdlDirectoryLookup(char *target, char *internet_addr, size_t targbuflen) { if (num_tokens(internet_addr, '@') != 2) return(-1); /* Only do lookups for domains in the directory */ - if (IsDirectory(internet_addr) == 0) return(-1); + if (IsDirectory(internet_addr, 0) == 0) return(-1); directory_key(key, internet_addr); cdbrec = cdb_fetch(CDB_DIRECTORY, key, strlen(key) ); @@ -674,7 +681,7 @@ char *harvest_collected_addresses(struct CtdlMessage *msg) { strcat(addr, " <"); strcat(addr, msg->cm_fields['F']); strcat(addr, ">"); - if (IsDirectory(msg->cm_fields['F'])) { + if (IsDirectory(msg->cm_fields['F'], 0)) { is_harvestable = 0; } } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 5eb729f10..7a1abce38 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -3214,7 +3214,7 @@ struct recptypes *validate_recipients(char *supplied_recipients) { * because if the address were valid, we would have * already translated it to a local address by now. */ - if (IsDirectory(this_recp)) { + if (IsDirectory(this_recp, 0)) { ++ret->num_error; invalid = 1; } diff --git a/citadel/routines2.c b/citadel/routines2.c index 190b69dd2..7be0e5b37 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -919,6 +919,7 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) { keyopt(" <4> directory (Consult the Global Address Book)\n"); keyopt(" <5> SpamAssassin (Address of SpamAssassin server)\n"); keyopt(" <6> RBL (domain suffix of spam hunting RBL)\n"); + keyopt(" <7> masq domains (Domains as which users are allowed to masquerade)\n"); sel = intprompt("Which one", 1, 1, 6); switch(sel) { case 1: strcpy(buf, "localhost"); @@ -933,6 +934,8 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) { return; case 6: strcpy(buf, "rbl"); return; + case 7: strcpy(buf, "masqdomain"); + return; } } diff --git a/citadel/serv_vcard.c b/citadel/serv_vcard.c index 8fbaf44ff..f9f92c68b 100644 --- a/citadel/serv_vcard.c +++ b/citadel/serv_vcard.c @@ -218,7 +218,8 @@ void extract_inet_email_addrs(char *emailaddrbuf, size_t emailaddrbuf_len, addr = strdup(s); striplt(addr); if (strlen(addr) > 0) { - if ( (IsDirectory(addr)) || (!local_addrs_only) ) { + if ( (IsDirectory(addr, 1)) || + (!local_addrs_only) ) { ++saved_instance; if ((saved_instance == 1) && (emailaddrbuf != NULL)) { safestrncpy(emailaddrbuf, addr, emailaddrbuf_len); -- 2.30.2