Duplicate the structure of an entire email. More...
#include "config.h"#include <stdint.h>#include <stdio.h>
Include dependency graph for copy_email.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | MUTT_CM_NO_FLAGS 0 |
| No flags are set. | |
| #define | MUTT_CM_NOHEADER (1 << 0) |
| Don't copy the message header. | |
| #define | MUTT_CM_PREFIX (1 << 1) |
| Quote the header and body. | |
| #define | MUTT_CM_DECODE (1 << 2) |
| Decode the message body into text/plain. | |
| #define | MUTT_CM_DISPLAY (1 << 3) |
| Output is displayed to the user. | |
| #define | MUTT_CM_UPDATE (1 << 4) |
| Update structs on sync. | |
| #define | MUTT_CM_WEED (1 << 5) |
| Weed message/rfc822 attachment headers. | |
| #define | MUTT_CM_CHARCONV (1 << 6) |
| Perform character set conversions. | |
| #define | MUTT_CM_PRINTING (1 << 7) |
| Printing the message - display light. | |
| #define | MUTT_CM_REPLYING (1 << 8) |
| Replying the message. | |
| #define | MUTT_CM_DECODE_PGP (1 << 9) |
| Used for decoding PGP messages. | |
| #define | MUTT_CM_DECODE_SMIME (1 << 10) |
| Used for decoding S/MIME messages. | |
| #define | MUTT_CM_VERIFY (1 << 11) |
| Do signature verification. | |
| #define | MUTT_CM_DECODE_CRYPT (MUTT_CM_DECODE_PGP | MUTT_CM_DECODE_SMIME) |
| Combination flag for decoding any kind of cryptography (PGP or S/MIME) | |
| #define | CH_NO_FLAGS 0 |
| No flags are set. | |
| #define | CH_UPDATE (1 << 0) |
| Update the status and x-status fields? | |
| #define | CH_WEED (1 << 1) |
| Weed the headers? | |
| #define | CH_DECODE (1 << 2) |
| Do RFC2047 header decoding. | |
| #define | CH_XMIT (1 << 3) |
| Transmitting this message? (Ignore Lines: and Content-Length:) | |
| #define | CH_FROM (1 << 4) |
| Retain the "From " message separator? | |
| #define | CH_PREFIX (1 << 5) |
Quote header using $indent_string string? | |
| #define | CH_NOSTATUS (1 << 6) |
| Suppress the status and x-status fields. | |
| #define | CH_REORDER (1 << 7) |
| Re-order output of headers (specified by 'header-order') | |
| #define | CH_NONEWLINE (1 << 8) |
| Don't output terminating newline after the header. | |
| #define | CH_MIME (1 << 9) |
| Ignore MIME fields. | |
| #define | CH_UPDATE_LEN (1 << 10) |
| Update Lines: and Content-Length: | |
| #define | CH_TXTPLAIN (1 << 11) |
| Generate text/plain MIME headers. | |
| #define | CH_NOLEN (1 << 12) |
| Don't write Content-Length: and Lines: | |
| #define | CH_WEED_DELIVERED (1 << 13) |
| Weed eventual Delivered-To headers. | |
| #define | CH_FORCE_FROM (1 << 14) |
| Give CH_FROM precedence over CH_WEED? | |
| #define | CH_NOQFROM (1 << 15) |
| Ignore ">From " line. | |
| #define | CH_UPDATE_IRT (1 << 16) |
| Update In-Reply-To: | |
| #define | CH_UPDATE_REFS (1 << 17) |
| Update References: | |
| #define | CH_DISPLAY (1 << 18) |
| Display result to user. | |
| #define | CH_UPDATE_LABEL (1 << 19) |
| Update X-Label: from email->env->x_label? | |
| #define | CH_UPDATE_SUBJECT (1 << 20) |
| Update Subject: protected header update. | |
| #define | CH_VIRTUAL (1 << 21) |
| Write virtual header lines too. | |
Typedefs | |
| typedef uint16_t | CopyMessageFlags |
| Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER. | |
| typedef uint32_t | CopyHeaderFlags |
| Flags for mutt_copy_header(), e.g. CH_UPDATE. | |
Functions | |
| 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) |
| Copy header from one file to another. | |
| int | mutt_copy_header (FILE *fp_in, struct Email *e, FILE *fp_out, CopyHeaderFlags chflags, const char *prefix, int wraplen) |
| Copy Email header. | |
| int | mutt_copy_message_fp (FILE *fp_out, FILE *fp_in, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen) |
| Make a copy of a message from a FILE pointer. | |
| int | mutt_copy_message (FILE *fp_out, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen) |
| Copy a message from a Mailbox. | |
| int | mutt_append_message (struct Mailbox *m_dst, struct Mailbox *m_src, struct Email *e, struct Message *msg, CopyMessageFlags cmflags, CopyHeaderFlags chflags) |
| Append a message. | |
Duplicate the structure of an entire email.
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, see http://www.gnu.org/licenses/.
Definition in file copy_email.h.
| #define MUTT_CM_NO_FLAGS 0 |
No flags are set.
Definition at line 37 of file copy_email.h.
| #define MUTT_CM_NOHEADER (1 << 0) |
Don't copy the message header.
Definition at line 38 of file copy_email.h.
| #define MUTT_CM_PREFIX (1 << 1) |
Quote the header and body.
Definition at line 39 of file copy_email.h.
| #define MUTT_CM_DECODE (1 << 2) |
Decode the message body into text/plain.
Definition at line 40 of file copy_email.h.
| #define MUTT_CM_DISPLAY (1 << 3) |
Output is displayed to the user.
Definition at line 41 of file copy_email.h.
| #define MUTT_CM_UPDATE (1 << 4) |
Update structs on sync.
Definition at line 42 of file copy_email.h.
| #define MUTT_CM_WEED (1 << 5) |
Weed message/rfc822 attachment headers.
Definition at line 43 of file copy_email.h.
| #define MUTT_CM_CHARCONV (1 << 6) |
Perform character set conversions.
Definition at line 44 of file copy_email.h.
| #define MUTT_CM_PRINTING (1 << 7) |
Printing the message - display light.
Definition at line 45 of file copy_email.h.
| #define MUTT_CM_REPLYING (1 << 8) |
Replying the message.
Definition at line 46 of file copy_email.h.
| #define MUTT_CM_DECODE_PGP (1 << 9) |
Used for decoding PGP messages.
Definition at line 47 of file copy_email.h.
| #define MUTT_CM_DECODE_SMIME (1 << 10) |
Used for decoding S/MIME messages.
Definition at line 48 of file copy_email.h.
| #define MUTT_CM_VERIFY (1 << 11) |
Do signature verification.
Definition at line 49 of file copy_email.h.
| #define MUTT_CM_DECODE_CRYPT (MUTT_CM_DECODE_PGP | MUTT_CM_DECODE_SMIME) |
Combination flag for decoding any kind of cryptography (PGP or S/MIME)
Definition at line 52 of file copy_email.h.
| #define CH_NO_FLAGS 0 |
No flags are set.
Definition at line 55 of file copy_email.h.
| #define CH_UPDATE (1 << 0) |
Update the status and x-status fields?
Definition at line 56 of file copy_email.h.
| #define CH_WEED (1 << 1) |
Weed the headers?
Definition at line 57 of file copy_email.h.
| #define CH_DECODE (1 << 2) |
Do RFC2047 header decoding.
Definition at line 58 of file copy_email.h.
| #define CH_XMIT (1 << 3) |
Transmitting this message? (Ignore Lines: and Content-Length:)
Definition at line 59 of file copy_email.h.
| #define CH_FROM (1 << 4) |
Retain the "From " message separator?
Definition at line 60 of file copy_email.h.
| #define CH_PREFIX (1 << 5) |
Quote header using $indent_string string?
Definition at line 61 of file copy_email.h.
| #define CH_NOSTATUS (1 << 6) |
Suppress the status and x-status fields.
Definition at line 62 of file copy_email.h.
| #define CH_REORDER (1 << 7) |
Re-order output of headers (specified by 'header-order')
Definition at line 63 of file copy_email.h.
| #define CH_NONEWLINE (1 << 8) |
Don't output terminating newline after the header.
Definition at line 64 of file copy_email.h.
| #define CH_MIME (1 << 9) |
Ignore MIME fields.
Definition at line 65 of file copy_email.h.
| #define CH_UPDATE_LEN (1 << 10) |
Update Lines: and Content-Length:
Definition at line 66 of file copy_email.h.
| #define CH_TXTPLAIN (1 << 11) |
Generate text/plain MIME headers.
Definition at line 67 of file copy_email.h.
| #define CH_NOLEN (1 << 12) |
Don't write Content-Length: and Lines:
Definition at line 68 of file copy_email.h.
| #define CH_WEED_DELIVERED (1 << 13) |
Weed eventual Delivered-To headers.
Definition at line 69 of file copy_email.h.
| #define CH_FORCE_FROM (1 << 14) |
Give CH_FROM precedence over CH_WEED?
Definition at line 70 of file copy_email.h.
| #define CH_NOQFROM (1 << 15) |
Ignore ">From " line.
Definition at line 71 of file copy_email.h.
| #define CH_UPDATE_IRT (1 << 16) |
Update In-Reply-To:
Definition at line 72 of file copy_email.h.
| #define CH_UPDATE_REFS (1 << 17) |
Update References:
Definition at line 73 of file copy_email.h.
| #define CH_DISPLAY (1 << 18) |
Display result to user.
Definition at line 74 of file copy_email.h.
| #define CH_UPDATE_LABEL (1 << 19) |
Update X-Label: from email->env->x_label?
Definition at line 75 of file copy_email.h.
| #define CH_UPDATE_SUBJECT (1 << 20) |
Update Subject: protected header update.
Definition at line 76 of file copy_email.h.
| #define CH_VIRTUAL (1 << 21) |
Write virtual header lines too.
Definition at line 77 of file copy_email.h.
| typedef uint16_t CopyMessageFlags |
Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER.
Definition at line 36 of file copy_email.h.
| typedef uint32_t CopyHeaderFlags |
Flags for mutt_copy_header(), e.g. CH_UPDATE.
Definition at line 54 of file copy_email.h.
| 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 ) |
Copy header from one file to another.
| fp_in | FILE pointer to read from |
| fp_out | FILE pointer to write to |
| off_start | Offset to start from |
| off_end | Offset to finish at |
| chflags | Flags, see CopyHeaderFlags |
| prefix | Prefix for quoting headers |
| wraplen | Width to wrap at (when chflags & CH_DISPLAY) |
| 0 | Success |
| -1 | Failure |
Ok, the only reason for not merging this with mutt_copy_header() below is to avoid creating a Email structure in message_handler(). Also, this one will wrap headers much more aggressively than the other one.
Definition at line 112 of file copy_email.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_copy_header | ( | FILE * | fp_in, |
| struct Email * | e, | ||
| FILE * | fp_out, | ||
| CopyHeaderFlags | chflags, | ||
| const char * | prefix, | ||
| int | wraplen ) |
Copy Email header.
| fp_in | FILE pointer to read from |
| e | |
| fp_out | FILE pointer to write to |
| chflags | See CopyHeaderFlags |
| prefix | Prefix for quoting headers (if CH_PREFIX is set) |
| wraplen | Width to wrap at (when chflags & CH_DISPLAY) |
| 0 | Success |
| -1 | Failure |
Definition at line 432 of file copy_email.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_copy_message_fp | ( | FILE * | fp_out, |
| FILE * | fp_in, | ||
| struct Email * | e, | ||
| CopyMessageFlags | cmflags, | ||
| CopyHeaderFlags | chflags, | ||
| int | wraplen ) |
Make a copy of a message from a FILE pointer.
| fp_out | Where to write output |
| fp_in | Where to get input |
| e | Email being copied |
| cmflags | Flags, see CopyMessageFlags |
| chflags | Flags, see CopyHeaderFlags |
| wraplen | Width to wrap at (when chflags & CH_DISPLAY) |
| 0 | Success |
| -1 | Failure |
Definition at line 663 of file copy_email.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_copy_message | ( | FILE * | fp_out, |
| struct Email * | e, | ||
| struct Message * | msg, | ||
| CopyMessageFlags | cmflags, | ||
| CopyHeaderFlags | chflags, | ||
| int | wraplen ) |
Copy a message from a Mailbox.
| fp_out | FILE pointer to write to |
| e | |
| msg | Message |
| cmflags | Flags, see CopyMessageFlags |
| chflags | Flags, see CopyHeaderFlags |
| wraplen | Width to wrap at (when chflags & CH_DISPLAY) |
| 0 | Success |
| -1 | Failure |
should be made to return -1 on fatal errors, and 1 on non-fatal errors like partial decode, where it is worth displaying as much as possible
Definition at line 917 of file copy_email.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_append_message | ( | struct Mailbox * | m_dst, |
| struct Mailbox * | m_src, | ||
| struct Email * | e, | ||
| struct Message * | msg, | ||
| CopyMessageFlags | cmflags, | ||
| CopyHeaderFlags | chflags ) |
Append a message.
| m_dst | Destination Mailbox |
| m_src | Source Mailbox |
| e | |
| msg | Message |
| cmflags | Flags, see CopyMessageFlags |
| chflags | Flags, see CopyHeaderFlags |
| 0 | Success |
| -1 | Failure |
Definition at line 992 of file copy_email.c.
Here is the call graph for this function:
Here is the caller graph for this function: