]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/vcard/serv_vcard.c
When using host auth mode the user is given a default email address
[citadel.git] / citadel / modules / vcard / serv_vcard.c
index 7580c0d2a864a8cffe70a0d4187f23d6ff6f4ec2..a3b0fc46c60a9168e6972050669854f659ac6882 100644 (file)
@@ -610,7 +610,11 @@ int vcard_upload_beforesave(struct CtdlMessage *msg) {
        /* 
         * Set the EUID of the message to the UID of the vCard.
         */
-       if (msg->cm_fields['E'] != NULL) free(msg->cm_fields['E']);
+       if (msg->cm_fields['E'] != NULL)
+       {
+               free(msg->cm_fields['E']);
+               msg->cm_fields['E'] = NULL;
+       }
        s = vcard_get_prop(v, "UID", 0, 0, 0);
        if (s != NULL) {
                msg->cm_fields['E'] = strdup(s);
@@ -964,6 +968,25 @@ void cmd_greg(char *argbuf)
 
 
 
+
+
+/*
+ * Add an email alias to a users vcard
+ */
+
+void vcard_add_alias(struct ctdluser *usbuf, char *addr)
+{
+       struct vCard *v;
+       
+       v = vcard_get_user(usbuf);
+       vcard_add_prop(v, "email;internet", addr);
+       vcard_write_user(usbuf, v);
+       vcard_free(v);
+}
+
+
+
+
 /*
  * When a user is being created, create his/her vCard.
  */
@@ -1271,7 +1294,7 @@ void check_get(void) {
                char *argbuf = &cmdbuf[4];
                
                extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);
-               rcpt = validate_recipients(internet_addr);
+               rcpt = validate_recipients(internet_addr, NULL, CHECK_EXISTANCE);
                if ((rcpt != NULL)&&
                        (
                         (*rcpt->recp_local != '\0')||