Commit 190f7bed 190f7bed6ba91588bd144b9fa87d454c3f2e155c by Sergey Poznyakoff

(pop3d_mark_deleted,pop3d_is_deleted)

(pop3d_unset_deleted,pop3d_undelete_all): New functions
1 parent 8ff4fb1e
......@@ -269,3 +269,44 @@ pop3d_readline (char *buffer, size_t size)
/* Caller should not free () this ... should we strdup() then? */
return buffer;
}
/* Handling of the deletion marks */
void
pop3d_mark_deleted (attribute_t attr)
{
attribute_set_userflag (attr, POP3_ATTRIBUTE_DELE);
}
int
pop3d_is_deleted (attribute_t attr)
{
return attribute_is_deleted (attr)
|| attribute_is_userflag (attr, POP3_ATTRIBUTE_DELE);
}
void
pop3d_unset_deleted (attribute_t attr)
{
if (attribute_is_userflag (attr, POP3_ATTRIBUTE_DELE))
attribute_unset_userflag (attr, POP3_ATTRIBUTE_DELE);
}
void
pop3d_undelete_all ()
{
size_t i;
size_t total = 0;
mailbox_messages_count (mbox, &total);
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mailbox_get_message (mbox, i, &msg);
message_get_attribute (msg, &attr);
attribute_unset_deleted (attr);
}
}
......
......@@ -144,11 +144,10 @@
#ifndef MAXHOSTNAMELEN
/* Maximum length of a hostname (is this defined somewhere else?). */
/* MAXHOSTNAMELEN is already define on Solaris. */
#define MAXHOSTNAMELEN 64
/* MAXHOSTNAMELEN is already defined on Solaris. */
# define MAXHOSTNAMELEN 64
#endif
#define POP3_ATTRIBUTE_DELE 0x0001
#define AUTHORIZATION 0
......@@ -187,6 +186,7 @@ extern int debug_mode;
extern int tls_available;
extern int tls_done;
#endif /* WITH_TLS */
extern int undelete_on_startup;
extern void pop3d_bye __P ((void));
extern int pop3d_abquit __P ((int));
......@@ -224,6 +224,11 @@ extern void pop3d_flush_output __P ((void));
extern int pop3d_is_master __P ((void));
extern void pop3d_mark_deleted __P((attribute_t attr));
extern int pop3d_is_deleted __P((attribute_t attr));
extern void pop3d_unset_deleted __P((attribute_t attr));
void pop3d_undelete_all __P((void));
#ifdef WITH_TLS
extern int pop3d_init_tls_server __P ((void));
extern void pop3d_deinit_tls_server __P ((void));
......