* to users on the Citadel system.
*/
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
&& (!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);
strcpy(node, config.c_fqdn);
strcpy(name, "");
+ if (rfc822 == NULL) return;
+
/* extract full name - first, it's From minus <userid> */
strcpy(name, rfc822);
stripout(name, '<', '>');
processed = 1;
}
+ else if (!strcasecmp(key, "Return-Path")) {
+ if (msg->cm_fields['P'] == NULL)
+ msg->cm_fields['P'] = strdup(value);
+ processed = 1;
+ }
+
+ else if (!strcasecmp(key, "Envelope-To")) {
+ if (msg->cm_fields['V'] == NULL)
+ msg->cm_fields['V'] = strdup(value);
+ processed = 1;
+ }
+
/* Clean up and move on. */
free(key); /* Don't free 'value', it's actually the same buffer */
return(processed);
/* 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;
h = CtdlHostAlias(domain);
+ if ( (h == hostalias_masq) && allow_masq_domains)
+ return(1);
+
if ( (h == hostalias_localhost) || (h == hostalias_directory) ) {
return(1);
}
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);
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) );
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;
}
}