summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2013-10-13 02:08:28 -0600
committerEduardo Chappa <chappa@washington.edu>2013-10-13 02:08:28 -0600
commitee95edb6a42df4b45c82080c32f852781f289a02 (patch)
tree1fc71517846468677163b76dbf2400b59d7997b5 /pith
parent30a979ab1460a57d466a6a5cc6adb96eac452ce4 (diff)
downloadalpine-ee95edb6a42df4b45c82080c32f852781f289a02.tar.xz
* Fixes in Pico so that it will crash in big files, instead of looping
forever. Todo: see how this can be improved. * Add support for UID EXPUNGE in selected folders.
Diffstat (limited to 'pith')
-rw-r--r--pith/mailcmd.c9
-rw-r--r--pith/mailcmd.h2
-rw-r--r--pith/msgno.c3
-rw-r--r--pith/msgno.h2
-rw-r--r--pith/pine.hlp68
5 files changed, 53 insertions, 31 deletions
diff --git a/pith/mailcmd.c b/pith/mailcmd.c
index 78ba98ad..23ea51ba 100644
--- a/pith/mailcmd.c
+++ b/pith/mailcmd.c
@@ -281,7 +281,7 @@ cmd_undelete(struct pine *state, MSGNO_S *msgmap, int copts)
int
-cmd_expunge_work(MAILSTREAM *stream, MSGNO_S *msgmap)
+cmd_expunge_work(MAILSTREAM *stream, MSGNO_S *msgmap, char *seq)
{
long old_max_msgno;
int rv = 0;
@@ -289,7 +289,7 @@ cmd_expunge_work(MAILSTREAM *stream, MSGNO_S *msgmap)
old_max_msgno = mn_get_total(msgmap);
delete_filtered_msgs(stream);
ps_global->expunge_in_progress = 1;
- mail_expunge(stream);
+ mail_expunge_full(stream, seq, 0);
ps_global->expunge_in_progress = 0;
dprint((2,"expunge complete cur:%ld max:%ld\n",
@@ -861,7 +861,8 @@ do_broach_folder(char *newfolder, CONTEXT_S *new_context, MAILSTREAM **streamp,
if(IS_NEWS(ps_global->mail_stream)
&& ps_global->mail_stream->rdonly)
msgno_exclude_deleted(ps_global->mail_stream,
- sp_msgmap(ps_global->mail_stream));
+ sp_msgmap(ps_global->mail_stream),
+ NULL);
if(mn_get_total(ps_global->msgmap) > 0)
mn_set_cur(ps_global->msgmap,
@@ -996,7 +997,7 @@ do_broach_folder(char *newfolder, CONTEXT_S *new_context, MAILSTREAM **streamp,
* hidden from view...
*/
if(IS_NEWS(ps_global->mail_stream) && ps_global->mail_stream->rdonly)
- msgno_exclude_deleted(ps_global->mail_stream, ps_global->msgmap);
+ msgno_exclude_deleted(ps_global->mail_stream, ps_global->msgmap, NULL);
if(we_cancel && F_OFF(F_QUELL_FILTER_MSGS, ps_global))
cancel_busy_cue(0);
diff --git a/pith/mailcmd.h b/pith/mailcmd.h
index 9e99c6f3..84b7e213 100644
--- a/pith/mailcmd.h
+++ b/pith/mailcmd.h
@@ -57,7 +57,7 @@ void cmd_cancelled(char *);
void cmd_quota(struct pine *);
int cmd_delete(struct pine *, MSGNO_S *, int, char *(*)(struct pine *, MSGNO_S *));
int cmd_undelete(struct pine *, MSGNO_S *, int);
-int cmd_expunge_work(MAILSTREAM *, MSGNO_S *);
+int cmd_expunge_work(MAILSTREAM *, MSGNO_S *, char *);
CONTEXT_S *broach_get_folder(CONTEXT_S *, int *, char **);
int do_broach_folder(char *, CONTEXT_S *, MAILSTREAM **, unsigned long);
void expunge_and_close(MAILSTREAM *, char **, unsigned long);
diff --git a/pith/msgno.c b/pith/msgno.c
index 465a42e0..75669225 100644
--- a/pith/msgno.c
+++ b/pith/msgno.c
@@ -252,7 +252,7 @@ msgno_dec(MAILSTREAM *stream, MSGNO_S *msgs, int flags)
f -- flags to use a purge criteria
----*/
void
-msgno_exclude_deleted(MAILSTREAM *stream, MSGNO_S *msgs)
+msgno_exclude_deleted(MAILSTREAM *stream, MSGNO_S *msgs, char *sequence)
{
long i, rawno;
MESSAGECACHE *mc;
@@ -281,6 +281,7 @@ msgno_exclude_deleted(MAILSTREAM *stream, MSGNO_S *msgs)
for(i = msgs->max_msgno; i >= 1L; i--)
if((rawno = mn_m2raw(msgs, i)) > 0L && stream && rawno <= stream->nmsgs
&& (mc = mail_elt(stream, rawno))
+ && (sequence ? mc->sequence : 1)
&& ((mc->valid && mc->deleted) || (!mc->valid && mc->searched))){
msgno_exclude(stream, msgs, i, 0);
need_isort_reset++;
diff --git a/pith/msgno.h b/pith/msgno.h
index 00b669c1..873ed7bb 100644
--- a/pith/msgno.h
+++ b/pith/msgno.h
@@ -186,7 +186,7 @@ void msgno_reset_isort(MSGNO_S *);
void msgno_give(MSGNO_S **);
void msgno_inc(MAILSTREAM *, MSGNO_S *, int);
void msgno_dec(MAILSTREAM *, MSGNO_S *, int);
-void msgno_exclude_deleted(MAILSTREAM *, MSGNO_S *);
+void msgno_exclude_deleted(MAILSTREAM *, MSGNO_S *, char *);
void msgno_exclude(MAILSTREAM *, MSGNO_S *, long, int);
int msgno_include(MAILSTREAM *, MSGNO_S *, int);
void msgno_add_raw(MSGNO_S *, long);
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 8e0feacb..ea85d75c 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 33 2013-10-05 22:46:52
+Alpine Commit 34 2013-10-13 00:44:53
============= h_news =================
<HTML>
<HEAD>
@@ -179,31 +179,36 @@ Additions include:
<P>
<UL>
- <LI> Alpine does not attempt to automatically reopen a collection that
- was not opened due to cancellation by the user. Instead, the user
- must try to open it explicitly.
+ <LI> Add support to selective expunge through a subcommand of the
+ select-apply commands. Read more in the <A
+ HREF="h_index_cmd_expunge">help</A> for the expunge command.
+ <LI> Alpine does not attempt to automatically reopen a collection
+ that was not opened due to cancellation by the user.
+ Instead, the user must try to open it explicitly.
<LI> Alpine searches for a certificate that matches an email address in
- all addresses in a certificate (instead of just the first one) but
- when it tries to unlock the certificate, it asks for the password
- for the first email address in that certificate.
+ all addresses in a certificate (instead of just the first
+ one) but when it tries to unlock the certificate, it asks
+ for the password for the first email address in that
+ certificate.
<LI> Add /tls1, /tls1_1, /tls1_2 and /dtls1 to the definition of a
- server to use different ways to connect using ssl, for example
- {server.com/tls1} will attempt to connect to server.com at the ssl
- imap port (port 993) and establish a connection using TLSv1. These
- flags can be used in conjunction with the /ssl flag, the ssl flag
- is redundant. Conversely, however, the /ssl flag does not imply any
- of these flags; the /ssl flag means SSLv3 or, if not available,
+ server to use different ways to connect using ssl, for
+ example {server.com/tls1} will attempt to connect to
+ server.com at the ssl imap port (port 993) and establish a
+ connection using TLSv1. These flags can be used in
+ conjunction with the /ssl flag, the ssl flag is redundant.
+ Conversely, however, the /ssl flag does not imply any of
+ these flags; the /ssl flag means SSLv3 or, if not available,
SSLv2 in the SSL port.
- <LI> Experimental: Write the content-type of a message in lowercase, as some
- non-compliant servers do not understand uppercase content-type, such as
- those of GMX.de.
- <LI> Opening a folder updates recent count in maildrops (this already works
- for other types of folders)
- <LI> Automatically redraw screen after opening an attachment instead of
- simply clearing it.
- <LI> Pico: Justification works without need of a predefined quote string.
- This allows justification of blocks of text that are indented with
- spaces.
+ <LI> Experimental: Write the content-type of a message in
+ lowercase, as some non-compliant servers do not understand
+ uppercase content-type, such as those of GMX.de.
+ <LI> Opening a folder updates recent count in maildrops (this
+ already works for other types of folders)
+ <LI> Automatically redraw screen after opening an attachment
+ instead of simply clearing it.
+ <LI> Pico: Justification works without need of a predefined quote
+ string. This allows justification of blocks of text that are
+ indented with spaces.
</UL>
<P>
@@ -3182,7 +3187,6 @@ There are also additional details on
&lt;End of help on this topic&gt;
</BODY>
</HTML>
-
====== h_help_index ======
<HTML>
<HEAD>
@@ -5735,6 +5739,22 @@ the text from the current folder. With newsgroups or shared mailboxes,
you don't have permission to actually remove the message, so it is an
exclude -- Alpine removes the message from your view of the folder even
though it is not technically gone.
+
+<P> A selective expunge command is available in IMAP folders that support
+the UID EXPUNGE extension in <A
+HREF="http://tools.ietf.org/html/rfc4315">RFC 4315</A> as well as for all
+other folders (local folders in all formats, POP3 inbox, and newsgroups)
+as a subcommand of the apply command. If some selected messages are marked
+deleted, then the apply command will offer the eXpunge command, which when
+executed will only expunge those messages that are selected and deleted.
+
+<P>
+Observe that the expunge command (when not used from the apply command)
+will expunge/exclude all deleted messages from the folder, and so all
+messages marked deleted will be expunged, regardless of if they are
+selected or not. In other words, there is no protection against
+potentially expunging more messages than only those that have been
+selected and deleted.
<P>
The configuration features