1 /** 2 * @file 3 * Duplicate the structure of an entire email 4 * 5 * @authors 6 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org> 7 * 8 * @copyright 9 * This program is free software: you can redistribute it and/or modify it under 10 * the terms of the GNU General Public License as published by the Free Software 11 * Foundation, either version 2 of the License, or (at your option) any later 12 * version. 13 * 14 * This program is distributed in the hope that it will be useful, but WITHOUT 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 * details. 18 * 19 * You should have received a copy of the GNU General Public License along with 20 * this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef MUTT_COPY_H 24 #define MUTT_COPY_H 25 26 #include "config.h" 27 #include <stdint.h> 28 #include <stdio.h> 29 30 struct Email; 31 struct Mailbox; 32 struct Message; 33 34 typedef uint16_t CopyMessageFlags; ///< Flags for mutt_copy_message(), e.g. #MUTT_CM_NOHEADER 35 #define MUTT_CM_NO_FLAGS 0 ///< No flags are set 36 #define MUTT_CM_NOHEADER (1 << 0) ///< Don't copy the message header 37 #define MUTT_CM_PREFIX (1 << 1) ///< Quote the header and body 38 #define MUTT_CM_DECODE (1 << 2) ///< Decode the message body into text/plain 39 #define MUTT_CM_DISPLAY (1 << 3) ///< Output is displayed to the user 40 #define MUTT_CM_UPDATE (1 << 4) ///< Update structs on sync 41 #define MUTT_CM_WEED (1 << 5) ///< Weed message/rfc822 attachment headers 42 #define MUTT_CM_CHARCONV (1 << 6) ///< Perform character set conversions 43 #define MUTT_CM_PRINTING (1 << 7) ///< Printing the message - display light 44 #define MUTT_CM_REPLYING (1 << 8) ///< Replying the message 45 #define MUTT_CM_DECODE_PGP (1 << 9) ///< Used for decoding PGP messages 46 #define MUTT_CM_DECODE_SMIME (1 << 10) ///< Used for decoding S/MIME messages 47 #define MUTT_CM_VERIFY (1 << 11) ///< Do signature verification 48 #define MUTT_CM_DECODE_CRYPT (MUTT_CM_DECODE_PGP | MUTT_CM_DECODE_SMIME) 49 50 typedef uint32_t CopyHeaderFlags; ///< Flags for mutt_copy_header(), e.g. #CH_UPDATE 51 #define CH_NO_FLAGS 0 ///< No flags are set 52 #define CH_UPDATE (1 << 0) ///< Update the status and x-status fields? 53 #define CH_WEED (1 << 1) ///< Weed the headers? 54 #define CH_DECODE (1 << 2) ///< Do RFC2047 header decoding 55 #define CH_XMIT (1 << 3) ///< Transmitting this message? (Ignore Lines: and Content-Length:) 56 #define CH_FROM (1 << 4) ///< Retain the "From " message separator? 57 #define CH_PREFIX (1 << 5) ///< Quote header using `$indent_string` string? 58 #define CH_NOSTATUS (1 << 6) ///< Suppress the status and x-status fields 59 #define CH_REORDER (1 << 7) ///< Re-order output of headers (specified by 'hdr_order') 60 #define CH_NONEWLINE (1 << 8) ///< Don't output terminating newline after the header 61 #define CH_MIME (1 << 9) ///< Ignore MIME fields 62 #define CH_UPDATE_LEN (1 << 10) ///< Update Lines: and Content-Length: 63 #define CH_TXTPLAIN (1 << 11) ///< Generate text/plain MIME headers 64 #define CH_NOLEN (1 << 12) ///< Don't write Content-Length: and Lines: 65 #define CH_WEED_DELIVERED (1 << 13) ///< Weed eventual Delivered-To headers 66 #define CH_FORCE_FROM (1 << 14) ///< Give CH_FROM precedence over CH_WEED? 67 #define CH_NOQFROM (1 << 15) ///< Ignore ">From " line 68 #define CH_UPDATE_IRT (1 << 16) ///< Update In-Reply-To: 69 #define CH_UPDATE_REFS (1 << 17) ///< Update References: 70 #define CH_DISPLAY (1 << 18) ///< Display result to user 71 #define CH_UPDATE_LABEL (1 << 19) ///< Update X-Label: from email->env->x_label? 72 #define CH_UPDATE_SUBJECT (1 << 20) ///< Update Subject: protected header update 73 #define CH_VIRTUAL (1 << 21) ///< Write virtual header lines too 74 75 int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end, CopyHeaderFlags chflags, const char *prefix, int wraplen); 76 77 int mutt_copy_header(FILE *fp_in, struct Email *e, FILE *fp_out, CopyHeaderFlags chflags, const char *prefix, int wraplen); 78 79 int mutt_copy_message_fp(FILE *fp_out, FILE *fp_in, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen); 80 int mutt_copy_message (FILE *fp_out, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen); 81 82 int mutt_append_message(struct Mailbox *m_dst, struct Mailbox *m_src, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags); 83 84 #endif /* MUTT_COPY_H */ 85