cprintf("%d\n", config.c_journal_pubmsgs);
cprintf("%s\n", config.c_journal_dest);
cprintf("%s\n", config.c_default_cal_zone);
+ cprintf("%d\n", config.c_pftcpdict_port);
cprintf("000\n");
}
case 49:
safestrncpy(config.c_default_cal_zone, buf,
sizeof config.c_default_cal_zone);
+ break;
+ case 50:
+ config.c_pftcpdict_port = atoi(buf);
+ break;
}
++a;
}
void do_system_configuration(CtdlIPC *ipc)
{
-#define NUM_CONFIGS 50
+#define NUM_CONFIGS 51
char buf[SIZ];
char sc[NUM_CONFIGS][256];
strprompt("SMTP MTA server port (-1 to disable)", &sc[24][0], 5);
strprompt("SMTP MSA server port (-1 to disable)", &sc[38][0], 5);
strprompt("SMTPS server port (-1 to disable)", &sc[41][0], 5);
+ strprompt("Postfix TCP Dictionary Port server port (-1 to disable)", &sc[50][0], 5);
/* This logic flips the question around, because it's one of those
* situations where 0=yes and 1=no
char *serv_vcard_init(void);
char *serv_fulltext_init(void);
char *serv_autocompletion_init(void);
+char *serv_postfix_tcpdict(void);
/*
*/
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\r\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
return "$Id$";
}
+
+
+char *serv_postfix_tcpdict(void)
+{
+ CtdlRegisterServiceHook(config.c_pftcpdict_port, /* Postfix */
+ NULL,
+ check_get_greeting,
+ check_get,
+ NULL);
+ return "$Id$";
+}
if (config.c_smtps_port == 0) config.c_smtps_port = 465;
if (config.c_pop3s_port == 0) config.c_pop3s_port = 995;
if (config.c_imaps_port == 0) config.c_imaps_port = 993;
+ if (config.c_pftcpdict_port == 0) config.c_pftcpdict_port = -1;
/* Go through a series of dialogs prompting for config info */
if (setup_type != UI_SILENT) {
47. Flag (0 or 1) - perform journaling of non-email messages
48. Address to which journalized messages are to be sent
49. Default time zone (Olsen database name) for unzoned calendar items
+ 50. Port number for Postfix TCP Dict (http://www.postfix.org/tcp_table.5.html)
CONF also accepts two additional commands: GETSYS and PUTSYS followed by an
arbitrary MIME type (such as application/x-citadel-internet-config) which