-$Id$
-
Recently, there have been reports on security problems induced by
the interpretation of shell meta-characters embedded in MIME
parameters. These reports were referring to Pine, but the problem
* $ wants to be quoted since it may indicate the start of an environment
* variable.
*/
-
static void write_safe_address (FILE *fp, char *s)
{
while (*s)
* Sanity-check an alias name: Only characters which are non-special to both
* the RFC 822 and the mutt configuration parser are permitted.
*/
-
int mutt_check_alias_name (const char *s, char *dest, size_t destlen)
{
wchar_t wc;
* send: BODY->filename points to the un-encoded file which contains the
* attachment
*/
-
int mutt_print_attachment (FILE *fp, BODY *a)
{
char newfile[_POSIX_PATH_MAX] = "";
/* Find the last message in the file.
* upon success return 0. If no message found - return -1 */
-
static int fseek_last_message (FILE * f)
{
LOFF_T pos;
* applied to tocode. Highlight note: The top-well-named MUTT_ICONV_HOOK_FROM
* acts on charset-hooks, not at all on iconv-hooks.
*/
-
iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
{
char tocode1[SHORT_STRING];
* If you're supplying inrepls, the source charset should be stateless;
* if you're supplying an outrepl, the target charset should be.
*/
-
size_t mutt_iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft,
ICONV_CONST char **inrepls, const char *outrepl)
* Parameter flags is given as-is to mutt_iconv_open(). See there
* for its meaning and usage policy.
*/
-
int mutt_convert_string (char **ps, const char *from, const char *to, int flags)
{
iconv_t cd;
/* usage: uncolor index pattern [pattern...]
* unmono index pattern [pattern...]
*/
-
static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data,
BUFFER *err, short parse_uncolor)
{
/* usage: color <object> <fg> <bg> [ <regexp> ]
* mono <object> <attr> [ <regexp> ]
*/
-
static int
_mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err,
parser_callback_t callback, short dry_run)
/* the following code is shared between printing and piping */
-
static int _mutt_pipe_message (HEADER *h, char *cmd,
int decode,
int print,
* applied.
*
*/
-
static unsigned long cum_attachs_size (MUTTMENU *menu)
{
size_t s;
* This function is similar to status_format_str(). Look at that function for
* help when modifying this function.
*/
-
static const char *
compose_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src,
const char *prefix, const char *ifstring,
-# $Id$
-
subdir = contrib
SAMPLES = Mush.rc Pine.rc gpg.rc pgp2.rc pgp5.rc pgp6.rc Tin.rc \
# Key bindings similar to those of MUSH
#
-# $Id$
-
bind index . display-message
bind index t display-message
macro index n "<next-entry><display-message>"
# similar to those of PINE 3.95.
#
-#
-# $Id$
-#
-
bind index v display-message
bind index p previous-undeleted
bind index n next-undeleted
# This version uses gpg-2comp from
# http://70t.de/download/gpg-2comp.tar.gz
#
-# $Id$
-#
# %p The empty string when no passphrase is needed,
# the string "PGPPASSFD=0" if one is needed.
#
# Translation file for PGP 2.6.3(i)n.
-# $Id$
-
# ------------------------------------------------------------------
# Character set: ISO-Latin/1 (ISO 8859/1)
# Date revised: 7 October 1997
#This file contains the strings used by PGP.
-# $Id$
-
[DIFFERENT_EXES]
us=\
PGP is now invoked from different executables for different operations:\n\n\
#
# PGP command formats for PGP 2.
#
-# $Id$
-#
#
# Note: In order to be able to read your own messages, you'll have
#
# PGP command formats for PGP 5.
#
-# $Id$
-#
# decode application/pgp
set pgp_decode_command="%?p?PGPPASSFD=0; export PGPPASSFD;? cat %?p?-? %f | pgpv +language=mutt +verbose=0 +batchmode -f --OutputInformationFD=0"
#
# PGP command formats for PGP 6.
#
-# $Id$
-#
# decode application/pgp
set pgp_decode_command="%?p?PGPPASSFD=0; export PGPPASSFD;? cat %?p?-? %f | pgp6 +compatible +verbose=0 +batchmode -f"
-# $Id$
-
text/html; netscape -remote openURL\(%s\)
image/gif; xv %s
image/jpg; xv %s
-# $Id$
-
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# ME's personal .muttrc (Mutt 0.92.5)
prefix
string to use if CH_PREFIX is set
*/
-
int
mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
{
* MUTT_CM_CHARCONV perform character set conversion
* chflags flags to mutt_copy_header()
*/
-
int
_mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
int flags, int chflags)
* flags mutt_copy_message() flags
* chflags mutt_copy_header() flags
*/
-
static int
_mutt_append_message (CONTEXT *dest, FILE *fpin, CONTEXT *src, HEADER *hdr,
BODY *body, int flags, int chflags)
*
* XXX - fix that.
*/
-
static void format_address_header (char **h, ADDRESS *a)
{
char buf[HUGE_STRING];
/*
* Implementation of `pgp_check_traditional'.
*/
-
static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only)
{
char tempfile[_POSIX_PATH_MAX];
(Note that we aren't worse than Outlook & Cie in this, and also
note that we can successfully handle anything produced by any
existing versions of mutt.) */
-
static void copy_clearsigned (gpgme_data_t data, STATE *s, char *charset)
{
char buf[HUGE_STRING];
* %p protocol
* %[...] date of key using strftime(3)
*/
-
static const char *crypt_entry_fmt (char *dest,
size_t destlen,
size_t col,
* Check if all recipients keys can be automatically determined.
* Enable encryption if they can, otherwise disable encryption.
*/
-
void crypt_opportunistic_encrypt(HEADER *msg)
{
char *pgpkeylist = NULL;
/*
* This routine verifies a "multipart/signed" body.
*/
-
int mutt_signed_handler (BODY *a, STATE *s)
{
char tempfile[_POSIX_PATH_MAX];
* Used by pgp_find_keys and find_keys to check if a crypt-hook
* value is a key id.
*/
-
short crypt_is_numerical_keyid (const char *s)
{
/* or should we require the "0x"? */
/*
* addwch would be provided by an up-to-date curses library
*/
-
int mutt_addwch (wchar_t wc)
{
char buf[MB_LEN_MAX*2];
* except that the widths refer to the number of character cells
* when printed.
*/
-
void mutt_format_string (char *dest, size_t destlen,
int min_width, int max_width,
int justify, char m_pad_char,
* except that the numbers in the conversion specification refer to
* the number of character cells when printed.
*/
-
static void format_s_x (char *dest,
size_t destlen,
const char *prefix,
* mutt_paddstr (n, s) is almost equivalent to
* mutt_format_string (bigbuf, big, n, n, FMT_LEFT, ' ', s, big, 0), addstr (bigbuf)
*/
-
void mutt_paddstr (int n, const char *s)
{
wchar_t wc;
* mutt_strwidth is like mutt_strlen except that it returns the width
* referring to the number of character cells.
*/
-
int mutt_strwidth (const char *s)
{
wchar_t wc;
-$Id$
-
USING PGP FROM WITHIN MUTT
After doing so, simply type "make"; the dependencies should take
care of the necessary other re-building (this may quite well include
a re-running of ./configure).
-$Id$
* 0 message edited successfully
* -1 error
*/
-
static int edit_one_message (CONTEXT *ctx, HEADER *cur)
{
char tmp[_POSIX_PATH_MAX];
/*
* Replace part of the wchar_t buffer, from FROM to CURPOS, by BUF.
*/
-
static void replace_part (ENTER_STATE *state, size_t from, char *buf)
{
/* Save the suffix */
* 0 if input was given
* -1 if abort.
*/
-
int mutt_enter_string(char *buf, size_t buflen, int col, int flags)
{
int rv;
*
* From [ <return-path> ] <weekday> <month> <day> <time> [ <timezone> ] <year>
*/
-
int is_from (const char *s, char *path, size_t pathlen, time_t *tp)
{
struct tm tm;
#!/bin/sh
-# $Id$
-
echo '/* Automatically generated by gen_defs. Do not edit! */'
echo ''
* above, we just use STRING*2 for the target buffer's size.
*
*/
-
static void decode_quoted (STATE *s, long len, int istext, iconv_t cd)
{
char line[STRING];
* %y = `x-label:' field (if present)
* %Y = `x-label:' field (if present, tree unfolded, and != parent's x-label)
* %Z = status flags */
-
static const char *
hdr_format_str (char *dest,
size_t destlen,
if (flags & IMAP_CMD_QUEUE)
return 0;
- // Allow interruptions, particularly useful if there are network problems.
+ /* Allow interruptions, particularly useful if there are network problems. */
mutt_allow_interrupt (1);
do
rc = imap_cmd_step (idata);
/*
* Quoting and UTF-7 conversion
*/
-
void imap_munge_mbox_name (IMAP_DATA *idata, char *dest, size_t dlen, const char *src)
{
char *buf;
}
/* Allow/disallow re-opening a folder upon expunge. */
-
void imap_allow_reopen (CONTEXT *ctx)
{
IMAP_DATA *idata;
}
ref_tmp = safe_strdup(reference);
- dirpath = dirname(ref_tmp); // get directory name of
+ dirpath = dirname(ref_tmp); /* get directory name of */
strncpy(abs_path, dirpath, PATH_MAX);
- safe_strncat(abs_path, sizeof(abs_path), "/", 1); // append a / at the end of the path
+ safe_strncat(abs_path, sizeof(abs_path), "/", 1); /* append a / at the end of the path */
FREE(&ref_tmp);
path_len = PATH_MAX - strlen(path);
*
* Warning: We don't check whether src and target are equal.
*/
-
int safe_rename (const char *src, const char *target)
{
struct stat ssb, tsb;
/* Create a temporary directory next to a file name */
-
static int mkwrapdir (const char *path, char *newfile, size_t nflen,
char *newdir, size_t ndlen)
{
/* prepare a file name to survive the shell's quoting rules.
* From the Unix programming FAQ by way of Liviu.
*/
-
size_t mutt_quote_filename (char *d, size_t l, const char *f)
{
size_t i, j = 0;
/* skip over WSP as defined by RFC5322. This is used primarily for parsing
* header fields. */
-
static inline char *skip_email_wsp(const char *s)
{
if (s)
break;
case 'F':
- // mutt_str_replace (&Muttrc, optarg);
+ /* mutt_str_replace (&Muttrc, optarg); */
Muttrc = mutt_add_list (Muttrc, optarg);
break;
* via UTF-8 using iconv.
* Unfortunately, we can't handle non-stateless encodings.
*/
-
static size_t wcrtomb_iconv (char *s, wchar_t wc, iconv_t cd)
{
char buf[MB_LEN_MAX+1];
/* Process LEN bytes of BUFFER, accumulating context into CTX.
It is assumed that LEN % 64 == 0. */
-
void
md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
{
* digits. Deleted message get moved to a filename with a comma before
* it.
*/
-
static int mh_valid_message (const char *s)
{
for (; *s; s++)
}
/* XXX - we don't currently remove deleted messages from sequences we don't know. Should we? */
-
static void mh_update_sequences (CONTEXT * ctx)
{
FILE *ofp, *nfp;
}
/* maildir support */
-
static void maildir_free_entry (struct maildir **md)
{
if (!md || !*md)
* with a {cur,new} prefix.
*
*/
-
static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr)
{
int fd;
* See also maildir_open_new_message().
*
*/
-
static int _maildir_commit_message (CONTEXT * ctx, MESSAGE * msg, HEADER * hdr)
{
char subdir[4];
* This code is also used for attachment deletion in maildir
* folders.
*/
-
static int mh_rewrite_message (CONTEXT * ctx, int msgno)
{
HEADER *h = ctx->hdrs[msgno];
* happens.
*
*/
-
static int mh_check_mailbox (CONTEXT * ctx, int *index_hint)
{
char buf[_POSIX_PATH_MAX];
* has moved under our feet. Note that this code is rather expensive, but
* then again, it's called rarely.
*/
-
static FILE *_maildir_open_find_message (const char *folder, const char *unique,
const char *subfolder, char **newname)
{
-# $Id$
-
#
# sample mime.types
#
FREE (&local_mailbox);
return buff;
}
-
/* Convert an ENVELOPE structure */
-
void mutt_env_to_local (ENVELOPE *e)
{
mutt_addrlist_to_local (e->return_path);
return true;
}
-// Public API -------------------------------------------------------------------
+/* Public API ----------------------------------------------------------------*/
lua_State *Lua = NULL;
int beg = NotmuchQueryWindowDuration * (NotmuchQueryWindowCurrentPosition + 1);
int end = NotmuchQueryWindowDuration * NotmuchQueryWindowCurrentPosition;
- // if the duration is a non positive integer, disable the window
+ /* if the duration is a non positive integer, disable the window */
if (NotmuchQueryWindowDuration <= 0)
{
query_window_reset();
return false;
}
- // if the query has changed, reset the window position
+ /* if the query has changed, reset the window position */
if (NotmuchQueryWindowCurrentSearch == NULL ||
strcmp(query, NotmuchQueryWindowCurrentSearch) != 0)
query_window_reset();
- //
if (!query_window_check_timebase(NotmuchQueryWindowTimebase))
{
mutt_message (_("Invalid nm_query_window_timebase value (valid values are: hour, day, week, month or year)."));
char buf[LONG_STRING];
mutt_str_replace(&NotmuchQueryWindowCurrentSearch, data->db_query);
- // if a date part is defined, do not apply windows (to avoid the risk of
- // having a non-intersected date frame). A good improvement would be to
- // accept if they intersect
+ /* if a date part is defined, do not apply windows (to avoid the risk of
+ * having a non-intersected date frame). A good improvement would be to
+ * accept if they intersect
+ */
if (!strstr(data->db_query, "date:") &&
windowed_query_from_query(data->db_query, buf, sizeof(buf)))
data->db_query = safe_strdup(buf);
}
/* create a send-mode duplicate from a receive-mode body */
-
int mutt_copy_body (FILE *fp, BODY **tgt, BODY *src)
{
char tmp[_POSIX_PATH_MAX];
* Replace "&" by a capitalized version of the user's login
* name.
*/
-
char *mutt_gecos_name (char *dest, size_t destlen, struct passwd *pw)
{
regmatch_t pat_match[1];
}
/* Decrease a file's modification time by 1 second */
-
time_t mutt_decrease_mtime (const char *f, struct stat *st)
{
struct utimbuf utim;
#include "mutt_notmuch.h"
#endif
-
/* update a Context structure's internal tables. */
-
void mx_update_tables(CONTEXT *ctx, int committing)
{
int i, j;
}
/* commit a message to a folder */
-
int mx_commit_message (MESSAGE *msg, CONTEXT *ctx)
{
if (!ctx->mx_ops || !ctx->mx_ops->commit_msg)
* 0 normal exit, line was not displayed
* >0 normal exit, line was displayed
*/
-
static int
display_line (FILE *f, LOFF_T *last_pos, struct line_t **lineInfo, int n,
int *last, int *max, int flags, struct q_class_t **QuoteList,
* digest 1 if reading subparts of a multipart/digest, 0
* otherwise
*/
-
BODY *mutt_read_mime_header (FILE *fp, int digest)
{
BODY *p = mutt_new_body();
*
* NOTE: this assumes that `parent->length' has been set!
*/
-
BODY *mutt_parse_message_rfc822 (FILE *fp, BODY *parent)
{
BODY *msg;
*
* digest 1 if reading a multipart/digest, 0 otherwise
*/
-
BODY *mutt_parse_multipart (FILE *fp, const char *boundary, LOFF_T end_off, int digest)
{
#ifdef SUN_ATTACHMENT
/* Copy PGP output messages and look for signs of a good signature */
-
static int pgp_copy_checksig (FILE *fpin, FILE *fpout)
{
int rv = -1;
* note that we can successfully handle anything produced by any
* existing versions of mutt.)
*/
-
static void pgp_copy_clearsigned (FILE *fpin, STATE *s, char *charset)
{
char buf[HUGE_STRING];
/* Support for the Application/PGP Content Type. */
-
int pgp_application_pgp_handler (BODY *m, STATE *s)
{
int could_not_decrypt = 0;
/* Warning: "a" is no longer freed in this routine, you need
* to free it later. This is necessary for $fcc_attach. */
-
BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign)
{
char buf[LONG_STRING];
}
/* generate a public key attachment */
-
BODY *pgp_make_key_attachment (char *tempf)
{
BODY *att;
/* some helper functions to verify that we are exclusively operating
* on message/rfc822 attachments
*/
-
static short check_msg (BODY * b, short err)
{
if (!mutt_is_message_type (b->type, b->subtype))
/* can we decode all tagged attachments? */
-
static short check_can_decode (ATTACHPTR ** idx, short idxlen,
BODY * cur)
{
/* count the number of tagged children below a multipart or message
* attachment.
*/
-
static short count_tagged_children (ATTACHPTR ** idx,
short idxlen, short i)
{
** The bounce function, from the attachment menu
**
**/
-
void mutt_attach_bounce (FILE * fp, HEADER * hdr,
ATTACHPTR ** idx, short idxlen, BODY * cur)
{
**
**
**/
-
void mutt_attach_resend (FILE * fp, HEADER * hdr, ATTACHPTR ** idx,
short idxlen, BODY * cur)
{
**/
/* try to find a common parent message for the tagged attachments. */
-
static HEADER *find_common_parent (ATTACHPTR ** idx, short idxlen,
short nattach)
{
* Note: This and the calling procedure could be optimized quite a
* bit. For now, it's not worth the effort.
*/
-
static int is_parent (short i, ATTACHPTR **idx, short idxlen, BODY *cur)
{
short level = idx[i]->level;
/* Attach all the body parts which can't be decoded.
* This code is shared by forwarding and replying. */
-
static BODY ** copy_problematic_attachments (FILE *fp,
BODY **last,
ATTACHPTR **idx,
* forward one or several MIME bodies
* (non-message types)
*/
-
static void attach_forward_bodies (FILE * fp, HEADER * hdr,
ATTACHPTR ** idx, short idxlen,
BODY * cur,
* while, on the attachment menu, messages are referenced through
* the attachment index.
*/
-
static void attach_forward_msgs (FILE * fp, HEADER * hdr,
ATTACHPTR ** idx, short idxlen, BODY * cur, int flags)
{
*
* Note that this code is horribly similar to envelope_defaults () from send.c.
*/
-
static int
attach_reply_envelope_defaults (ENVELOPE *env, ATTACHPTR **idx, short idxlen,
HEADER *parent, int flags)
/* This is _very_ similar to send.c's include_reply(). */
-
static void attach_include_reply (FILE *fp, FILE *tmpfp, HEADER *cur, int flags)
{
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV;
}
/* parse the type2.list as given by mixmaster -T */
-
static REMAILER **mix_type2_list (size_t *l)
{
FILE *fp;
* %a address
*
*/
-
static const char *mix_entry_fmt (char *dest,
size_t destlen,
size_t col,
}
/* some safety checks before piping the message to mixmaster */
-
int mix_check_message (HEADER *msg)
{
const char *fqdn;
return found;
}
-
/* This routine will create a _temporary_ filename matching the
* name template given if this needs to be done.
*
* Returns 0 if oldfile is fine as is.
* Returns 1 if newfile specified
*/
-
static void strnfcpy(char *d, char *s, size_t siz, size_t len)
{
if(len > siz)
* Primary sorting key: attribute
* Secondary sorting key: index
*/
-
static void rfc2231_list_insert (struct rfc2231_parameter **list,
struct rfc2231_parameter *par)
{
}
/* process continuation parameters */
-
static void rfc2231_join_continuations (PARAMETER **head,
struct rfc2231_parameter *par)
{
* The longest match is used so that we can match `ps.gz' when `gz' also
* exists.
*/
-
int mutt_lookup_mime_type (BODY *att, const char *path)
{
FILE *f;
}
/* Get a body's character set */
-
char *mutt_get_body_charset (char *d, size_t dlen, BODY *b)
{
char *p = NULL;
/* Hash a single 512-bit block. This is the core of the algorithm. */
-
void sha1_transform(uint32_t state[5], const unsigned char buffer[64])
{
uint32_t a, b, c, d, e;
/* sha1_init - Initialize new context */
-
void sha1_init(SHA1_CTX* context)
{
/* SHA1 initialization constants */
/* Run your data through this. */
-
void sha1_update(SHA1_CTX* context, const unsigned char* data, uint32_t len)
{
uint32_t i;
/* Add padding and return the message digest. */
-
void sha1_final(unsigned char digest[20], SHA1_CTX* context)
{
unsigned i;
*/
/* This is almost identical to ppgp's invoking interface. */
-
static const char *_mutt_fmt_smime_command (char *dest,
size_t destlen,
size_t col,
This sets the '*ToUse' variables for an upcoming decryption, where
the required key is different from SmimeDefaultKey.
*/
-
static void _smime_getkeys (char *mailbox)
{
smime_key_t *key = NULL;
* If oppenc_mode is true, only keys that can be determined without
* prompting will be used.
*/
-
char *smime_find_keys (ADDRESS *adrlist, int oppenc_mode)
{
smime_key_t *key = NULL;
/* Add a certificate and update index file (externally). */
-
void smime_invoke_import (char *infile, char *mailbox)
{
char tmpfname[_POSIX_PATH_MAX], *certfile = NULL, buf[STRING];
This handles application/pkcs7-mime which can either be a signed
or an encrypted message.
*/
-
static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile)
{
int len=0;