From: Art Cancro Date: Wed, 14 Jun 2017 02:58:12 +0000 (-0400) Subject: Internally, "directory" domains are now treated like "localhost" domains. X-Git-Tag: v939~541 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=727b303736cc95e8be9c7e28c3622eda152584ce Internally, "directory" domains are now treated like "localhost" domains. --- diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 35c9fc3dd..8902befbd 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -286,12 +286,12 @@ int CtdlHostAlias(char *fqdn) { char host[256], type[256]; int found = 0; - if (fqdn == NULL) return(hostalias_nomatch); - if (IsEmptyStr(fqdn)) return(hostalias_nomatch); - if (!strcasecmp(fqdn, "localhost")) return(hostalias_localhost); - if (!strcasecmp(fqdn, CtdlGetConfigStr("c_fqdn"))) return(hostalias_localhost); - if (!strcasecmp(fqdn, CtdlGetConfigStr("c_nodename"))) return(hostalias_localhost); - if (inetcfg == NULL) return(hostalias_nomatch); + if (fqdn == NULL) return(hostalias_nomatch); + if (IsEmptyStr(fqdn)) return(hostalias_nomatch); + if (!strcasecmp(fqdn, "localhost")) return(hostalias_localhost); + if (!strcasecmp(fqdn, CtdlGetConfigStr("c_fqdn"))) return(hostalias_localhost); + if (!strcasecmp(fqdn, CtdlGetConfigStr("c_nodename"))) return(hostalias_localhost); + if (inetcfg == NULL) return(hostalias_nomatch); config_lines = num_tokens(inetcfg, '\n'); for (i=0; i'); - fp = fopen(file_mail_aliases, "r"); + fp = fopen(file_mail_aliases, "r"); // when are we going to get rid of this? if (fp == NULL) { fp = fopen("/dev/null", "r"); } @@ -445,7 +447,7 @@ int alias(char *name) } fclose(fp); - /* Hit the Global Address Book */ + /* Hit the email address directory */ if (CtdlDirectoryLookup(aaa, name, sizeof aaa) == 0) { strcpy(name, aaa); } @@ -523,9 +525,8 @@ int alias(char *name) * * Caller needs to free the result using free_recipients() */ -recptypes *validate_recipients(const char *supplied_recipients, - const char *RemoteIdentifier, - int Flags) { +recptypes *validate_recipients(const char *supplied_recipients, const char *RemoteIdentifier, int Flags) +{ struct CitContext *CCC = CC; recptypes *ret; char *recipients = NULL; @@ -1497,8 +1498,7 @@ void directory_key(char *key, char *addr) { } -/* Return nonzero if the supplied address is in a domain we keep in - * the directory +/* Return nonzero if the supplied address is in one of "our" domains */ int IsDirectory(char *addr, int allow_masq_domains) { char domain[256]; @@ -1512,7 +1512,7 @@ int IsDirectory(char *addr, int allow_masq_domains) { if ( (h == hostalias_masq) && allow_masq_domains) return(1); - if ( (h == hostalias_localhost) || (h == hostalias_directory) ) { + if (h == hostalias_localhost) { return(1); } else { @@ -1527,8 +1527,9 @@ int IsDirectory(char *addr, int allow_masq_domains) { int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) { char key[SIZ]; - if (IsDirectory(internet_addr, 0) == 0) + if (IsDirectory(internet_addr, 0) == 0) { return 0; + } syslog(LOG_DEBUG, "internet_addressing: create directory entry: %s --> %s", internet_addr, citadel_addr); directory_key(key, internet_addr); cdb_store(CDB_DIRECTORY, key, strlen(key), citadel_addr, strlen(citadel_addr)+1 ); @@ -1630,7 +1631,7 @@ char *harvest_collected_addresses(struct CtdlMessage *msg) { utf8ify_rfc822_string(addr); process_rfc822_addr(addr, user, node, name); h = CtdlHostAlias(node); - if ( (h != hostalias_localhost) && (h != hostalias_directory) ) { + if (h != hostalias_localhost) { coll = realloc(coll, strlen(coll) + strlen(addr) + 4); if (coll == NULL) return(NULL); if (!IsEmptyStr(coll)) { diff --git a/citadel/internet_addressing.h b/citadel/internet_addressing.h index 344a62929..971ba38a1 100644 --- a/citadel/internet_addressing.h +++ b/citadel/internet_addressing.h @@ -26,8 +26,6 @@ char *harvest_collected_addresses(struct CtdlMessage *msg); enum { hostalias_nomatch, hostalias_localhost, - hostalias_gatewaydomain, - hostalias_directory, hostalias_masq };