#include "html.h"
#include "genstamp.h"
#include "internet_addressing.h"
-#include "serv_fulltext.h"
#include "vcard.h"
#include "euidindex.h"
#include "journaling.h"
#include "citadel_dirs.h"
-#include "serv_network.h"
-#ifdef HAVE_LIBSIEVE
-# include "serv_sieve.h"
-#endif /* HAVE_LIBSIEVE */
long config_msgnum;
struct addresses_to_be_filed *atbf = NULL;
* over again.
*/
if ( (num_msgs > 0) && (mode == MSGS_SEARCH) && (search_string) ) {
- ft_search(&num_search_msgs, &search_msgs, search_string);
+
+ /* Call search module via hook mechanism.
+ * NULL means use any search function available.
+ * otherwise replace with a char * to name of search routine
+ */
+ CtdlModuleDoSearch(&num_search_msgs, &search_msgs, search_string, "fulltext");
+
if (num_search_msgs > 0) {
int orig_num_msgs;
lprintf(CTDL_DEBUG, "CtdlSaveMsgPointerInRoom() skips repl checks\n");
}
- /* Submit this room for net processing */
- network_queue_room(&CC->room, NULL);
-
-#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 */
+ /* Submit this room for processing by hooks */
+ PerformRoomHooks(&CC->room);
/* Go back to the room we were in before we wandered here... */
getroom(&CC->room, hold_rm);
char dest_node[256];
char buf[1024];
struct CtdlMessage *msg;
+ int i;
msg = malloc(sizeof(struct CtdlMessage));
memset(msg, 0, sizeof(struct CtdlMessage));
striplt(recipient);
striplt(recp_cc);
- snprintf(buf, sizeof buf, "cit%ld", author->usernum); /* Path */
- msg->cm_fields['P'] = strdup(buf);
+ /* Path or Return-Path */
+ if (my_email == NULL) my_email = "";
+
+ if (strlen(my_email) > 0) {
+ msg->cm_fields['P'] = strdup(my_email);
+ }
+ else {
+ snprintf(buf, sizeof buf, "%s", author->fullname);
+ msg->cm_fields['P'] = strdup(buf);
+ }
+ for (i=0; (msg->cm_fields['P'][i]!=0); ++i) {
+ if (isspace(msg->cm_fields['P'][i])) {
+ msg->cm_fields['P'][i] = '_';
+ }
+ }
snprintf(buf, sizeof buf, "%ld", (long)time(NULL)); /* timestamp */
msg->cm_fields['T'] = strdup(buf);
*/
if (smi.meta_refcount == 0) {
lprintf(CTDL_DEBUG, "Deleting message <%ld>\n", msgnum);
-
- /* Remove from fulltext index */
- if (config.c_enable_fulltext) {
- ft_index_message(msgnum, 0);
- }
+
+ /* Call delete hooks with NULL room to show it has gone altogether */
+ PerformDeleteHooks(NULL, msgnum);
/* Remove from message base */
delnum = msgnum;