Commit 647ac544 authored by Antonio Radici's avatar Antonio Radici

Imported Upstream version 1.5.20

parent 19304f7c
.deps/
.pc/
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.h
config.h.in
config.h.in~
config.log
config.status
configure
contrib/Makefile
contrib/Makefile.in
doc/.deps/
doc/Makefile
doc/Makefile.in
doc/instdoc.sh
hcachever.sh
imap/.deps/
imap/Makefile
imap/Makefile.in
intl/Makefile
m4/Makefile
m4/Makefile.in
muttbug.sh
po/Makefile
po/Makefile.in
po/POTFILES
stamp-h1
.gitignore
debian/stamp-patched
obj-i486-linux-gnu-patched/
obj-i486-linux-gnu/
This diff is collapsed.
This diff is collapsed.
......@@ -150,7 +150,7 @@ OP_REFORMAT_WINCH "{internal}"
OP_RENAME_MAILBOX "rename the current mailbox (IMAP only)"
OP_REPLY "reply to a message"
OP_RESEND "use the current message as a template for a new one"
OP_SAVE "save message/attachment to a file"
OP_SAVE "save message/attachment to a mailbox/file"
OP_SEARCH "search for a regular expression"
OP_SEARCH_REVERSE "search backwards for a regular expression"
OP_SEARCH_NEXT "search for next match"
......
......@@ -4,6 +4,25 @@ mutt. Please read this file carefully when upgrading your installation.
The keys used are:
!: modified feature, -: deleted feature, +: new feature
hg tip:
! $fcc_attach is a quadoption now
+ $honor_disposition to honor Content-Disposition headers
+ $search_context specifies number of context lines for search results
in pager/page-based menus
+ ssl_use_sslv2 defaults to no
+ uncolor works for header + body objects, too
+ the "flagged" and "replied" flags are enabled/supported for
POP when built with header caching
! browser correctly displays maildir's mtime
+ <set-flag> and <clear-flag> work in the pager, too
+ ~x pattern also matches against In-Reply-To
+ lower case patterns for string searches perform case-insensitive
search as regex patterns do (except IMAP)
+ $ssl_verify_dates controls whether mutt checks the validity period of
SSL certificates
+ $ssl_verify_hostname controls whether mutt will accept certificates whose
host names do not match the host name in the folder URL.
1.5.19 (2009-01-05):
+ support for SSL certificate chains
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ static struct mapping_t AliasHelp[] = {
{ N_("Undel"), OP_UNDELETE },
{ N_("Select"), OP_GENERIC_SELECT_ENTRY },
{ N_("Help"), OP_HELP },
{ NULL }
{ NULL, 0 }
};
static const char *
......
......@@ -70,7 +70,7 @@ static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
u->data = safe_strdup (a->mailbox);
u->next = *expn;
*expn = u;
w = rfc822_cpy_adr (t);
w = rfc822_cpy_adr (t, 0);
w = mutt_expand_aliases_r (w, expn);
if (head)
last->next = w;
......@@ -359,6 +359,7 @@ retry_name:
if (fread(buf, 1, 1, rc) != 1)
{
mutt_perror (_("Error reading alias file"));
safe_fclose (&rc);
return;
}
if (fseek (rc, 0, SEEK_END) < 0)
......@@ -378,7 +379,7 @@ retry_name:
recode_buf (buf, sizeof (buf));
write_safe_address (rc, buf);
fputc ('\n', rc);
fclose (rc);
safe_fclose (&rc);
mutt_message _("Alias added.");
}
else
......@@ -388,7 +389,7 @@ retry_name:
fseek_err:
mutt_perror (_("Error seeking in alias file"));
fclose(rc);
safe_fclose (&rc);
return;
}
......@@ -487,7 +488,9 @@ int mutt_alias_complete (char *s, size_t buflen)
char bestname[HUGE_STRING];
int i;
#ifndef min
#define min(a,b) ((a<b)?a:b)
#endif
if (s[0] != 0) /* avoid empty string as strstr argument */
{
......
......@@ -76,8 +76,8 @@ int mutt_get_tmp_attachment (BODY *a)
else
mutt_perror(fpin ? tempfile : a->filename);
if(fpin) fclose(fpin);
if(fpout) fclose(fpout);
if(fpin) safe_fclose (&fpin);
if(fpout) safe_fclose (&fpout);
return a->unlink ? 0 : -1;
}
......@@ -176,8 +176,8 @@ int mutt_compose_attachment (BODY *a)
goto bailout;
}
mutt_copy_stream (fp, tfp);
fclose (fp);
fclose (tfp);
safe_fclose (&fp);
safe_fclose (&tfp);
mutt_unlink (a->filename);
if (mutt_rename_file (tempfile, a->filename) != 0)
{
......@@ -416,7 +416,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
int use_pipe = 0;
int use_pager = 1;
char type[STRING];
char command[STRING];
char command[HUGE_STRING];
char descrip[STRING];
char *fname;
rfc1524_entry *entry = NULL;
......@@ -551,11 +551,11 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
{
if (a->description)
snprintf (descrip, sizeof (descrip),
"---Command: %-20.20s Description: %s",
_("---Command: %-20.20s Description: %s"),
command, a->description);
else
snprintf (descrip, sizeof (descrip),
"---Command: %-30.30s Attachment: %s", command, type);
_("---Command: %-30.30s Attachment: %s"), command, type);
}
if ((mutt_wait_filter (thepid) || (entry->needsterminal &&
......@@ -601,10 +601,10 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
if (a->description)
strfcpy (descrip, a->description, sizeof (descrip));
else if (a->filename)
snprintf (descrip, sizeof (descrip), "---Attachment: %s : %s",
snprintf (descrip, sizeof (descrip), _("---Attachment: %s: %s"),
a->filename, type);
else
snprintf (descrip, sizeof (descrip), "---Attachment: %s", type);
snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type);
}
/* We only reach this point if there have been no errors */
......@@ -798,21 +798,25 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr)
else
{
/* In recv mode, extract from folder and decode */
STATE s;
memset (&s, 0, sizeof (s));
s.flags |= M_CHARCONV;
if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL)
{
mutt_perror ("fopen");
mutt_sleep (2);
return (-1);
}
fseeko ((s.fpin = fp), m->offset, 0);
mutt_decode_attachment (m, &s);
if (fclose (s.fpout) != 0)
{
mutt_perror ("fclose");
mutt_sleep (2);
return (-1);
}
}
......@@ -884,7 +888,7 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
if (stat (m->filename, &st) == -1)
{
mutt_perror ("stat");
fclose (s.fpout);
safe_fclose (&s.fpout);
return (-1);
}
......@@ -915,7 +919,7 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
mutt_body_handler (m, &s);
fclose (s.fpout);
safe_fclose (&s.fpout);
if (fp == NULL)
{
m->length = 0;
......@@ -926,7 +930,7 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
m->parts = saved_parts;
m->hdr = saved_hdr;
}
fclose (s.fpin);
safe_fclose (&s.fpin);
}
return (0);
......
......@@ -136,6 +136,13 @@ FILE* mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp)
snprintf (path, sizeof (path), "%s%s%s", bcache->path, id,
tmp ? ".tmp" : "");
if ((fp = safe_fopen (path, "w+")))
goto out;
if (errno == EEXIST)
/* clean up leftover tmp file */
mutt_unlink (path);
s = strchr (path + 1, '/');
while (!(fp = safe_fopen (path, "w+")) && errno == ENOENT && s)
{
......@@ -147,6 +154,7 @@ FILE* mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp)
s = strchr (s + 1, '/');
}
out:
dprint (3, (debugfile, "bcache: put: '%s'\n", path));
return fp;
......
......@@ -46,7 +46,7 @@ static struct mapping_t FolderHelp[] = {
{ N_("Chdir"), OP_CHANGE_DIRECTORY },
{ N_("Mask"), OP_ENTER_MASK },
{ N_("Help"), OP_HELP },
{ NULL }
{ NULL, 0 }
};
typedef struct folder_t
......@@ -460,6 +460,21 @@ static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
if ((! S_ISREG (s.st_mode)) && (! S_ISDIR (s.st_mode)) &&
(! S_ISLNK (s.st_mode)))
continue;
if (mx_is_maildir (tmp->path))
{
struct stat st2;
char md[_POSIX_PATH_MAX];
snprintf (md, sizeof (md), "%s/new", tmp->path);
if (stat (md, &s) < 0)
s.st_mtime = 0;
snprintf (md, sizeof (md), "%s/cur", tmp->path);
if (stat (md, &st2) < 0)
st2.st_mtime = 0;
if (st2.st_mtime > s.st_mtime)
s.st_mtime = st2.st_mtime;
}
strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
mutt_pretty_mailbox (buffer, sizeof (buffer));
......
......@@ -128,12 +128,37 @@ static int test_new_folder (const char *path)
if ((f = fopen (path, "rb")))
{
rc = test_last_status_new (f);
fclose (f);
safe_fclose (&f);
}
return rc;
}
void mutt_buffy_cleanup (const char *buf, struct stat *st)
{
struct utimbuf ut;
BUFFY *tmp;
if (option(OPTCHECKMBOXSIZE))
{
tmp = mutt_find_mailbox (buf);
if (tmp && !tmp->new)
mutt_update_mailbox (tmp);
}
else
{
/* fix up the times so buffy won't get confused */
if (st->st_mtime > st->st_atime)
{
ut.actime = st->st_atime;
ut.modtime = time (NULL);
utime (buf, &ut);
}
else
utime (buf, NULL);
}
}
BUFFY *mutt_find_mailbox (const char *path)
{
BUFFY *tmp = NULL;
......@@ -171,6 +196,8 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
BUFFY **tmp,*tmp1;
char buf[_POSIX_PATH_MAX];
struct stat sb;
char f1[PATH_MAX], f2[PATH_MAX];
char *p, *q;
while (MoreArgs (s))
{
......@@ -181,7 +208,6 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
{
for (tmp = &Incoming; *tmp;)
{
FREE (&((*tmp)->path));
tmp1=(*tmp)->next;
FREE (tmp); /* __FREE_CHECKED__ */
*tmp=tmp1;
......@@ -194,11 +220,16 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
/* Skip empty tokens. */
if(!*buf) continue;
/* simple check to avoid duplicates */
/* avoid duplicates */
p = realpath (buf, f1);
for (tmp = &Incoming; *tmp; tmp = &((*tmp)->next))
{
if (mutt_strcmp (buf, (*tmp)->path) == 0)
q = realpath ((*tmp)->path, f2);
if (mutt_strcmp (p ? p : buf, q ? q : (*tmp)->path) == 0)
{
dprint(3,(debugfile,"mailbox '%s' already registered as '%s'\n", buf, (*tmp)->path));
break;
}
}
if(data == M_UNMAILBOXES)
......@@ -216,7 +247,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
if (!*tmp)
{
*tmp = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
(*tmp)->path = safe_strdup (buf);
strfcpy ((*tmp)->path, buf, sizeof ((*tmp)->path));
(*tmp)->next = NULL;
/* it is tempting to set magic right here */
(*tmp)->magic = 0;
......@@ -260,6 +291,10 @@ int mutt_buffy_check (int force)
struct stat contex_sb;
time_t t;
sb.st_size=0;
contex_sb.st_dev=0;
contex_sb.st_ino=0;
#ifdef USE_IMAP
/* update postponed count as well, on force */
if (force)
......@@ -476,59 +511,34 @@ int mutt_buffy_notify (void)
* mutt_buffy() -- incoming folders completion routine
*
* given a folder name, this routine gives the next incoming folder with new
* new mail.
* mail.
*/
void mutt_buffy (char *s, size_t slen)
{
int count;
BUFFY *tmp = Incoming;
int pass, found = 0;
mutt_expand_path (s, _POSIX_PATH_MAX);
switch (mutt_buffy_check (0))
{
case 0:
*s = '\0';
break;
case 1:
mutt_expand_path (s, slen);
while (tmp && !tmp->new)
tmp = tmp->next;
if (!tmp)
{
*s = '\0';
mutt_buffy_check (1); /* buffy was wrong - resync things */
break;
}
strfcpy (s, tmp->path, slen);
mutt_pretty_mailbox (s, slen);
break;
default:
count = 0;
while (count < 3)
{
if (mutt_strcmp (s, tmp->path) == 0)
count++;
else if (count && tmp->new)
break;
tmp = tmp->next;
if (!tmp)
if (mutt_buffy_check (0))
{
for (pass = 0; pass < 2; pass++)
for (tmp = Incoming; tmp; tmp = tmp->next)
{
tmp = Incoming;
count++;
mutt_expand_path (tmp->path, sizeof (tmp->path));
if ((found || pass) && tmp->new)
{
strfcpy (s, tmp->path, slen);
mutt_pretty_mailbox (s, slen);
return;
}
if (mutt_strcmp (s, tmp->path) == 0)
found = 1;
}
}
if (count >= 3)
{
*s = '\0';
mutt_buffy_check (1); /* buffy was wrong - resync things */
break;
}
strfcpy (s, tmp->path, slen);
mutt_pretty_mailbox (s, slen);
break;
mutt_buffy_check (1); /* buffy was wrong - resync things */
}
/* no folders with new mail */
*s = '\0';
}
......@@ -22,7 +22,7 @@
typedef struct buffy_t
{
char *path;
char path[_POSIX_PATH_MAX];
off_t size;
struct buffy_t *next;
short new; /* mailbox has new mail */
......@@ -39,3 +39,7 @@ extern time_t BuffyDoneTime; /* last time we knew for sure how much mail there w
BUFFY *mutt_find_mailbox (const char *path);
void mutt_update_mailbox (BUFFY * b);
/* fixes up atime + mtime after mbox/mmdf mailbox was modified
according to stat() info taken before a modification */
void mutt_buffy_cleanup (const char *buf, struct stat *st);
......@@ -364,12 +364,12 @@ int mutt_parse_unmono (BUFFER *buf, BUFFER *s, unsigned long data,
return _mutt_parse_uncolor(buf, s, data, err, 0);
}
static int
_mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err,
short parse_uncolor)
static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data,
BUFFER *err, short parse_uncolor)