void CtdlRegisterXmsgHook(int (*fcn_ptr)(char *, char *, char *, char *), int order);
void CtdlUnregisterXmsgHook(int (*fcn_ptr)(char *, char *, char *, char *), int order);
-void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes*),
- int EventType);
-void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *),
- int EventType);
+void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType);
+void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType);
void CtdlRegisterRoomHook(int (*fcn_ptr)(struct ctdlroom *) );
void CtdlUnregisterRoomHook(int (*fnc_ptr)(struct ctdlroom *) );
*/
int CtdlIsMe(char *addr, int addr_buf_len)
{
- recptypes *recp;
+ struct recptypes *recp;
int i;
recp = validate_recipients(addr, NULL, 0);
*
* Caller needs to free the result using free_recipients()
*/
-recptypes *validate_recipients(const char *supplied_recipients, const char *RemoteIdentifier, int Flags) {
+struct recptypes *validate_recipients(const char *supplied_recipients, const char *RemoteIdentifier, int Flags) {
struct CitContext *CCC = CC;
- recptypes *ret;
+ struct recptypes *ret;
char *recipients = NULL;
char *org_recp;
char this_recp[256];
int in_quotes = 0;
/* Initialize */
- ret = (recptypes *) malloc(sizeof(recptypes));
+ ret = (struct recptypes *) malloc(sizeof(struct recptypes));
if (ret == NULL) return(NULL);
/* Set all strings to null and numeric values to zero */
- memset(ret, 0, sizeof(recptypes));
+ memset(ret, 0, sizeof(struct recptypes));
if (supplied_recipients == NULL) {
recipients = strdup("");
/*
* Destructor for recptypes
*/
-void free_recipients(recptypes *valid) {
+void free_recipients(struct recptypes *valid) {
if (valid == NULL) {
return;
#include "server.h"
#include "ctdl_module.h"
-recptypes *validate_recipients(const char *recipients, const char *RemoteIdentifier, int Flags);
-void free_recipients(recptypes *);
+struct recptypes *validate_recipients(const char *recipients, const char *RemoteIdentifier, int Flags);
+void free_recipients(struct recptypes *);
void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name);
char *rfc822_fetch_field(const char *rfc822, const char *fieldname);
void sanitize_truncated_recipient(char *str);
*/
void JournalBackgroundSubmit(struct CtdlMessage *msg,
StrBuf *saved_rfc822_version,
- recptypes *recps) {
+ struct recptypes *recps) {
struct jnlq *jptr = NULL;
return;
}
memset(jptr, 0, sizeof(struct jnlq));
- if (recps != NULL) memcpy(&jptr->recps, recps, sizeof(recptypes));
+ if (recps != NULL) memcpy(&jptr->recps, recps, sizeof(struct recptypes));
if (!CM_IsEmpty(msg, eAuthor)) jptr->from = strdup(msg->cm_fields[eAuthor]);
if (!CM_IsEmpty(msg, erFc822Addr)) jptr->rfca = strdup(msg->cm_fields[erFc822Addr]);
if (!CM_IsEmpty(msg, eMsgSubject)) jptr->subj = strdup(msg->cm_fields[eMsgSubject]);
void JournalRunQueueMsg(struct jnlq *jmsg) {
struct CtdlMessage *journal_msg = NULL;
- recptypes *journal_recps = NULL;
+ struct recptypes *journal_recps = NULL;
StrBuf *message_text = NULL;
char mime_boundary[256];
long mblen;
rfc822len = 0;
}
- message_text = NewStrBufPlain(NULL, rfc822len + sizeof(recptypes) + 1024);
+ message_text = NewStrBufPlain(NULL, rfc822len + sizeof(struct recptypes) + 1024);
/*
* Here is where we begin to compose the journalized message.
struct jnlq {
struct jnlq *next;
- recptypes recps;
+ struct recptypes recps;
char *from;
char *node;
char *rfca;
void JournalBackgroundSubmit(struct CtdlMessage *msg,
StrBuf *saved_rfc822_version,
- recptypes *recps);
+ struct recptypes *recps);
void JournalRunQueueMsg(struct jnlq *jmsg);
void JournalRunQueue(void);
* Pre-save hook for saving a message in a blog room.
* (Do we want to only do this for top-level messages?)
*/
-int blog_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) {
+int blog_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) {
/* Only run this hook for blog rooms */
if (CC->room.QRdefaultview != VIEW_BLOG) {
icalproperty *summary = NULL;
char summary_string[SIZ];
icalproperty *me_attend = NULL;
- recptypes *recp = NULL;
+ struct recptypes *recp = NULL;
icalparameter *partstat = NULL;
char *serialized_reply = NULL;
char *reply_message_text = NULL;
const char *ch;
struct CtdlMessage *msg = NULL;
- recptypes *valid = NULL;
+ struct recptypes *valid = NULL;
*organizer_string = '\0';
strcpy(summary_string, "Calendar item");
icalcomponent *encaps = NULL;
icalcomponent *fb = NULL;
int found_user = (-1);
- recptypes *recp = NULL;
+ struct recptypes *recp = NULL;
char buf[256];
char host[256];
char type[256];
icalcomponent *encaps = NULL;
char *request_message_text = NULL;
struct CtdlMessage *msg = NULL;
- recptypes *valid = NULL;
+ struct recptypes *valid = NULL;
char attendees_string[SIZ];
int num_attendees = 0;
char this_attendee[256];
* If the message is being saved, we also set various message header fields
* using data found in the iCalendar object.
*/
-int ical_obj_beforesave(struct CtdlMessage *msg, recptypes *recp)
+int ical_obj_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
{
/* First determine if this is a calendar or tasks room */
if ( (CC->room.QRdefaultview != VIEW_CALENDAR)
* (This will start back end tasks such as automatic generation of invitations,
* if such actions are appropriate.)
*/
-int ical_obj_aftersave(struct CtdlMessage *msg, recptypes *recp)
+int ical_obj_aftersave(struct CtdlMessage *msg, struct recptypes *recp)
{
char roomname[ROOMNAMELEN];
/*
* Connect to the clamd server and scan a message.
*/
-int clamd(struct CtdlMessage *msg, recptypes *recp) {
+int clamd(struct CtdlMessage *msg, struct recptypes *recp) {
int sock = (-1);
int streamsock = (-1);
char clamhosts[SIZ];
int anonymous = 0;
char errmsg[SIZ];
int err = 0;
- recptypes *valid = NULL;
- recptypes *valid_to = NULL;
- recptypes *valid_cc = NULL;
- recptypes *valid_bcc = NULL;
+ struct recptypes *valid = NULL;
+ struct recptypes *valid_to = NULL;
+ struct recptypes *valid_cc = NULL;
+ struct recptypes *valid_bcc = NULL;
char subject[SIZ];
int subject_required = 0;
int do_confirm = 0;
char savedroom[ROOMNAMELEN];
int msgs, new;
int ret;
- recptypes *valid;
+ struct recptypes *valid;
struct ctdluser temp;
if (num_parms != 4) {
return(1); // don't delete the inbox copy if this failed
}
- recptypes *valid = validate_recipients(rule->redirect_to, NULL, 0);
+ struct recptypes *valid = validate_recipients(rule->redirect_to, NULL, 0);
if (valid == NULL) {
syslog(LOG_WARNING, "inboxrules: inbox_do_redirect() invalid recipient <%s>", rule->redirect_to);
return(1); // don't delete the inbox copy if this failed
* This handler detects changes being made to the system's Internet
* configuration.
*/
-int inetcfg_aftersave(struct CtdlMessage *msg, recptypes *recp) {
+int inetcfg_aftersave(struct CtdlMessage *msg, struct recptypes *recp) {
char *ptr;
int linelen;
if (number_of_messages_processed > 0) {
syslog(LOG_DEBUG, "listdeliver: new lastsent is %ld", ld.msgnum);
+
// FIXME write lastsent back to netconfig
+ syslog(LOG_DEBUG, "\033[31mBEFORE:<%s>\033[0m", netconfig);
+ syslog(LOG_DEBUG, "\033[32mAFTER:<%s>\033[0m", netconfig);
+
+
+
+
+
}
}
* and modern vNote format notes) and does its best to learn the subject (summary)
* and EUID (uid) of the note for Citadel's own nefarious purposes.
*/
-int serv_notes_beforesave(struct CtdlMessage *msg, recptypes *recp)
+int serv_notes_beforesave(struct CtdlMessage *msg, struct recptypes *recp)
{
char *p;
int a, i;
{
struct CitContext *CCC = CC;
char message_to_spammer[SIZ];
- recptypes *valid = NULL;
+ struct recptypes *valid = NULL;
citsmtp *sSMTP = SMTP;
if (StrLength(sSMTP->from) == 0) {
struct CtdlMessage *msg = NULL;
long msgnum = (-1L);
char nowstamp[SIZ];
- recptypes *valid;
+ struct recptypes *valid;
int scan_errors;
int i;
citsmtp *sSMTP = SMTP;
* not happen because the delivery instructions message does not
* contain a recipient.
*/
-int smtp_aftersave(struct CtdlMessage *msg, recptypes * recps)
+int smtp_aftersave(struct CtdlMessage *msg, struct recptypes *recps)
{
if ((recps != NULL) && (recps->num_internet > 0)) {
struct CtdlMessage *imsg = NULL;
int num_bounces = 0;
int bounce_this = 0;
struct CtdlMessage *bmsg = NULL;
- recptypes *valid;
+ struct recptypes *valid;
int successful_bounce = 0;
static int seq = 0;
StrBuf *BounceMB;
/*
* Connect to the SpamAssassin server and scan a message.
*/
-int spam_assassin(struct CtdlMessage *msg, recptypes *recp) {
+int spam_assassin(struct CtdlMessage *msg, struct recptypes *recp) {
int sock = (-1);
char sahosts[SIZ];
int num_sahosts;
* function accordingly (delete the user's existing vCard in the config room
* and in the global address book).
*/
-int vcard_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) {
+int vcard_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) {
char *s;
char buf[SIZ];
struct ctdluser usbuf;
* function accordingly (copy the vCard from the config room to the global
* address book).
*/
-int vcard_upload_aftersave(struct CtdlMessage *msg, recptypes *recp) {
+int vcard_upload_aftersave(struct CtdlMessage *msg, struct recptypes *recp) {
char *ptr;
int linelen;
long I;
if (strncasecmp(cmdbuf, "GET ", 4)==0)
{
- recptypes *rcpt;
+ struct recptypes *rcpt;
char *argbuf = &cmdbuf[4];
extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);
* Before allowing a wiki page save to execute, we have to perform version control.
* This involves fetching the old version of the page if it exists.
*/
-int wiki_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) {
+int wiki_upload_beforesave(struct CtdlMessage *msg, struct recptypes *recp) {
struct CitContext *CCC = CC;
long old_msgnum = (-1L);
struct CtdlMessage *old_msg = NULL;
* Save a message to disk and submit it into the delivery system.
*/
long CtdlSubmitMsg(struct CtdlMessage *msg, /* message to save */
- recptypes *recps, /* recipients (if mail) */
+ struct recptypes *recps, /* recipients (if mail) */
const char *force /* force a particular room? */
) {
char hold_rm[ROOMNAMELEN];
const char *subject)
{
struct CtdlMessage *msg;
- recptypes *recp = NULL;
+ struct recptypes *recp = NULL;
msg = malloc(sizeof(struct CtdlMessage));
memset(msg, 0, sizeof(struct CtdlMessage));
void output_mime_parts(char *);
long send_message (struct CtdlMessage *);
void loadtroom (void);
-long CtdlSubmitMsg(struct CtdlMessage *, recptypes *, const char *);
+long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, const char *);
long quickie_message(const char *from, const char *fromaddr, const char *to, char *room, const char *text, int format_type, const char *subject);
void GetMetaData(struct MetaData *, long);
void PutMetaData(struct MetaData *);
typedef struct MessageFunctionHook MessageFunctionHook;
struct MessageFunctionHook {
MessageFunctionHook *next;
- int (*h_function_pointer) (struct CtdlMessage *msg, recptypes *recps);
+ int (*h_function_pointer) (struct CtdlMessage *msg, struct recptypes *recps);
int eventtype;
};
MessageFunctionHook *MessageHookTable = NULL;
}
-void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *), int EventType)
+void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
{
MessageFunctionHook *newfcn;
}
-void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, recptypes *), int EventType)
+void CtdlUnregisterMessageHook(int (*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
{
MessageFunctionHook *cur, *p, *last;
last = NULL;
}
}
-int PerformMessageHooks(struct CtdlMessage *msg, recptypes *recps, int EventType)
+int PerformMessageHooks(struct CtdlMessage *msg, struct recptypes *recps, int EventType)
{
MessageFunctionHook *fcn = NULL;
int total_retval = 0;
int PerformXmsgHooks(char *, char *, char *, char *);
-int PerformMessageHooks(struct CtdlMessage *, recptypes *recps, int EventType);
+int PerformMessageHooks(struct CtdlMessage *, struct recptypes *recps, int EventType);
int PerformRoomHooks(struct ctdlroom *);
/* Data structure returned by validate_recipients() */
-typedef struct __recptypes {
+struct recptypes {
int recptypes_magic;
int num_local;
int num_internet;
char *bounce_to;
char *envelope_from;
char *sending_room;
-} recptypes;
+};
#define RECPTYPES_MAGIC 0xfeeb
else {
/* native auth mode */
- recptypes *valid = NULL;
+ struct recptypes *valid = NULL;
/* First, try to log in as if the supplied name is a display name */
found_user = CtdlGetUser(&CC->user, username);