Changeset 1205:df3a6ad8d9d5

Show
Ignore:
Timestamp:
1999-08-15 04:43:03 (9 years ago)
Author:
Thomas Roessler <roessler@…>
Branch:
HEAD
Message:

Various changes added over the last week:

- $delete_untag
- creation of "application/pgp" messages
- an attempt to fix prepare.
- Browser format changes

Files:
23 modified

Legend:

Unmodified
Added
Removed
  • Makefile.am

    r1188 r1205  
    151151 
    152152stamp-doc-rc: $(srcdir)/init.h makedoc Muttrc.head 
    153         cpp -D_MAKEDOC -C -I. -I $(srcdir) -include config.h    \ 
    154                 $(srcdir)/init.h | ./makedoc -c | cat Muttrc.head - \ 
     153        cpp $(INCLUDES) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \ 
     154                -include config.h $(srcdir)/init.h | ./makedoc -c | cat Muttrc.head - \ 
    155155                > Muttrc 
    156156        touch stamp-doc-rc 
  • Muttrc

    r1191 r1205  
    426426#  
    427427#  
    428 # set dotlock_program="BINDIR/mutt_dotlock" 
     428# set delete_untag=yes 
     429# 
     430# Name: delete_untag 
     431# Type: boolean 
     432# Default: yes 
     433#  
     434#  
     435# If this option is set, mutt will untag messages when marking them 
     436# for deletion.  This applies when you either explicitly delete a message, 
     437# or when you save it to another folder. 
     438#  
     439#  
     440# set dotlock_program="/usr/local/bin/mutt_dotlock" 
    429441# 
    430442# Name: dotlock_program 
    431443# Type: path 
    432 # Default: "BINDIR/mutt_dotlock" 
     444# Default: "/usr/local/bin/mutt_dotlock" 
    433445#  
    434446#  
     
    561573#  
    562574#  
    563 # set folder_format="%N %F %2l %-8.8u %-8.8g %8s %d %f" 
     575# set folder_format="%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f" 
    564576# 
    565577# Name: folder_format 
    566578# Type: string 
    567 # Default: "%N %F %2l %-8.8u %-8.8g %8s %d %f" 
     579# Default: "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f" 
    568580#  
    569581#  
     
    572584# its own set of printf()-like sequences: 
    573585#  
     586# %C      current file number 
    574587# %d      date/time folder was last modified 
    575588# %f      filename 
     
    579592# %N      N if folder has new mail, blank otherwise 
    580593# %s      size in bytes 
     594# %t      * if the file is tagged, blank otherwise 
    581595# %u      owner name (or numeric uid, if missing) 
    582596# %>X     right justify the rest of the string and pad  
     
    795809# list. 
    796810#  
     811#  
     812# set imap_checkinterval=0 
     813# 
     814# Name: imap_checkinterval 
     815# Type: number 
     816# Default: 0 
     817#  
     818#  
     819# This variable configures how often (in seconds) IMAP should look for 
     820# new mail. 
     821#  
     822#  
     823# set imap_list_subscribed=no 
     824# 
     825# Name: imap_list_subscribed 
     826# Type: boolean 
     827# Default: no 
     828#  
     829#  
     830# This variable configures whether IMAP folder browsing will look for 
     831# only subscribed folders or all folders.  This can be toggled in the 
     832# IMAP browser with the toggle-subscribed command. 
     833#  
     834#  
     835# set imap_user="" 
     836# 
     837# Name: imap_user 
     838# Type: string 
     839# Default: "" 
     840#  
     841#  
     842# Your login name on the IMAP server. 
     843#  
     844# This variable defaults to your user name on the local machine. 
     845#  
     846#  
     847# set imap_pass="" 
     848# 
     849# Name: imap_pass 
     850# Type: string 
     851# Default: "" 
     852#  
     853#  
     854# Specifies the password for your IMAP account.  If unset, Mutt will 
     855# prompt you for your password when you invoke the fetch-mail function. 
     856# Warning: you should only use this option when you are on a 
     857# fairly secure machine, because the superuser can read your muttrc even 
     858# if you are the only one who can read the file. 
     859#  
     860#  
     861# set imap_passive=yes 
     862# 
     863# Name: imap_passive 
     864# Type: boolean 
     865# Default: yes 
     866#  
     867#  
     868# When set, mutt will not open new IMAP connections to check for new 
     869# mail.  Mutt will only check for new mail over existing IMAP 
     870# connections.  This is useful if you don't want to be prompted to 
     871# user/password pairs on mutt invocation, or if opening the connection 
     872# is slow. 
     873#  
     874#  
     875# set imap_home_namespace="" 
     876# 
     877# Name: imap_home_namespace 
     878# Type: string 
     879# Default: "" 
    797880#  
    798881# set implicit_autoview=no 
     
    14611544#  
    14621545#  
     1546# set pgp_create_traditional=no 
     1547# 
     1548# Name: pgp_create_traditional 
     1549# Type: quadoption 
     1550# Default: no 
     1551#  
     1552#  
     1553# This option controls whether Mutt generates old-style PGP encrypted 
     1554# or signed messages under certain circumstances. 
     1555#  
     1556# Note that PGP/MIME will be used automatically for messages which have 
     1557# a character set different from us-ascii, or which consist of more than 
     1558# a single MIME part. 
     1559#  
     1560# Also note that using the old-style PGP message format is strongly 
     1561# deprecated. 
     1562#  
     1563#  
    14631564# set pgp_decode_command="" 
    14641565# 
     
    15231624#  
    15241625#  
     1626# set pgp_clearsign_command="" 
     1627# 
     1628# Name: pgp_clearsign_command 
     1629# Type: string 
     1630# Default: "" 
     1631#  
     1632#  
     1633# This format is used to create a "clearsigned" old-style PGP attachment. 
     1634# Note that the use of this format is strongly deprecated. 
     1635#  
     1636#  
    15251637# set pgp_sign_command="" 
    15261638# 
     
    16671779# The separator to add between messages when piping a list of tagged 
    16681780# messages to an external Unix command. 
     1781#  
     1782#  
     1783# set pop_delete=no 
     1784# 
     1785# Name: pop_delete 
     1786# Type: boolean 
     1787# Default: no 
     1788#  
     1789#  
     1790# If set, Mutt will delete successfully downloaded messages from the POP 
     1791# server when using the fetch-mail function.  When unset, Mutt will 
     1792# download messages but also leave them on the POP server. 
     1793#  
     1794#  
     1795# set pop_host="" 
     1796# 
     1797# Name: pop_host 
     1798# Type: string 
     1799# Default: "" 
     1800#  
     1801#  
     1802# The name or address of your POP3 server. 
     1803#  
     1804#  
     1805# set pop_port=110 
     1806# 
     1807# Name: pop_port 
     1808# Type: number 
     1809# Default: 110 
     1810#  
     1811#  
     1812# This variable specifies which port your POP server is listening on. 
     1813#  
     1814#  
     1815# set pop_last=no 
     1816# 
     1817# Name: pop_last 
     1818# Type: boolean 
     1819# Default: no 
     1820#  
     1821#  
     1822# If this variable is set, mutt will try to use the "LAST" POP command 
     1823# for retrieving only unread messages from the POP server. 
     1824#  
     1825#  
     1826# set pop_user="" 
     1827# 
     1828# Name: pop_user 
     1829# Type: string 
     1830# Default: "" 
     1831#  
     1832#  
     1833# Your login name on the POP3 server. 
     1834#  
     1835# Defaults to your login name on the local system. 
     1836#  
     1837#  
     1838# set pop_pass="" 
     1839# 
     1840# Name: pop_pass 
     1841# Type: string 
     1842# Default: "" 
     1843#  
     1844#  
     1845# Your password on the POP3 server. 
    16691846#  
    16701847#  
  • NEWS

    r1181 r1205  
    11Major changes since 0.96.3 
    22-------------------------- 
     3 
     4- There is a new option $delete_untag.  Former mutt versions used to 
     5  untag messages when you save them, but leave them tagged whe you 
     6  mark them for deletion.  $delete_untag controls _both_ cases, 
     7  leading to more uniform behaviour. 
     8 
     9- The $weed option applies to the decode-save and decode-copy 
     10  functions.  Think of these functions as something along the lines 
     11  of "save to file". 
    312 
    413- The master source of the configuration option reference has been 
  • README.SECURITY

    r790 r1205  
    5757 
    5858> text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \ 
    59 >         && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1 
     59>         && test "`echo \"$charset\" | tr '[A-Z]' '[a-z]'`" != iso-8859-1 
    6060 
    61 The "charset=%{charset}" assignment is risk-free since mutt performs 
    62 the necessary quoting steps here.  Using it inside the backtick 
    63 expansion is safe, too, since the variable's value is not itself 
    64 subject to any further expansion (but note that it _is_ subject to 
    65 word splitting).  
  • browser.c

    r1169 r1205  
    4848typedef struct folder_t 
    4949{ 
    50   const char *name; 
    51   const struct stat *f; 
    52   int new; 
     50  struct folder_file *ff; 
     51  int num; 
    5352} FOLDER; 
    5453 
     
    6463    safe_free ((void **) &((state->entry)[c].name)); 
    6564    safe_free ((void **) &((state->entry)[c].desc)); 
     65    safe_free ((void **) &((state->entry)[c].st)); 
    6666  } 
    6767#ifdef USE_IMAP 
     
    147147  switch (op) 
    148148  { 
     149    case 'C': 
     150      snprintf (tmp, sizeof (tmp), "%%%sd", fmt); 
     151      snprintf (dest, destlen, tmp, folder->num + 1); 
     152      break; 
     153       
    149154    case 'd': 
    150       if (folder->f != NULL) 
     155      if (folder->ff->st != NULL) 
    151156      { 
    152157        tnow = time (NULL); 
    153         t_fmt = tnow - folder->f->st_mtime < 31536000 ? "%b %d %H:%M" : "%b %d  %Y"; 
    154         strftime (date, sizeof (date), t_fmt, localtime (&folder->f->st_mtime)); 
     158        t_fmt = tnow - folder->ff->st->st_mtime < 31536000 ? "%b %d %H:%M" : "%b %d  %Y"; 
     159        strftime (date, sizeof (date), t_fmt, localtime (&folder->ff->st->st_mtime)); 
    155160        snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
    156161        snprintf (dest, destlen, tmp, date); 
     
    162167      } 
    163168      break; 
     169       
    164170    case 'f': 
    165       strfcpy (fn, folder->name, sizeof(fn)); 
    166       if (folder->f != NULL) 
    167       { 
    168         strcat (fn, S_ISLNK (folder->f->st_mode) ? "@" :  
    169                 (S_ISDIR (folder->f->st_mode) ? "/" :  
    170                  ((folder->f->st_mode & S_IXUSR) != 0 ? "*" : ""))); 
     171      strfcpy (fn, folder->ff->name, sizeof(fn)); 
     172      if (folder->ff->st != NULL) 
     173      { 
     174        strcat (fn, S_ISLNK (folder->ff->st->st_mode) ? "@" :  
     175                (S_ISDIR (folder->ff->st->st_mode) ? "/" :  
     176                 ((folder->ff->st->st_mode & S_IXUSR) != 0 ? "*" : ""))); 
    171177      } 
    172178      snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
    173179      snprintf (dest, destlen, tmp, fn); 
    174180      break; 
     181       
    175182    case 'F': 
    176       if (folder->f != NULL) 
     183      if (folder->ff->st != NULL) 
    177184      { 
    178185        sprintf (permission, "%c%c%c%c%c%c%c%c%c%c", 
    179                  S_ISDIR(folder->f->st_mode) ? 'd' : (S_ISLNK(folder->f->st_mode) ? 'l' : '-'), 
    180                  (folder->f->st_mode & S_IRUSR) != 0 ? 'r': '-', 
    181                  (folder->f->st_mode & S_IWUSR) != 0 ? 'w' : '-', 
    182                  (folder->f->st_mode & S_ISUID) != 0 ? 's' : (folder->f->st_mode & S_IXUSR) != 0 ? 'x': '-', 
    183                  (folder->f->st_mode & S_IRGRP) != 0 ? 'r' : '-', 
    184                  (folder->f->st_mode & S_IWGRP) != 0 ? 'w' : '-', 
    185                  (folder->f->st_mode & S_ISGID) != 0 ? 's' : (folder->f->st_mode & S_IXGRP) != 0 ? 'x': '-', 
    186                  (folder->f->st_mode & S_IROTH) != 0 ? 'r' : '-', 
    187                  (folder->f->st_mode & S_IWOTH) != 0 ? 'w' : '-', 
    188                  (folder->f->st_mode & S_ISVTX) != 0 ? 't' : (folder->f->st_mode & S_IXOTH) != 0 ? 'x': '-'); 
     186            S_ISDIR(folder->ff->st->st_mode) ? 'd' : (S_ISLNK(folder->ff->st->st_mode) ? 'l' : '-'), 
     187            (folder->ff->st->st_mode & S_IRUSR) != 0 ? 'r': '-', 
     188            (folder->ff->st->st_mode & S_IWUSR) != 0 ? 'w' : '-', 
     189            (folder->ff->st->st_mode & S_ISUID) != 0 ? 's' : (folder->ff->st->st_mode & S_IXUSR) != 0 ? 'x': '-', 
     190            (folder->ff->st->st_mode & S_IRGRP) != 0 ? 'r' : '-', 
     191            (folder->ff->st->st_mode & S_IWGRP) != 0 ? 'w' : '-', 
     192            (folder->ff->st->st_mode & S_ISGID) != 0 ? 's' : (folder->ff->st->st_mode & S_IXGRP) != 0 ? 'x': '-', 
     193            (folder->ff->st->st_mode & S_IROTH) != 0 ? 'r' : '-', 
     194            (folder->ff->st->st_mode & S_IWOTH) != 0 ? 'w' : '-', 
     195            (folder->ff->st->st_mode & S_ISVTX) != 0 ? 't' : (folder->ff->st->st_mode & S_IXOTH) != 0 ? 'x': '-'); 
    189196        snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
    190197        snprintf (dest, destlen, tmp, permission); 
     
    193200      { 
    194201#ifdef USE_IMAP 
    195         if (strchr(folder->name, '{')) 
     202        if (strchr(folder->ff->name, '{')) 
    196203        { 
    197204          snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
     
    201208      } 
    202209      break; 
     210       
    203211    case 'g': 
    204       if (folder->f != NULL) 
    205       { 
    206         if ((gr = getgrgid (folder->f->st_gid))) 
     212      if (folder->ff->st != NULL) 
     213      { 
     214        if ((gr = getgrgid (folder->ff->st->st_gid))) 
    207215        { 
    208216          snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
     
    212220        { 
    213221          snprintf (tmp, sizeof (tmp), "%%%sld", fmt); 
    214           snprintf (dest, destlen, tmp, folder->f->st_gid); 
     222          snprintf (dest, destlen, tmp, folder->ff->st->st_gid); 
    215223        } 
    216224      } 
     
    221229      } 
    222230      break; 
     231       
    223232    case 'l': 
    224       if (folder->f != NULL) 
     233      if (folder->ff->st != NULL) 
    225234      { 
    226235        snprintf (tmp, sizeof (tmp), "%%%sd", fmt); 
    227         snprintf (dest, destlen, tmp, folder->f->st_nlink); 
     236        snprintf (dest, destlen, tmp, folder->ff->st->st_nlink); 
    228237      } 
    229238      else 
     
    233242      } 
    234243      break; 
     244       
    235245    case 'N': 
    236246      snprintf (tmp, sizeof (tmp), "%%%sc", fmt); 
    237       snprintf (dest, destlen, tmp, folder->new ? 'N' : ' '); 
    238       break; 
     247      snprintf (dest, destlen, tmp, folder->ff->is_new ? 'N' : ' '); 
     248      break; 
     249       
    239250    case 's': 
    240       if (folder->f != NULL) 
     251      if (folder->ff->st != NULL) 
    241252      { 
    242253        snprintf (tmp, sizeof (tmp), "%%%sld", fmt); 
    243         snprintf (dest, destlen, tmp, (long) folder->f->st_size); 
     254        snprintf (dest, destlen, tmp, (long) folder->ff->st->st_size); 
    244255      } 
    245256      else 
     
    249260      } 
    250261      break; 
     262       
     263    case 't': 
     264      snprintf (tmp, sizeof (tmp), "%%%sc", fmt); 
     265      snprintf (dest, destlen, tmp, folder->ff->tagged ? '*' : ' '); 
     266      break; 
     267       
    251268    case 'u': 
    252       if (folder->f != NULL) 
    253       { 
    254         if ((pw = getpwuid (folder->f->st_uid))) 
     269      if (folder->ff->st != NULL) 
     270      { 
     271        if ((pw = getpwuid (folder->ff->st->st_uid))) 
    255272        { 
    256273          snprintf (tmp, sizeof (tmp), "%%%ss", fmt); 
     
    260277        { 
    261278          snprintf (tmp, sizeof (tmp), "%%%sld", fmt); 
    262           snprintf (dest, destlen, tmp, folder->f->st_uid); 
     279          snprintf (dest, destlen, tmp, folder->ff->st->st_uid); 
    263280        } 
    264281      } 
     
    269286      } 
    270287      break; 
     288       
     289    default: 
     290      snprintf (tmp, sizeof (tmp), "%%%sc", fmt); 
     291      snprintf (dest, destlen, tmp, op); 
     292      break; 
    271293  } 
    272294  return (src); 
     
    277299{ 
    278300  char buffer[_POSIX_PATH_MAX + SHORT_STRING]; 
    279   FOLDER folder; 
    280  
    281   folder.name = name; 
    282   folder.f = s; 
    283   folder.new = new; 
    284   mutt_FormatString (buffer, sizeof (buffer), NONULL(FolderFormat), 
    285                      folder_format_str, (unsigned long) &folder, 
    286                      M_FORMAT_ARROWCURSOR); 
    287301 
    288302  if (state->entrylen == state->entrymax) 
     
    297311  if (s != NULL) 
    298312  { 
    299   (state->entry)[state->entrylen].mode = s->st_mode; 
    300   (state->entry)[state->entrylen].mtime = s->st_mtime; 
    301   (state->entry)[state->entrylen].size = s->st_size; 
    302   } 
     313    (state->entry)[state->entrylen].mode = s->st_mode; 
     314    (state->entry)[state->entrylen].mtime = s->st_mtime; 
     315    (state->entry)[state->entrylen].size = s->st_size; 
     316     
     317    (state->entry)[state->entrylen].st = safe_malloc (sizeof (struct stat)); 
     318    memcpy ((state->entry)[state->entrylen].st, s, sizeof (struct stat)); 
     319  } 
     320 
     321  (state->entry)[state->entrylen].is_new = new; 
    303322  (state->entry)[state->entrylen].name = safe_strdup (name); 
    304323  (state->entry)[state->entrylen].desc = safe_strdup (buffer); 
     
    424443void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num) 
    425444{ 
    426   snprintf (s, slen, "%2d %c %s",  
    427             num + 1,  
    428             ((struct folder_file *) menu->data)[num].tagged ? '*' : ' ', 
    429             ((struct folder_file *) menu->data)[num].desc); 
     445  FOLDER folder; 
     446 
     447  folder.ff = &((struct folder_file *) menu->data)[num]; 
     448  folder.num = num; 
     449   
     450  mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str,  
     451      (unsigned long) &folder, M_FORMAT_ARROWCURSOR); 
    430452} 
    431453 
  • browser.h

    r1135 r1205  
    2424{ 
    2525  mode_t mode; 
     26  off_t size; 
    2627  time_t mtime; 
    27   off_t size; 
     28  struct stat *st; 
     29 
    2830  char *name; 
    2931  char *desc; 
     
    3234#endif 
    3335  unsigned tagged : 1; 
     36  unsigned is_new : 1; 
    3437}; 
    3538 
  • commands.c

    r1160 r1205  
    478478} 
    479479 
    480 static void set_copy_flags(HEADER *hdr, int decode, int decrypt, int *cmflags, int *chflags) 
     480static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags, int *chflags) 
    481481{ 
    482482  *cmflags = 0; 
     
    496496#endif 
    497497 
    498   if(decode) 
     498  if (decode) 
    499499  { 
    500500    *chflags = CH_XMIT | CH_MIME | CH_TXTPLAIN; 
     
    502502  } 
    503503 
     504  /* respect $weed only if decode doesn't kick in 
     505   * for decrypt. 
     506   */ 
     507 
     508  if (decode && !decrypt && option (OPTWEED)) 
     509  { 
     510    *chflags |= CH_WEED; 
     511    *cmflags |= M_CM_WEED; 
     512  } 
    504513} 
    505514 
     
    508517  int cmflags, chflags; 
    509518   
    510   set_copy_flags(h, decode, decrypt, &cmflags, &chflags); 
    511  
    512   if (decode  || decrypt) 
     519  set_copy_flags (h, decode, decrypt, &cmflags, &chflags); 
     520 
     521  if (decode || decrypt) 
    513522    mutt_parse_mime_message (Context, h); 
    514523 
     
    516525  { 
    517526    mutt_set_flag (Context, h, M_DELETE, 1); 
    518     mutt_set_flag (Context, h, M_TAG, 0); 
     527    if (option (OPTDELETEUNTAG)) 
     528      mutt_set_flag (Context, h, M_TAG, 0); 
    519529  } 
    520530} 
  • copy.c

    r1199 r1205  
    4646{ 
    4747  int from = 0; 
     48  int this_is_from; 
    4849  int ignore = 0; 
    4950  char buf[STRING]; /* should be long enough to get most fields in one pass */ 
     
    137138    { 
    138139      ignore = 1; 
     140      this_is_from = 0; 
    139141      if (!from && mutt_strncmp ("From ", buf, 5) == 0) 
    140142      { 
    141143        if ((flags & CH_FROM) == 0) 
    142144          continue; 
    143         from = 1; 
     145        this_is_from = from = 1; 
    144146      } 
    145147      else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n')) 
    146148        break; /* end of header */ 
    147149 
    148       if ((flags & CH_WEED) &&  
     150      /* note: CH_FROM takes precedence over header weeding. */ 
     151      if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) && 
     152          (flags & CH_WEED) && 
    149153          mutt_matches_ignore (buf, Ignore) && 
    150154          !mutt_matches_ignore (buf, UnIgnore)) 
     
    263267        CH_DECODE       RFC2047 header decoding 
    264268        CH_FROM         retain the "From " message separator 
     269        CH_FORCE_FROM   give CH_FROM precedence over CH_WEED 
    265270        CH_MIME         ignore MIME fields 
    266271        CH_NOLEN        don't write Content-Length: and Lines: 
     
    607612    return -1; 
    608613  if (dest->magic == M_MBOX || dest->magic == M_MMDF || dest->magic == M_KENDRA) 
    609     chflags |= CH_FROM; 
     614    chflags |= CH_FROM | CH_FORCE_FROM; 
    610615  chflags |= (dest->magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE); 
    611616  r = _mutt_copy_message (msg->fp, fpin, hdr, body, flags, chflags); 
  • curs_main.c

    r1138 r1205  
    14411441        { 
    14421442          mutt_tag_set_flag (M_DELETE, 1); 
     1443          if (option (OPTDELETEUNTAG)) 
     1444            mutt_tag_set_flag (M_TAG, 0); 
    14431445          menu->redraw = REDRAW_INDEX; 
    14441446        }