/* First, do the "as often as needed" stuff... */
JournalRunQueue();
-#ifdef HAVE_LIBSIEVE
- perform_sieve_processing();
-#endif
+
+ PerformSessionHooks(EVT_HOUSE); /* perform as needed housekeeping */
/* Then, do the "once per minute" stuff... */
if (do_perminute_housekeeping_now) {
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);
#define EVT_TIMER 50 /* Timer events are called once per minute
and are not tied to any session */
-
+#define EVT_HOUSE 51 /* as needed houskeeping stuff */
/*
* UserFunctionHook extensions are used for any type of hook which implements
* an operation on a user or username (potentially) other than the one
void CtdlUnregisterMessageHook(int (*handler) (struct CtdlMessage *),
int EventType)
- Please write documentation for me!
+
+ CtdlRegisterMessageHook() registers a function with the message
+handling subsystem. This function will be called with one parameter,
+a pointer to a CtdlMessage structure, when the message triggers an event
+of type EventType. The registered function should return non zero if it
+has handled the event to prevent other hook functions from also processing
+the event.
+
+ CtdlUnregisterMessageHook() removes a function from the list of registered
+message handlers. To successfully remove a function registered with
+CtdlRegisterMessageHook() CtdlUnregisterMessageHook() must be called with
+the same parameters.
+
+ Possible values for EventType are:
+ EVT_BEFOREREAD Called after a message is loaded from disk but before
+it is presented for reading.
+ EVT_BEFORESAVE Called before the message is saved to disk. returning
+non zero for this event will prevent the message being saved to disk in the
+normal manner.
+ EVT_AFTERSAVE Called after the message is saved to disk but before
+any IGnet spooling is carried out.
+ EVT_SMTPSCAN Called during the SMTP reception of a message after the
+message is received and before the response is sent to the sender. This is
+intended for spam filters and virus checkers. A positive return code will
+cause the message to be rejected by the SMTP server.
+
+
+ void CtdlRegisterRoomHook(int (*fcn_ptr) (char *))
+ void CtdlUnregisterRoomHook(int (*fcn_ptr) (char *))
+
+ Register or remove a function with the room processing system.
+Registered functions are called in the order they are registered when a message
+is added to a room. This allows modules such as Sieve to process new messages
+appearing in a room.
void CtdlRegisterXmsgHook(int (*fcn_ptr) (char *, char *, char *), int order)