Commit 57c930bf authored by Thomas Roessler's avatar Thomas Roessler

Mutt 0.92.9i.

parent 1a5381e0
......@@ -1707,3 +1707,41 @@ Changes since 0.92.6
alias group bob joe
with no commas (mailx compatibility)
Changes since 0.92.7
--------------------
- [patch-0.92.7.handler.empty_cc_bcc.1] fixed bug in edit_envelope() which
caused the message to be aborted if the cc or bcc field was empty
- buffer used to store the error message in mutt_pattern_comp() called
sizeof() on the wrong variable
- renamed $header_format to $index_format ($hdr_format is still accepted)
- [patch-0.92.7.vikas.postpone.1] fixed typo for binding the `postpone'
menu, and changes the menu to use $index_format for display of postponed
messages
- mutt_error() is now a function pointer which either has the value of
mutt_curses_error() or mutt_nocurses_error() which simplifies the muttrc
parsing code
- "source '~/bin/myscript|'" was fixed so that it works correctly
- [patch-0.92.7.me.mh_sync.1] fixed bug where syncing mh mailboxes silently
failed
- [patch-0.92.7.me.pattern.1] fixes bug with mismatched backtics in the
pattern language
- mutt_default_from() no longer sets the "real name" portion of the return
address so that it can be delayed until after execution of send-hook
commands
PGP-related changes since 0.92.6i
---------------------------------
- [patch-0.92.6i.tlr.pgp_longids.1] Correct the
calculation of 64 bit "v4" key IDs.
Changes since 0.92.7
Changes since 0.92.8
--------------------
- [patch-0.92.7.handler.empty_cc_bcc.1] fixed bug in edit_envelope() which
caused the message to be aborted if the cc or bcc field was empty
- [patch-0.90.12i.jmydaes.command-complete.1] Command completion
- buffer used to store the error message in mutt_pattern_comp() called
sizeof() on the wrong variable
- [patch-0.92.8.mtsirkin.attach-viewer.1] When viewing
attachments, fall back to the attachment's file name if
no description is available.
- renamed $header_format to $index_format ($hdr_format is still accepted)
- [patch-0.92.8i.ds.attachmsg.1] Attach messages from the compose menu.
- [patch-0.92.7.vikas.postpone.1] fixed typo for binding the `postpone'
menu, and changes the menu to use $index_format for display of postponed
messages
- [patch-0.92.8i.tlr.make_string_context.1] Fix a
segmentation fault when invoking mutt -p from the
command line.
- mutt_error() is now a function pointer which either has the value of
mutt_curses_error() or mutt_nocurses_error() which simplifies the muttrc
parsing code
- [patch-0.92.8i.tlr.mh_sequences.1] Don't generate
.mh_sequences files for maildir folders.
- "source '~/bin/myscript|'" was fixed so that it works correctly
- fix a NULL pointer deference in hdrline.c
- [patch-0.92.7.me.mh_sync.1] fixed bug where syncing mh mailboxes silently
failed
- [patch-0.92.8i.jmy.hook-bugfix.1] Fix a segmentation
fault in the send-hook code.
- [patch-0.92.7.me.pattern.1] fixes bug with mismatched backtics in the
pattern language
- [patch-0.92.8i.tlr.addrbook.1] Untag all aliases before
entering the address-book menu.
- mutt_default_from() no longer sets the "real name" portion of the return
address so that it can be delayed until after execution of send-hook
commands
- Enforce a non-NULL QueryCmd in the beginning of
mutt_query_complete() and mutt_query_menu().
- Make all query.c functions except mutt_query_complete()
and mutt_query_menu() static.
PGP-related changes since 0.92.6i
- The latest IMAP patch from Andy Sloane has been added.
PGP related Changes since 0.92.8i
---------------------------------
- [patch-0.92.6i.tlr.pgp_longids.1] Correct the
calculation of 64 bit "v4" key IDs.
- [patch-0.92.8i.maj.MIC_alg.1] Properly initializes a
variable in the PGP part of the Compose menu.
- [patch-0.92.8i.tlr.pgpkey_dflt.1] Avoid possible
segmentation faults when determining the default value
of the PGP key selection prompt.
- [patch-0.92.8i.wk.opgp_5bytelength.1] Recognize
OpenPGP's public key algorithm #20 (i.e., ElGamal for
Signing and Encrypting).
- Moved doc/pgp-Notes.txt to doc/PGP-Notes.txt, and
updated that part of the documentation.
......@@ -7,6 +7,7 @@ OP_BROWSER_NEW_FILE "select a new file in this directory"
OP_CHANGE_DIRECTORY "change directories"
OP_CHECK_NEW "check mailboxes for new mail"
OP_COMPOSE_ATTACH_FILE "attach a file(s) to this message"
OP_COMPOSE_ATTACH_MESSAGE "attach a message(s) to this message"
OP_COMPOSE_EDIT_BCC "edit the BCC list"
OP_COMPOSE_EDIT_CC "edit the CC list"
OP_COMPOSE_EDIT_DESCRIPTION "edit attachment description"
......
......@@ -5,13 +5,14 @@ Installation instructructions are detailed in ``INSTALL''.
The user manual is in doc/manual.txt.
PGP users please read doc/pgp-Notes.txt before proceeding.
PGP users please read doc/PGP-Notes.txt before proceeding.
For more information, see the Mutt home page,
http://www.cs.hmc.edu/~me/mutt/index.html.
The primary distribution point for Mutt is
ftp://ftp.cs.hmc.edu/pub/me/mutt. See the home page for mirror sites.
ftp://ftp.cs.hmc.edu/pub/me/mutt. See the home page for
mirror sites.
Michael Elkins <me@cs.hmc.edu>, January 22, 1998
Thomas Roessler <roessler@guug.de>, February 3, 1998
......@@ -34,6 +34,9 @@
/* Do you want support for the POP3 protocol? (--enable-pop) */
#undef USE_POP
/* Do you want support for the IMAP protocol? (--enable-imap) */
#undef USE_IMAP
/*
* Is mail spooled to the user's home directory? If defined, MAILPATH should
* be set to the filename of the spool mailbox relative the the home
......
......@@ -149,7 +149,10 @@ void mutt_alias_menu (char *buf, size_t buflen, ALIAS *aliases)
/* count the number of aliases */
for (aliasp = aliases; aliasp; aliasp = aliasp->next)
{
aliasp->tagged = 0;
menu->max++;
}
menu->data = AliasTable = (ALIAS **) safe_calloc (menu->max, sizeof (ALIAS *));
......
......@@ -420,6 +420,9 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag)
if (a->description)
strfcpy (descrip, a->description, sizeof (descrip));
else if (a->filename)
snprintf (descrip, sizeof (descrip), "---Attachment: %s : %s",
a->filename, type);
else
snprintf (descrip, sizeof (descrip), "---Attachment: %s", type);
}
......
......@@ -180,7 +180,7 @@ int mutt_display_message (HEADER *cur)
builtin = 1;
else
{
mutt_make_string (buf, sizeof (buf), PagerFmt, cur);
mutt_make_string (buf, sizeof (buf), PagerFmt, Context, cur);
fputs (buf, fpout);
fputs ("\n\n", fpout);
}
......@@ -475,7 +475,7 @@ void mutt_enter_command (void)
int old_sortre = option (OPTSORTRE);
buffer[0] = 0;
if (mutt_get_field (":", buffer, sizeof (buffer), 0) != 0 || !buffer[0])
if (mutt_get_field (":", buffer, sizeof (buffer), M_COMMAND) != 0 || !buffer[0])
return;
err.data = errbuf;
err.dsize = sizeof (errbuf);
......
......@@ -23,6 +23,7 @@
#include "mime.h"
#include "attach.h"
#include "mapping.h"
#include "mailbox.h"
#include <string.h>
#include <sys/stat.h>
......@@ -149,16 +150,20 @@ static int pgp_send_menu (int bits)
mutt_error("This doesn't make sense if you don't want to sign the message.");
else
{
/* Copy the existing MIC algorithm into place */
strfcpy(input_micalg, PgpSignMicalg, sizeof(input_micalg));
if(mutt_get_field("MIC algorithm: ", input_micalg, sizeof(input_micalg), 0) == 0)
{
if(strcasecmp(input_micalg, "pgp-md5") && strcasecmp(input_micalg, "pgp-sha1")
&& strcasecmp(input_micalg, "pgp-rmd160"))
{
mutt_error("Unknown MIC algorithm!");
strfcpy(input_micalg, "x-unknown", sizeof(input_micalg));
mutt_error("Unknown MIC algorithm, valid ones are: pgp-md5, pgp-sha1, pgp-rmd160");
}
else {
safe_free((void **) &PgpSignMicalg);
PgpSignMicalg = safe_strdup(input_micalg);
}
safe_free((void **) &PgpSignMicalg);
PgpSignMicalg = safe_strdup(input_micalg);
}
}
}
......@@ -370,6 +375,61 @@ static int delete_attachment (MUTTMENU *menu, short *idxlen, int x)
return (0);
}
static struct mapping_t AttachMsgHelp[] = {
{ "Exit", OP_EXIT },
{ "Help", OP_HELP },
{ "Attach Message", OP_GENERIC_SELECT_ENTRY },
{ NULL }
};
static void attach_msg_make_entry (char *s, size_t l, MUTTMENU *menu, int num)
{
CONTEXT *tmp = Context;
Context = (CONTEXT *) menu->data;
index_make_entry (s, l, menu, num);
Context = tmp;
}
static HEADER *select_msg (CONTEXT *ctx)
{
MUTTMENU *menu;
int i, done=0, r=-1;
char helpstr[SHORT_STRING];
char title[SHORT_STRING];
snprintf(title, sizeof (title), "Messages to attach from folder %s",
ctx->path);
menu = mutt_new_menu ();
menu->make_entry = attach_msg_make_entry;
menu->menu = MENU_GENERIC;
menu->max = ctx->msgcount;
menu->title = title;
menu->data = ctx;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_GENERIC,
AttachMsgHelp);
while (!done)
{
switch (i = mutt_menuLoop (menu))
{
case OP_GENERIC_SELECT_ENTRY:
r = menu->current;
done = 1;
break;
case OP_EXIT:
done = 1;
break;
}
}
mutt_menuDestroy (&menu);
return (r > -1 ? ctx->hdrs[ctx->v2r[r]] : NULL);
}
/* return values:
*
* 1 message should be postponed
......@@ -393,6 +453,8 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
int op = 0;
int loop = 1;
int fccSet = 0; /* has the user edited the Fcc: field ? */
CONTEXT *ctx = NULL;
HEADER *hdr = NULL;
idx = mutt_gen_attach_list (msg->content, idx, &idxlen, &idxmax, 0, 1);
......@@ -548,10 +610,31 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
case OP_COMPOSE_ATTACH_FILE:
case OP_COMPOSE_ATTACH_MESSAGE:
fname[0] = 0;
if (mutt_enter_fname ("Attach file", fname, sizeof (fname),
&menu->redraw, 0) == -1)
break;
{
char* prompt;
int flag;
if (op == OP_COMPOSE_ATTACH_FILE)
{
prompt = "Attach file";
flag = 0;
}
else
{
prompt = "Open mailbox to attach message from";
flag = 1;
}
if (mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw,
flag) == -1)
{
break;
}
}
if (!fname[0])
continue;
mutt_expand_path (fname, sizeof (fname));
......@@ -563,6 +646,34 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
break;
}
if (op == OP_COMPOSE_ATTACH_MESSAGE)
{
menu->redraw = REDRAW_FULL;
ctx = mx_open_mailbox (fname, 0, NULL);
if (ctx == NULL)
{
mutt_perror (fname);
break;
}
if (!ctx->msgcount)
{
mx_close_mailbox (ctx);
safe_free ((void **) &ctx);
mutt_error ("No messages in that folder.");
break;
}
hdr = select_msg (ctx);
if (hdr == NULL)
{
mx_close_mailbox (ctx);
safe_free ((void **) &ctx);
break;
}
}
if (idxlen == idxmax)
{
safe_realloc ((void **) &idx, sizeof (ATTACHPTR *) * (idxmax += 5));
......@@ -570,7 +681,13 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
}
idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
if ((idx[idxlen]->content = mutt_make_attach (fname)) != NULL)
if (op == OP_COMPOSE_ATTACH_FILE)
idx[idxlen]->content = mutt_make_file_attach (fname);
else
idx[idxlen]->content = mutt_make_message_attach (ctx, hdr);
if (idx[idxlen]->content != NULL)
{
idx[idxlen]->level = (idxlen > 0) ? idx[idxlen-1]->level : 0;
......@@ -580,11 +697,12 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
menu->current = idxlen++;
mutt_update_tree (idx, idxlen);
menu->max = idxlen;
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
if (op == OP_COMPOSE_ATTACH_FILE)
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
}
else
{
mutt_error ("Unable to attach file!");
mutt_error ("Unable to attach!");
safe_free ((void **) &idx[idxlen]);
}
break;
......@@ -752,7 +870,7 @@ int mutt_send_menu (HEADER *msg, /* structure for new message */
}
fclose (fp);
if ((idx[idxlen]->content = mutt_make_attach (fname)) == NULL)
if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL)
{
mutt_error ("What we have here is a failure to make an attachment");
continue;
......
......@@ -46,6 +46,9 @@
/* Do you want support for the POP3 protocol? (--enable-pop) */
#undef USE_POP
/* Do you want support for the IMAP protocol? (--enable-imap) */
#undef USE_IMAP
/*
* Is mail spooled to the user's home directory? If defined, MAILPATH should
* be set to the filename of the spool mailbox relative the the home
......
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
AC_INIT(mutt.h)
AC_CONFIG_HEADER(config.h)
VERSION=0.92.8
VERSION=0.92.9
SUBVERSION=''
AC_MSG_CHECKING(for prefix)
......@@ -323,6 +323,13 @@ AC_ARG_ENABLE(pop, [ --enable-pop Enable POP3 support],
LIBOBJS="$LIBOBJS pop.o"
])
AC_ARG_ENABLE(imap, [ --enable-imap Enable IMAP support],
[ AC_DEFINE(USE_IMAP)
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
LIBOBJS="$LIBOBJS imap.o"
])
AC_ARG_ENABLE(flock, [ --enable-flock Use flock() to lock files],
[if test $enableval = yes; then
AC_DEFINE(USE_FLOCK)
......
......@@ -367,7 +367,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
STATE s;
if (flags & M_CM_PREFIX)
_mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), hdr, 0);
_mutt_make_string (prefix, sizeof (prefix), NONULL (Prefix), Context, hdr, 0);
if ((flags & M_CM_NOHEADER) == 0)
{
......@@ -579,7 +579,8 @@ static int copy_delete_attach(HEADER *h, HEADER *p, BODY *m, FILE *fpin,
{
if (h) h->lines = 0;
mutt_make_string (buf, sizeof (buf), NONULL (DeleteFmt), (p) ? p : h);
mutt_make_string (buf, sizeof (buf), NONULL (DeleteFmt), NULL,
(p) ? p : h);
/* Go through deleted attachment headers, weed Content-Length,
* Content-Type and Content-Transfer-Encoding
......
......@@ -114,7 +114,7 @@ void index_make_entry (char *s, size_t l, MUTTMENU *menu, int num)
}
}
_mutt_make_string (s, l, NONULL (HdrFmt), h, flag);
_mutt_make_string (s, l, NONULL (HdrFmt), Context, h, flag);
}
int index_color (int index_no)
......
Some notes on Mutt's PGP integration
USING PGP FROM WITHIN MUTT
1997-12-04, tlr <roessler@guug.de>
Last updated: 1998-03-11, tlr
Thomas Roessler <roessler@guug.de>
Fri Jun 5 12:28:52 CEST 1998
While encryption, verification and signing of messages are
......@@ -14,60 +17,83 @@ numerical key IDs for a message's recipients. These key
IDs are then passed to the external PGP binary on the
command line.
The current document contains a short description of the
PGP related configuration options mutt permits you to set,
and some frequently asked questions and tips with respect
to using Mutt with PGP.
Recent Changes
--------------
$pgp_pubring, $pgp_language, $pgp_secring, and $pgp are gone.
They have been replaced by the following variables:
pgp_v2_language pgp_v5_language
pgp_v2_pubring pgp_v5_pubring
pgp_v2_secring pgp_v5_secring
pgp_v2 pgp_v5
PGP settings
------------
For all of these variables, we use "reasonable" defaults.
This includes a fix for the outstanding "pkr/skr" problem
for people using pgp 5.
$pgp_version has been split up into a bunch of variables:
There are quite a few aspects of mutt's PGP usage you may
want to customize. First, you can use different versions
of PGP for composing and decrypting/verifying messages,
and for handling key ring stuff. These versions are
controlled by the following set of variables:
pgp_default_version
pgp_send_version
pgp_receive_version
pgp_key_version
The latter three may be set to the value "default" (which
is the default ;-); in this case, the value of
$pgp_default_version will be used instead.
Valid values for all of these variables include "pgp5" and
"pgp2".
The last three variables may be set to "default" (which is
the default); in this case, the value of
$pgp_default_version will be used.
$pgp_send_version controls the version of pgp used for
composing new messages. $pgp_receive_version is used for
decrypting messages and verifying signatures.
$pgp_key_version is the one which is used for key ring
operations (importing keys from messages, exporting keys
from your public key ring).
Since the different PGP versions may use different key
rings and need different language settings, the following
variables can be used to configure these aspects:
$pgp_send_version is the version of pgp used for composing
new messages. $pgp_receive version is used for decrypting
messages and verifying signatures. $pgp_key_version is the
one which is used for key ring operations (extracting keys
from messages, extracting keys from your public key ring).
- Language settings:
$pgp_v2_language, $pgp_v5_language
Valid values for _all_ variables include "pgp5", "pgp3",
"pgp2"; "pgp3" and "pgp5" are equivalent. "g10" has been
removed for now: The program has changed it's name to
GNUPG; Support for that program will be included soon.
Support will be added as soon as the current state of the
code turns out to be stable.
- Public key ring:
$pgp_v2_pubring, $pgp_v5_pubring
- Secret key ring:
$pgp_v2_secring, $pgp_v5_secring
- PGP itself:
$pgp_v2, $pgp_v5
Note that PGP 5 comes in several binaries (pgps, pgpk,
pgpv, pgp). Mutt assumes that these binaries reside
in the same directory; $pgp_v5 should point to the
"pgp" binary from PGP 5.
For all of these variables, we use "reasonable" defaults
which should work for most users.
Support for the GNU Privacy Guard (GPG) is currently
worked on.
The value of the variable $pgp_sign_micalg will show up in
the "micalg" parameter of MIME headers when creating RFC
2015 signatures.
A new variable named $pgp_sign_micalg has been introduced.
It contains the default message integrity check algorithm.
Valid values are "pgp-md5", "pgp-sha1", and "pgp-rmd160".
If you select a signing key using the "sign as" option on
the compose menu, mutt will automagically figure out the
correct value to insert here, but it does not know about
the user's default key.
correct value to put into this variable, but it does not
know about the user's default key.
So if you are using an RSA key for signing, set this
variable to "pgp-md5", if you use a PGP 5 DSS key for
signing, say "pgp-sha1" here. The value of this variable
will show up in the "micalg" parameter of MIME headers
when creating RFC 2015 signatures.
So if you are (by default) using an RSA key for signing,
set this variable to "pgp-md5", if you use a PGP 5 DSS key
for signing, say "pgp-sha1".
......@@ -135,7 +161,7 @@ No. Application/pgp is not really suited to a world with
MIME, non-textual body parts and similar things. Anyway,
if you really want to generate these old-style
attachments, include the following macro in your ~/.muttrc
(line breaks for readibility, this is actually one line):
(line breaks for readability, this is actually one line):
macro compose S "Fpgp +verbose=0 -fast
+clearsig=on\ny^T^Uapplication/pgp; format=text;
......@@ -159,4 +185,3 @@ $PGPPATH and add the following line to your muttrc:
For PGP 2.6, a German version called "muttde" is available
as well.
......@@ -537,7 +537,7 @@ name="commands">. Each line of the file may contain one or more commands.
When multiple commands are used, they must be separated by a semicolon (;).
<tscreen><verb>
set realname='Mutt user' ; ignore x-
</verb><tscreen>
</verb></tscreen>
The hash mark, or pound sign
(``&num;''), is used as a ``comment'' character. You can use it to
annotate your initialization file. All text after the comment character
......
......@@ -151,7 +151,7 @@ be_include_messages (char *msg, char **buf, int *bufmax, int *buflen,
/* add the attribution */
if (Attribution)
{
mutt_make_string (tmp, sizeof (tmp) - 1, Attribution, Context->hdrs[n]);
mutt_make_string (tmp, sizeof (tmp) - 1, Attribution, Context, Context->hdrs[n]);
strcat (tmp, "\n");
}
......
......@@ -412,6 +412,15 @@ int mutt_enter_string (unsigned char *buf, size_t buflen, int y, int x,
mutt_alias_menu ((char *) buf, buflen, Aliases);
return (1);
}
else if (flags & M_COMMAND)
{
buf[curpos] = 0;
if (mutt_command_complete ((char *) buf, buflen, curpos))
{
redraw = M_REDRAW_INIT;
continue;
}
}
else if (flags & (M_FILE | M_EFILE))
{
buf[curpos] = 0;
......
......@@ -19,6 +19,7 @@
#include "mutt.h"
#include "mutt_curses.h"
#include "sort.h"
#include "mx.h"
void mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf)
{
......@@ -44,6 +45,12 @@ void mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf)
{
h->deleted = 0;
ctx->deleted--;
/* if you undelete a message, the imap server will probably need to know. */
if(ctx->magic==M_IMAP)
{
h->changed = 1;
ctx->changed = 1;
}
}
break;
......
......@@ -307,6 +307,7 @@ struct binding_t OpAttach[] = {
struct binding_t OpCompose[] = {
{ "attach-file", OP_COMPOSE_ATTACH_FILE, "a" },
{ "attach-message", OP_COMPOSE_ATTACH_MESSAGE, "A" },
{ "edit-bcc", OP_COMPOSE_EDIT_BCC, "b" },
{ "edit-cc", OP_COMPOSE_EDIT_CC, "c" },
{ "copy-file", OP_SAVE, "C" },
......
......@@ -40,6 +40,11 @@ WHERE char *Fqdn;
WHERE char *HdrFmt;
WHERE char *Homedir;
WHERE char *Hostname;
#ifdef USE_IMAP
WHERE char *ImapUser INITVAL (NULL);
WHERE char *ImapPass INITVAL (NULL);
WHERE short ImapCheckTime;
#endif
WHERE char *InReplyTo;
WHERE char *Inbox;
WHERE char *Ispell;
......
......@@ -152,6 +152,12 @@ static int user_is_recipient (ENVELOPE *hdr)
* %u = user (login) name of author
* %Z = status flags */
struct hdr_format_info
{
CONTEXT *ctx;
HEADER *hdr;
};
static const char *
hdr_format_str (char *dest,
size_t destlen,
......@@ -163,18 +169,27 @@ hdr_format_str (char *dest,
unsigned long data,
format_flag flags)
{
HEADER *hdr = (HEADER *) data;
struct hdr_format_info *hfi = (struct hdr_format_info *) data;
HEADER *hdr;
CONTEXT *ctx;
char fmt[SHORT_STRING], buf2[SHORT_STRING], ch, *p;
int do_locales, i;
int optional = (flags & M_FORMAT_OPTIONAL);
size_t len;
hdr = hfi->hdr;
ctx = hfi->ctx;
dest[0] = 0;
switch (op)
{
case 'a':
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
snprintf (dest, destlen, fmt, hdr->env->from->mailbox);
if(hdr->env->from && hdr->env->from->mailbox)
{
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
snprintf (dest, destlen, fmt, hdr->env->from->mailbox);
}
dest[0] = '\0';
break;
case 'B':
......@@ -184,11 +199,16 @@ hdr_format_str (char *dest,
break;
case 'b':
if ((p = strrchr (Context->path, '/')))
strncpy (dest, p + 1, destlen);
else
strncpy (dest, Context->path, destlen);
break;
if(ctx)
{
if ((p = strrchr (ctx->path, '/')))
strfcpy (dest, p + 1, destlen);
else
strfcpy (dest, ctx->path, destlen);
break;
}