lprintf(CTDL_DEBUG, "CtdlSaveMsgPointerInRoom() skips repl checks\n");
}
+#if 0
/* Submit this room for net processing */
network_queue_room(&CC->room, NULL);
+#endif
+
+ /* Submit this room for processing by hooks */
+ PerformRoomHooks(&CC->room);
+#if 0
#ifdef HAVE_LIBSIEVE
/* If this is someone's inbox, submit the room for sieve processing */
if (!strcasecmp(&CC->room.QRname[11], MAILROOM)) {
sieve_queue_room(&CC->room);
}
#endif /* HAVE_LIBSIEVE */
+#endif
/* Go back to the room we were in before we wandered here... */
getroom(&CC->room, hold_rm);
char *serv_autocompletion_init(void) {
CtdlRegisterProtoHook(cmd_auto, "AUTO", "Do recipient autocompletion");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio");
CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio");
CtdlRegisterProtoHook(cmd_lbio, "LBIO", "List users with bios");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterSessionHook(ical_session_shutdown, EVT_STOP);
CtdlRegisterFixedOutputHook("text/calendar", ical_fixed_output);
#endif
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterSessionHook(cmd_gexp_async, EVT_ASYNC);
CtdlRegisterSessionHook(delete_instant_messages, EVT_STOP);
CtdlRegisterXmsgHook(send_instant_message, XMSG_PRI_LOCAL);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
{
CtdlRegisterSessionHook(purge_databases, EVT_TIMER);
CtdlRegisterProtoHook(cmd_fsck, "FSCK", "Check message ref counts");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
struct DeleteFunctionHook *DeleteHookTable = NULL;
struct ServiceFunctionHook *ServiceHookTable = NULL;
struct FixedOutputHook *FixedOutputTable = NULL;
+struct RoomFunctionHook *RoomHookTable = NULL;
+
struct ProtoFunctionHook {
void (*handler) (char *cmdbuf);
}
+void CtdlRegisterRoomHook(int (*fcn_ptr)(struct ctdlroom *))
+{
+ struct RoomFunctionHook *newfcn;
+
+ newfcn = (struct RoomFunctionHook *)
+ malloc(sizeof(struct RoomFunctionHook));
+ newfcn->next = RoomHookTable;
+ newfcn->fcn_ptr = fcn_ptr;
+ RoomHookTable = newfcn;
+
+ lprintf(CTDL_INFO, "Registered a new room function\n");
+}
+
+
+void CtdlUnregisterRoomHook(int (*fcn_ptr)(struct ctdlroom *))
+{
+ struct RoomFunctionHook *cur, *p;
+
+ for (cur = RoomHookTable; cur != NULL; cur = cur->next) {
+ while (cur != NULL && fcn_ptr == cur->fcn_ptr) {
+ lprintf(CTDL_INFO, "Unregistered room function\n");
+ p = cur->next;
+ if (cur == RoomHookTable) {
+ RoomHookTable = p;
+ }
+ free(cur);
+ cur = p;
+ }
+ }
+}
+
+
+void CtdlDestroyRoomHooks(void)
+{
+ struct RoomFunctionHook *cur, *p;
+
+ cur = RoomHookTable;
+ while (cur != NULL)
+ {
+ lprintf(CTDL_INFO, "Unregistered room function\n");
+ p = cur->next;
+ free(cur);
+ cur = p;
+ }
+ RoomHookTable = NULL;
+}
+
void CtdlRegisterNetprocHook(int (*handler)(struct CtdlMessage *, char *) )
{
struct NetprocFunctionHook *newfcn;
}
+int PerformRoomHooks(struct ctdlroom *target_room)
+{
+ struct RoomFunctionHook *fcn;
+ int total_retval = 0;
+
+ lprintf(CTDL_DEBUG, "Performing room hooks\n");
+
+ for (fcn = RoomHookTable; fcn != NULL; fcn = fcn->next) {
+ total_retval = total_retval +
+ (*fcn->fcn_ptr) (target_room);
+ }
+
+ /* Return the sum of the return codes from the hook functions.
+ */
+ return total_retval;
+}
+
int PerformNetprocHooks(struct CtdlMessage *msg, char *target_room)
{
void CtdlDestroyNetprocHooks(void);
int PerformNetprocHooks(struct CtdlMessage *, char *);
+void CtdlRegisterRoomHook(int (*fcn_ptr)(struct ctdlroom *) );
+void CtdlUnregisterRoomHook(int (*fnc_ptr)(struct ctdlroom *) );
+void CtdlDestroyRoomHooks(void);
+int PerformRoomHooks(struct ctdlroom *);
+
+
void CtdlRegisterDeleteHook(void (*handler)(char *, long) );
void CtdlUnregisterDeleteHook(void (*handler)(char *, long) );
void CtdlDestroyDeleteHooks(void);
{
initialize_ft_cache();
CtdlRegisterProtoHook(cmd_srch, "SRCH", "Full text search");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
{
create_notify_queue();
CtdlRegisterSessionHook(do_notify_queue, EVT_TIMER);
- return "$Id: serv_funambol.c $";
+
+ /* return our Subversion id for the Log */
+ return "$Id$";
}
NULL, imaps_greeting, imap_command_loop, NULL);
#endif
CtdlRegisterSessionHook(imap_cleanup_function, EVT_STOP);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
{
CtdlRegisterMessageHook(inetcfg_aftersave, EVT_AFTERSAVE);
inetcfg_init();
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
}
#endif /* HAVE_LDAP */
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_listsub_init(void)
{
CtdlRegisterProtoHook(cmd_subs, "SUBS", "List subscribe/unsubscribe");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_managesieve_init(void)
{
lprintf(CTDL_INFO, "This server is missing libsieve. Managesieve protocol is disabled..\n");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_mrtg_init(void)
{
CtdlRegisterProtoHook(cmd_mrtg, "MRTG", "Supply stats to MRTG");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_netfilter_init(void)
{
CtdlRegisterNetprocHook(filter_the_idiots);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CC->net_node);
}
+int network_room_handler (struct ctdlroom *room)
+{
+ network_queue_room(room, NULL);
+ return 0;
+}
+
/*
* Module entry point
*/
CtdlRegisterProtoHook(cmd_netp, "NETP", "Identify as network poller");
CtdlRegisterProtoHook(cmd_nsyn, "NSYN", "Synchronize room to node");
CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
+ CtdlRegisterRoomHook(network_room_handler);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_newuser_init(void)
{
CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_notes_init(void)
{
CtdlRegisterMessageHook(serv_notes_beforesave, EVT_BEFORESAVE);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_pas2_init(void)
{
CtdlRegisterProtoHook(cmd_pas2, "PAS2", "APOP-based login");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
NULL);
#endif
CtdlRegisterSessionHook(pop3_cleanup_function, EVT_STOP);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterProtoHook(cmd_rchg, "RCHG", "Masquerade roomname");
CtdlRegisterProtoHook(cmd_uchg, "UCHG", "Masquerade username");
CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
}
+int serv_sieve_room(struct ctdlroom *room)
+{
+ if (!strcasecmp(&room->QRname[11], MAILROOM)) {
+ sieve_queue_room(room);
+/*
+ return 1;
+*/
+ }
+ return 0;
+}
char *serv_sieve_init(void)
char *serv_sieve_init(void)
{
lprintf(CTDL_INFO, "This server is missing libsieve. Mailbox filtering will be disabled.\n");
+ CtdlRegisterRoomHook(serv_sieve_room);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP);
CtdlRegisterProtoHook(cmd_smtp, "SMTP", "SMTP utility commands");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_spam_init(void)
{
CtdlRegisterMessageHook(spam_assassin, EVT_SMTPSCAN);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
CtdlRegisterSessionHook(SessionStartTest, EVT_START);
CtdlRegisterSessionHook(SessionStopTest, EVT_STOP);
CtdlRegisterSessionHook(LoginTest, EVT_LOGIN);
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_upgrade_init(void)
{
check_server_upgrades();
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
char *serv_vandelay_init(void)
{
CtdlRegisterProtoHook(cmd_artv, "ARTV", "import/export data store");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}
chown(filename, CTDLUID, (-1));
}
+ /* return our Subversion id for the Log */
return "$Id$";
}
#define EVT_SMTPSCAN 203 /* called before submitting a msg from SMTP */
-
/*
* NetprocFunctionHook extensions are used for hooks which implement handlers
* for incoming network messages.
extern struct ServiceFunctionHook *ServiceHookTable;
+/*
+ * RoomFunctionHook extensions are used for hooks which impliment room
+ * processing functions when new messages are added EG. SIEVE.
+ */
+struct RoomFunctionHook {
+ struct RoomFunctionHook *next;
+ int (*fcn_ptr) (struct ctdlroom *);
+};
+extern struct RoomFunctionHook *RoomHookTable;
+
+
/* Defines the relationship of a user to a particular room */
struct visit {