NeoMutt  2018-07-16 +2481-68dcde
Teaching an old dog new tricks
DOXYGEN
sendlib.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_SENDLIB_H
25 #define MUTT_SENDLIB_H
26 
27 #include <stdbool.h>
28 #include <stdio.h>
29 #include "email/lib.h"
30 #include "copy.h"
31 
32 struct AddressList;
33 struct ListHead;
34 struct Mailbox;
35 
36 /* These Config Variables are only used in sendlib.c */
37 extern bool C_Allow8bit;
38 extern char *C_AttachCharset;
39 extern bool C_BounceDelivered;
40 extern bool C_EncodeFrom;
41 extern bool C_ForwardDecrypt;
42 extern bool C_HiddenHost;
43 extern char *C_Inews;
44 extern bool C_MimeForwardDecode;
45 extern bool C_MimeSubject;
46 extern char *C_MimeTypeQueryCommand;
47 extern bool C_MimeTypeQueryFirst;
48 extern char *C_Sendmail;
49 extern short C_SendmailWait;
50 extern bool C_Use8bitmime;
51 extern bool C_UseEnvelopeFrom;
52 extern bool C_UserAgent;
53 extern short C_WrapHeaders;
54 
59 {
64 };
65 
66 char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
67 int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to);
68 const char * mutt_fqdn(bool may_hide_host);
69 void mutt_generate_boundary(struct ParameterList *pl);
70 struct Content *mutt_get_content_info(const char *fname, struct Body *b);
71 int mutt_invoke_sendmail(struct AddressList *from, struct AddressList *to, struct AddressList *cc, struct AddressList *bcc, const char *msg, int eightbit);
72 enum ContentType mutt_lookup_mime_type(struct Body *att, const char *path);
73 struct Body * mutt_make_file_attach(const char *path);
74 struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg);
75 struct Body * mutt_make_multipart(struct Body *b);
76 void mutt_message_to_7bit(struct Body *a, FILE *fp);
77 void mutt_prepare_envelope(struct Envelope *env, bool final);
78 struct Body * mutt_remove_multipart(struct Body *b);
79 int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, enum MuttWriteHeaderMode mode, bool privacy, bool hide_protected_subject);
80 void mutt_stamp_attachment(struct Body *a);
81 void mutt_unprepare_envelope(struct Envelope *env);
82 void mutt_update_encoding(struct Body *a);
83 void mutt_write_addrlist(struct AddressList *addr, FILE *fp, int linelen, bool display);
84 int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath);
85 int mutt_write_mime_body(struct Body *a, FILE *fp);
86 int mutt_write_mime_header(struct Body *a, FILE *fp);
87 int mutt_write_multiple_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath);
88 int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, CopyHeaderFlags chflags);
89 void mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim);
90 
91 #endif /* MUTT_SENDLIB_H */
short C_SendmailWait
Config: Time to wait for sendmail to finish.
Definition: sendlib.c:94
bool C_Allow8bit
Config: Allow 8-bit messages, don&#39;t use quoted-printable or base64.
Definition: sendlib.c:82
The envelope/body of an email.
Definition: email.h:39
const char * mutt_fqdn(bool may_hide_host)
Get the Fully-Qualified Domain Name.
Definition: sendlib.c:2527
Structs that make up an email.
bool C_MimeSubject
encode subject line with RFC2047
Definition: sendlib.c:90
void mutt_unprepare_envelope(struct Envelope *env)
Undo the encodings of mutt_prepare_envelope()
Definition: sendlib.c:3036
int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, enum MuttWriteHeaderMode mode, bool privacy, bool hide_protected_subject)
Write out one RFC822 header line.
Definition: sendlib.c:2324
bool C_BounceDelivered
Config: Add &#39;Delivered-To&#39; to bounced messages.
Definition: sendlib.c:84
int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to)
Bounce an email message.
Definition: sendlib.c:3116
int mutt_invoke_sendmail(struct AddressList *from, struct AddressList *to, struct AddressList *cc, struct AddressList *bcc, const char *msg, int eightbit)
Run sendmail.
Definition: sendlib.c:2819
A normal Email, write full header + MIME headers.
Definition: sendlib.h:60
enum ContentType mutt_lookup_mime_type(struct Body *att, const char *path)
Find the MIME type for an attachment.
Definition: sendlib.c:1101
A postponed Email, just the envelope info.
Definition: sendlib.h:61
int mutt_write_multiple_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath)
Handle FCC with multiple, comma separated entries.
Definition: sendlib.c:3199
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
Definition: sendlib.c:1716
MuttWriteHeaderMode
Modes for mutt_rfc822_write_header()
Definition: sendlib.h:58
void mutt_message_to_7bit(struct Body *a, FILE *fp)
Convert an email&#39;s MIME parts to 7-bit.
Definition: sendlib.c:1280
bool C_UseEnvelopeFrom
Config: Set the envelope sender of the message.
Definition: sendlib.c:96
The body of an email.
Definition: body.h:34
char * C_AttachCharset
Config: When attaching files, use one of these character sets.
Definition: sendlib.c:83
bool C_UserAgent
Config: Add a &#39;User-Agent&#39; head to outgoing mail.
Definition: sendlib.c:97
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg)
Create a message attachment.
Definition: sendlib.c:1486
char * C_Sendmail
Config: External command to send email.
Definition: sendlib.c:93
short C_WrapHeaders
Config: Width to wrap headers in outgoing messages.
Definition: sendlib.c:98
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
Definition: sendlib.c:1742
Info about an attachment.
Definition: content.h:33
int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, CopyHeaderFlags chflags)
Write one header line to a file.
Definition: sendlib.c:2133
A mailbox.
Definition: mailbox.h:92
"light" mode (used for edit_hdrs)
Definition: sendlib.h:62
bool C_MimeTypeQueryFirst
Config: Run the C_MimeTypeQueryCommand before the mime.types lookup.
Definition: sendlib.c:92
int mutt_write_mime_header(struct Body *a, FILE *fp)
Create a MIME header.
Definition: sendlib.c:362
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Definition: sendlib.c:604
bool C_MimeForwardDecode
Config: Decode the forwarded message before attaching it.
Definition: sendlib.c:89
bool C_EncodeFrom
Config: Encode &#39;From &#39; as &#39;quote-printable&#39; at the beginning of lines.
Definition: sendlib.c:85
bool from
Has a line beginning with "From "?
Definition: content.h:43
void mutt_write_addrlist(struct AddressList *addr, FILE *fp, int linelen, bool display)
wrapper around mutt_write_address()
Definition: sendlib.c:1766
struct Content * mutt_get_content_info(const char *fname, struct Body *b)
Analyze file to determine MIME encoding to use.
Definition: sendlib.c:1013
bool C_HiddenHost
Config: Don&#39;t use the hostname, just the domain, when generating the message id.
Definition: sendlib.c:87
Duplicate the structure of an entire email.
bool C_Use8bitmime
Config: Use 8-bit messages and ESMTP to send messages.
Definition: sendlib.c:95
void mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim)
Add the message references to a list.
Definition: sendlib.c:1812
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
Definition: copy.h:49
int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath)
Write email to FCC mailbox.
Definition: sendlib.c:3246
struct Body * mutt_make_file_attach(const char *path)
Create a file attachment.
Definition: sendlib.c:1620
void mutt_stamp_attachment(struct Body *a)
Timestamp an Attachment.
Definition: sendlib.c:1418
char * C_Inews
Config: (nntp) External command to post news articles.
Definition: sendlib.c:88
Write protected headers.
Definition: sendlib.h:63
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body&#39;s character set.
Definition: sendlib.c:1431
void mutt_prepare_envelope(struct Envelope *env, bool final)
Prepare an email header.
Definition: sendlib.c:2997
The header of an Email.
Definition: envelope.h:54
ContentType
Content-Type.
Definition: mime.h:29
bool C_ForwardDecrypt
Config: Decrypt the message when forwarding it.
Definition: sendlib.c:86
int mutt_write_mime_body(struct Body *a, FILE *fp)
Write a MIME part.
Definition: sendlib.c:521
char * C_MimeTypeQueryCommand
Config: External command to determine the MIME type of an attachment.
Definition: sendlib.c:91
void mutt_update_encoding(struct Body *a)
Update the encoding type.
Definition: sendlib.c:1455