+2003-06-23 [thorsten] 0.9.0claws57
+
+ * src/pop.[ch]
+ added mail_receive_hook to allow modifications
+ directly after retrieval (e.g. adding headers).
+
2003-06-23 [paul] 0.9.0claws56
* src/sourcewindow.c
#include "recv.h"
#include "log.h"
+#include "hooks.h"
static gint pop3_greeting_recv (Pop3Session *session,
const gchar *msg);
{
gchar *file;
gint drop_ok;
+ MailReceiveData mail_receive_data;
+
+ mail_receive_data.session = session;
+ mail_receive_data.data = g_strndup(data, len);
+ hooks_invoke(MAIL_RECEIVE_HOOKLIST, &mail_receive_data);
file = get_tmp_file();
- if (pop3_write_msg_to_file(file, data, len) < 0) {
+ if (pop3_write_msg_to_file(file, mail_receive_data.data,
+ strlen(mail_receive_data.data)) < 0) {
g_free(file);
+ g_free(mail_receive_data.data);
session->error_val = PS_IOERR;
return -1;
}
+ g_free(mail_receive_data.data);
/* drop_ok: 0: success 1: don't receive -1: error */
drop_ok = inc_drop_message(file, session);
#define POP3_SESSION(obj) ((Pop3Session *)obj)
+#define MAIL_RECEIVE_HOOKLIST "mail_receive_hooklist"
+struct _MailReceiveData
+{
+ Pop3Session *session;
+ char *data;
+};
+typedef struct _MailReceiveData MailReceiveData;
+
typedef enum {
POP3_READY,
POP3_GREETING,