static const char rcsid[]="$Id$";
/*
* Copyright (C) 1996-8 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "mutt.h"
#include "mutt_curses.h"
#include "rfc2047.h"
#include "keymap.h"
#include "mime.h"
#include "mailbox.h"
#include "copy.h"
#include "mx.h"
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <dirent.h>
#ifdef _PGPPATH
#include "pgp.h"
#endif
static void append_signature (FILE *f)
{
FILE *tmpfp;
pid_t thepid;
if (Signature && (tmpfp = mutt_open_read (Signature, &thepid)))
{
if (option (OPTSIGDASHES))
fputs ("\n-- \n", f);
mutt_copy_stream (tmpfp, f);
fclose (tmpfp);
if (thepid != -1)
mutt_wait_filter (thepid);
}
}
/* compare two e-mail addresses and return 1 if they are equivalent */
static int mutt_addrcmp (ADDRESS *a, ADDRESS *b)
{
if (!a->mailbox || !b->mailbox)
return 0;
if (strcasecmp (a->mailbox, b->mailbox))
return 0;
return 1;
}
/* search an e-mail address in a list */
static int mutt_addrsrc (ADDRESS *a, ADDRESS *lst)
{
for (; lst; lst = lst->next)
{
if (mutt_addrcmp (a, lst))
return (1);
}
return (0);
}
/* removes addresses from "b" which are contained in "a" */
static ADDRESS *mutt_remove_xrefs (ADDRESS *a, ADDRESS *b)
{