* vCard in the user's config room at all times.
*/
CtdlDeleteMessages(CC->room.QRname,
- 0L, "text/x-vcard", 1);
+ NULL, 0, "text/x-vcard", 1);
/* Make the author of the message the name of the user.
*/
cprintf("%d %s\n", CIT_OK, citadel_addr);
}
+/*
+ * Query Directory, in fact an alias to match postfix tcp auth.
+ */
+void check_get(void) {
+ char citadel_addr[256];
+ char internet_addr[256];
+
+ char cmdbuf[SIZ];
+
+ time(&CC->lastcmd);
+ memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
+ if (client_getln(cmdbuf, sizeof cmdbuf) < 1) {
+ lprintf(CTDL_CRIT, "Client disconnected: ending session.\n");
+ CC->kill_me = 1;
+ return;
+ }
+ lprintf(CTDL_INFO, ": %s\n", cmdbuf);
+ while (strlen(cmdbuf) < 3) strcat(cmdbuf, " ");
+
+ if (strcasecmp(cmdbuf, "GET "));
+ {
+
+ char *argbuf = &cmdbuf[4];
+ //// if (CtdlAccessCheck(ac_logged_in)) return;
+
+ extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);
+
+ if (CtdlDirectoryLookup(citadel_addr, internet_addr, sizeof citadel_addr) != 0) {
+ cprintf("500 %s was not found.\r\n",
+ internet_addr);
+
+ }
+
+ else cprintf("200 OK %s\n", internet_addr);//,citadel_addr);
+ }
+ CC->kill_me = 1;
+}
+
+void check_get_greeting(void) {
+/* dummy function, we have no greeting in this verry simple protocol. */
+}
+
/*
* We don't know if the Contacts room exists so we just create it at login
/*
- * Function to output a vCard as plain text. Nobody uses MSG0 anymore, so
+ * Function to output vCard data as plain text. Nobody uses MSG0 anymore, so
* really this is just so we expose the vCard data to the full text indexer.
*/
void vcard_fixed_output(char *ptr, int len) {
char *key, *value;
int i = 0;
- cprintf("vCard:\n");
serialized_vcard = malloc(len + 1);
safestrncpy(serialized_vcard, ptr, len+1);
v = vcard_load(serialized_vcard);
i = 0;
while (key = vcard_get_prop(v, "", 0, i, 1), key != NULL) {
value = vcard_get_prop(v, "", 0, i++, 0);
- cprintf("%20s : %s\n", key, value);
+ cprintf("%s\n", value);
}
vcard_free(v);
assoc_file_name(filename, sizeof filename, &qr, ctdl_netcfg_dir);
fp = fopen(filename, "a");
if (fp != NULL) fclose(fp);
+ chown(filename, CTDLUID, (-1));
}
return "$Id$";
}
+
+
+char *serv_postfix_tcpdict(void)
+{
+ CtdlRegisterServiceHook(config.c_pftcpdict_port, /* Postfix */
+ NULL,
+ check_get_greeting,
+ check_get,
+ NULL);
+ return "$Id$";
+}