i've digged a bit deeper into that problem, and consulting some people more closer to the source (experienced with postfix and their ml and so on) i was told, that there is a tcp - user dictionary, which would be the prefered way to make postfix backcheck if citadel knows the user. see

http://www.postfix.org/tcp_table.5.html

for details. As the qdir command allmost does the job, i had a look at that.

it is registered via the plugin api, that just specifies 4 character commands, so just hooking in another command with "get" is not possible. I've patched citadel.c to make it know the get cmd, which breaks well... clean code? it would do the job i think,

but please take a look.

Index: citserver.c
===================================================================
--- citserver.c	(revision 4564)
+++ citserver.c	(working copy)
@@ -1309,6 +1309,14 @@
 		cmd_isme(&cmdbuf[5]);
 	}
 
+	else if (!strncasecmp(cmdbuf, "GET", 3)) {
+		// ok, as external plugin we don't have a chance, 
+		// because of we don't have 4 chars. we hack this
+                // to make it fit together.
+		extern void cmd_get(char *argbuf);
+		cmd_get(&cmdbuf[4]);
+	}
+
 	else if (!DLoader_Exec_Cmd(cmdbuf)) {
 		cprintf("%d Unrecognized or unsupported command.\n",
 			ERROR + CMD_NOT_SUPPORTED);
Index: serv_vcard.c
===================================================================
--- serv_vcard.c	(revision 4564)
+++ serv_vcard.c	(working copy)
@@ -876,7 +876,27 @@
 	cprintf("%d %s\n", CIT_OK, citadel_addr);
 }
 
+/*
+ * Query Directory, in fact an alias to match postfix tcp auth.
+ */
+void cmd_get(char *argbuf) {
+	char citadel_addr[256];
+	char internet_addr[256];
 
+	//// 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 %d %s was not found.\n",
+			ERROR + NO_SUCH_USER, internet_addr);
+		return;
+	}
+
+	cprintf("200 %d %s\n", CIT_OK, citadel_addr);
+}
+
+
 /*
  * We don't know if the Contacts room exists so we just create it at login
  */
@@ -1112,6 +1132,7 @@
 	CtdlRegisterProtoHook(cmd_greg, "GREG", "Get registration info");
 	CtdlRegisterProtoHook(cmd_igab, "IGAB",
 					"Initialize Global Address Book");
+//	CtdlRegisterProtoHook(cmd_get, "GET ", "Alias for Query Directory; Postfix tcptable compatibilicty version");
 	CtdlRegisterProtoHook(cmd_qdir, "QDIR", "Query Directory");
 	CtdlRegisterUserHook(vcard_newuser, EVT_NEWUSER);
 	CtdlRegisterUserHook(vcard_purge, EVT_PURGEUSER);

Reply via email to