~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to mx.c

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Radici
  • Date: 2009-06-14 20:53:18 UTC
  • mfrom: (1.3.1 upstream)
  • mto: (2.1.3 squeeze)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20090614205318-wf0sqy1o3km636li
Tags: 1.5.20-1
* New upstream release, includes the following features:
  + Bounced messages contains From: headers (Closes: 93268)
  + Attachments displayed based on Content-Disposition (Closes: 199709)
  + fcc to a mailbox does not raise the 'new' flag (Closes: 209390)
  + '!' supported as suffix in gpg keys (Closes: 277945)
  + failed attachment saving shows an error message (Closes: 292350)
  + inline signed messages sent honouring $send_charset (Closes: 307819)
  + support for <clear-flag> and <set-flag> in the pager (Closes: 436007)
  + fcc_attach is a quad option (Closes: 478861)
  + Content-Description header not included in reply (Closes: 500766)
  + imap_sync_mailbox fix for a segfault (Closes: 516364)
  + better threading support with particular Message-ID's (Closes: 520735)
  + no crash on IMAP folder refresh (Closes: 528465)
  + undisclosed-recipients not passed in the envelope (Closes: 529090)
* debian/patches/series:
  + commented all references to upstream/*, they should be included in 1.5.20
  + removed debian-specific/529838-gnutls-autoconf.patch, ditto
  + removed misc/manpage-typos.patch, ditto 
  + modified misc/hyphen-as-minus.patch, a big part was integrated upstream
  + features/trash-folder: do not reupload messages to $trash if IMAP is used
    (Closes: #448241)
  + added misc/hg.pmdef.debugtime, see upstream #3263
* debian/control: added DM-Upload-Allowed: yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
3
 
 * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
 
3
 * Copyright (C) 1999-2003 Thomas Roessler <roessler@does-not-exist.org>
4
4
 * 
5
5
 *     This program is free software; you can redistribute it and/or modify
6
6
 *     it under the terms of the GNU General Public License as published by
251
251
int mx_unlock_file (const char *path, int fd, int dot)
252
252
{
253
253
#ifdef USE_FCNTL
254
 
  struct flock unlockit = { F_UNLCK, 0, 0, 0 };
 
254
  struct flock unlockit = { F_UNLCK, 0, 0, 0, 0 };
255
255
 
256
256
  memset (&unlockit, 0, sizeof (struct flock));
257
257
  unlockit.l_type = F_UNLCK;
271
271
  return 0;
272
272
}
273
273
 
274
 
void mx_unlink_empty (const char *path)
 
274
static void mx_unlink_empty (const char *path)
275
275
{
276
276
  int fd;
277
277
#ifndef USE_DOTLOCK
370
370
  if (S_ISDIR (st.st_mode))
371
371
  {
372
372
    /* check for maildir-style mailbox */
373
 
 
374
 
    snprintf (tmp, sizeof (tmp), "%s/cur", path);
375
 
    if (stat (tmp, &st) == 0 && S_ISDIR (st.st_mode))
376
 
      return (M_MAILDIR);
 
373
    if (mx_is_maildir (path))
 
374
      return M_MAILDIR;
377
375
 
378
376
    /* check for mh-style mailbox */
379
 
 
380
 
    snprintf (tmp, sizeof (tmp), "%s/.mh_sequences", path);
381
 
    if (access (tmp, F_OK) == 0)
382
 
      return (M_MH);
383
 
 
384
 
    snprintf (tmp, sizeof (tmp), "%s/.xmhcache", path);
385
 
    if (access (tmp, F_OK) == 0)
386
 
      return (M_MH);
387
 
    
388
 
    snprintf (tmp, sizeof (tmp), "%s/.mew_cache", path);
389
 
    if (access (tmp, F_OK) == 0)
390
 
      return (M_MH);
391
 
 
392
 
    snprintf (tmp, sizeof (tmp), "%s/.mew-cache", path);
393
 
    if (access (tmp, F_OK) == 0)
394
 
      return (M_MH);
395
 
    
396
 
    snprintf (tmp, sizeof (tmp), "%s/.sylpheed_cache", path);
397
 
    if (access (tmp, F_OK) == 0)
398
 
      return (M_MH);
