Build citadel server and webcit in temp directories. This allows the builder to...
[citadel.git] / citadel / internet_addressing.c
index b517871620a14f8967aa5ad5464c6283db7e0d88..030291f6c6412ec2286a356e64b33f986bae71e7 100644 (file)
@@ -2,7 +2,7 @@
  * This file contains functions which handle the mapping of Internet addresses
  * to users on the Citadel system.
  *
- * Copyright (c) 1987-2020 by the citadel.org team
+ * Copyright (c) 1987-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
@@ -1104,10 +1104,12 @@ int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
                process_rfc822_addr(value, user, node, name);
                syslog(LOG_DEBUG, "internet_addressing: converted to <%s@%s> (%s)", user, node, name);
                snprintf(addr, sizeof(addr), "%s@%s", user, node);
-               if (CM_IsEmpty(msg, eAuthor) && !IsEmptyStr(name))
-                       CM_SetField(msg, eAuthor, name, strlen(name));
-               if (CM_IsEmpty(msg, erFc822Addr) && !IsEmptyStr(addr))
-                       CM_SetField(msg, erFc822Addr, addr, strlen(addr));
+               if (CM_IsEmpty(msg, eAuthor) && !IsEmptyStr(name)) {
+                       CM_SetField(msg, eAuthor, name, -1);
+               }
+               if (CM_IsEmpty(msg, erFc822Addr) && !IsEmptyStr(addr)) {
+                       CM_SetField(msg, erFc822Addr, addr, -1);
+               }
                processed = 1;
        }
 
@@ -1416,7 +1418,8 @@ void directory_key(char *key, char *addr) {
 }
 
 
-/* Return nonzero if the supplied address is in one of "our" domains
+/*
+ * Return nonzero if the supplied address is in one of "our" domains
  */
 int IsDirectory(char *addr, int allow_masq_domains) {
        char domain[256];
@@ -1668,6 +1671,7 @@ void AutoGenerateEmailAddressForUser(struct ctdluser *user)
                        snprintf(synthetic_email_addr, sizeof synthetic_email_addr, "ctdl%08x@%s", i, CtdlGetConfigStr("c_fqdn"));
                }
                u = CtdlDirectoryLookup(NULL, synthetic_email_addr, 0);
+               syslog(LOG_DEBUG, "user_ops: address <%s> lookup returned <%d>", synthetic_email_addr, u);
        }
 
        CtdlSetEmailAddressesForUser(user->fullname, synthetic_email_addr);