/*
* Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
#include "mutt.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "rfc1524.h"
#include "mime.h"
#include "attach.h"
#include "mapping.h"
#include "mailbox.h"
#include "sort.h"
#include "charset.h"
#ifdef MIXMASTER
#include "remailer.h"
#endif
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>
static const char* There_are_no_attachments = N_("There are no attachments.");
#define CHECK_COUNT if (idxlen == 0) { mutt_error _(There_are_no_attachments); break; }
enum
{
HDR_FROM = 1,
HDR_TO,
HDR_CC,
HDR_BCC,
HDR_SUBJECT,
HDR_REPLYTO,
HDR_FCC,
#ifdef MIXMASTER
HDR_MIX,
#endif
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
HDR_CRYPT,
HDR_CRYPTINFO,
#endif
HDR_ATTACH = (HDR_FCC + 5) /* where to start printing the attachments */
};
#define HDR_XOFFSET 10
#define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
#define W (COLS - HDR_XOFFSET)
static char *Prompts[] =
{
"From: ",
"To: ",
"Cc: ",
"Bcc: ",
"Subject: ",
"Reply-To: ",
"Fcc: "
};
static struct mapping_t ComposeHelp[] = {
{ N_("Send"), OP_COMPOSE_SEND_MESSAGE },
{ N_("Abort"), OP_EXIT },
{ "To", OP_COMPOSE_EDIT_TO },
{ "CC", OP_COMPOSE_EDIT_CC },
{ "Subj", OP_COMPOSE_EDIT_SUBJECT },
{ N_("Attach file"), OP_C