399
 
 
400
 
    /* 
401
 
     * ok, this isn't an mh folder, but mh mode can be used to read
402
 
     * Usenet news from the spool. ;-) 
403
 
     */
404
 
 
405
 
    snprintf (tmp, sizeof (tmp), "%s/.overview", path);
406
 
    if (access (tmp, F_OK) == 0)
407
 
      return (M_MH);
408
 
 
 
377
    if (mx_is_mh (path))
 
378
      return M_MH;
409
379
  }
410
380
  else if (st.st_size == 0)
411
381
  {
856
826
      isSpool = mutt_is_spool (ctx->path) && !mutt_is_spool (mbox);
857
827
    }
858
828
 
859
 
    if (isSpool && mbox && *mbox)
 
829
    if (isSpool && *mbox)
860
830
    {
861
831
      mutt_expand_path (mbox, sizeof (mbox));
862
832
      snprintf (buf, sizeof (buf), _("Move read messages to %s?"), mbox);
895
865
 
896
866
  if (move_messages)
897
867
  {
898
 
    mutt_message (_("Moving read messages to %s..."), mbox);
 
868
    if (!ctx->quiet)
 
869
      mutt_message (_("Moving read messages to %s..."), mbox);
899
870
 
900
871
#ifdef USE_IMAP
901
872
    /* try to use server-side copy first */
954
925
  }
955
926
  else if (!ctx->changed && ctx->deleted == 0)
956
927
  {
957
 
    mutt_message _("Mailbox is unchanged.");
 
928
    if (!ctx->quiet)
 
929
      mutt_message _("Mailbox is unchanged.");
958
930
    mx_fastclose_mailbox (ctx);
959
931
    return 0;
960
932
  }
989
961
    }
990
962
  }
991
963
 
992
 
  if (move_messages)
993
 
     mutt_message (_("%d kept, %d moved, %d deleted."),
994
 
       ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
995
 
  else
996
 
    mutt_message (_("%d kept, %d deleted."),
997
 
      ctx->msgcount - ctx->deleted, ctx->deleted);
 
964
  if (!ctx->quiet)
 
965
  {
 
966
    if (move_messages)
 
967
      mutt_message (_("%d kept, %d moved, %d deleted."),
 
968
        ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
 
969
    else
 
970
      mutt_message (_("%d kept, %d deleted."),
 
971
        ctx->msgcount - ctx->deleted, ctx->deleted);
 
972
  }
998
973
 
999
974
  if (ctx->msgcount == ctx->deleted &&
1000
975
      (ctx->magic == M_MMDF || ctx->magic == M_MBOX) &&
1118
1093
 
1119
1094
  if (!ctx->changed && !ctx->deleted)
1120
1095
  {
1121
 
    mutt_message _("Mailbox is unchanged.");
 
1096
    if (!ctx->quiet)
 
1097
      mutt_message _("Mailbox is unchanged.");
1122
1098
    return (0);
1123
1099
  }
1124
1100
 
1164
1140
  {
1165
1141
#ifdef USE_IMAP
1166
1142
    if (ctx->magic == M_IMAP && !purge)
1167
 
      mutt_message _("Mailbox checkpointed.");
 
1143
    {
 
1144
      if (!ctx->quiet)
 
1145
        mutt_message _("Mailbox checkpointed.");
 
1146
    }
1168
1147
    else
1169
1148
#endif
1170
 
    mutt_message (_("%d kept, %d deleted."), msgcount - deleted,
1171
 
      deleted);
 
1149
    {
 
1150
      if (!ctx->quiet)
 
1151
        mutt_message (_("%d kept, %d deleted."), msgcount - deleted,
 
1152
                      deleted);
 
1153
    }
1172
1154
 
1173
1155
    mutt_sleep (0);
1174
1156
    
1207
1189
 
1208
1190
/* {maildir,mh}_open_new_message are in mh.c. */
1209
1191
 
1210
 
int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
 
1192
static int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1211
1193
{
1212
1194
  msg->fp = dest->fp;
1213
1195
  return 0;
1214
1196
}
1215
1197
 
1216
1198
#ifdef USE_IMAP
1217
 
int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
 
1199
static int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
1218
1200
{
1219
1201
  char tmp[_POSIX_PATH_MAX];
1220
1202