struct RoomFunctionHook *fcn;
int total_retval = 0;
- lprintf(CTDL_DEBUG, "Performing room hooks\n");
+ lprintf(CTDL_DEBUG, "Performing room hooks for <%s>\n", target_room->QRname);
for (fcn = RoomHookTable; fcn != NULL; fcn = fcn->next) {
- total_retval = total_retval +
- (*fcn->fcn_ptr) (target_room);
+ total_retval = total_retval + (*fcn->fcn_ptr) (target_room);
}
/* Return the sum of the return codes from the hook functions.
struct ctdl_sieve *cs = (struct ctdl_sieve *)my;
lprintf(CTDL_DEBUG, "Action is GETENVELOPE\n");
- sieve2_setvalue_string(s, "to", cs->envelope_to);
- sieve2_setvalue_string(s, "from", cs->envelope_from);
+ if (strlen(cs->envelope_to) > 0) {
+ sieve2_setvalue_string(s, "to", cs->envelope_to);
+ }
+ if (strlen(cs->envelope_from) > 0) {
+ sieve2_setvalue_string(s, "from", cs->envelope_from);
+ }
return SIEVE2_OK;
}
ptr->next = sieve_list;
sieve_list = ptr;
end_critical_section(S_SIEVELIST);
+ lprintf(CTDL_DEBUG, "<%s> queued for Sieve processing\n", which_room->QRname);
}
int serv_sieve_room(struct ctdlroom *room)
{
- if (!strcasecmp(&room->QRname[11], MAILROOM)) {
- sieve_queue_room(room);
-/*
- return 1;
-*/
- }
- return 0;
+ if (!strcasecmp(&room->QRname[11], MAILROOM)) {
+ sieve_queue_room(room);
+ }
+ return 0;
}
{
ctdl_sieve_init();
CtdlRegisterProtoHook(cmd_msiv, "MSIV", "Manage Sieve scripts");
+ CtdlRegisterRoomHook(serv_sieve_room);
return "$Id$";
}
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$";