NeoMutt  2020-04-24
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 {
65 };
66 
67 char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
68 int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to);
69 const char * mutt_fqdn(bool may_hide_host);
70 void mutt_generate_boundary(struct ParameterList *pl);
71 struct Content *mutt_get_content_info(const char *fname, struct Body *b);
72 int mutt_invoke_sendmail(struct AddressList *from, struct AddressList *to, struct AddressList *cc, struct AddressList *bcc, const char *msg, int eightbit);
73 enum ContentType mutt_lookup_mime_type(struct Body *att, const char *path);
74 struct Body * mutt_make_file_attach(const char *path);
75 struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg);
76 struct Body * mutt_make_multipart(struct Body *b);
77 void mutt_message_to_7bit(struct Body *a, FILE *fp);
78 void mutt_prepare_envelope(struct Envelope *env, bool final);
79 struct Body * mutt_remove_multipart(struct Body *b);
80 int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, enum MuttWriteHeaderMode mode, bool privacy, bool hide_protected_subject);
81 void mutt_stamp_attachment(struct Body *a);
82 void mutt_unprepare_envelope(struct Envelope *env);
83 void mutt_update_encoding(struct Body *a);
84 void mutt_write_addrlist(struct AddressList *addr, FILE *fp, int linelen, bool display);
85 int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, const char *fcc, char **finalpath);
86 int mutt_write_mime_body(struct Body *a, FILE *fp);
87 int mutt_write_mime_header(struct Body *a, FILE *fp);
88 int mutt_write_multiple_fcc(const char *path, struct Email *e, const char *msgid, bool post, char *fcc, char **finalpath);
89 int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, CopyHeaderFlags chflags);
90 void mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim);
91 
92 #endif /* MUTT_SENDLIB_H */
short C_SendmailWait
Config: Time to wait for sendmail to finish.
Definition: sendlib.c:92
bool C_Allow8bit
Config: Allow 8-bit messages, don&#39;t use quoted-printable or base64.
Definition: sendlib.c:80
The envelope/body of an email.
Definition: email.h:37
const char * mutt_fqdn(bool may_hide_host)
Get the Fully-Qualified Domain Name.
Definition: sendlib.c:2531
Structs that make up an email.
bool C_MimeSubject
encode subject line with RFC2047
Definition: sendlib.c:88
void mutt_unprepare_envelope(struct Envelope *env)
Undo the encodings of mutt_prepare_envelope()
Definition: sendlib.c:3042
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:2325
bool C_BounceDelivered
Config: Add &#39;Delivered-To&#39; to bounced messages.
Definition: sendlib.c:82
int mutt_bounce_message(FILE *fp, struct Email *e, struct AddressList *to)
Bounce an email message.
Definition: sendlib.c:3128
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:2823
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:1119
A postponed Email, just the envelope info.
Definition: sendlib.h:62
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:3211
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
Definition: sendlib.c:1746
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:1301
bool C_UseEnvelopeFrom
Config: Set the envelope sender of the message.
Definition: sendlib.c:94
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:81
bool C_UserAgent
Config: Add a &#39;User-Agent&#39; head to outgoing mail.
Definition: sendlib.c:95
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg)
Create a message attachment.
Definition: sendlib.c:1511
char * C_Sendmail
Config: External command to send email.
Definition: sendlib.c:91
short C_WrapHeaders
Config: Width to wrap headers in outgoing messages.
Definition: sendlib.c:96
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
Definition: sendlib.c:1772
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:2154
A mailbox.
Definition: mailbox.h:81
"light" mode (used for edit_hdrs)
Definition: sendlib.h:63
bool C_MimeTypeQueryFirst
Config: Run the C_MimeTypeQueryCommand before the mime.types lookup.
Definition: sendlib.c:90
int mutt_write_mime_header(struct Body *a, FILE *fp)
Create a MIME header.
Definition: sendlib.c:395
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Definition: sendlib.c:636
fcc mode, like normal mode but for Bcc header
Definition: sendlib.h:61
bool C_MimeForwardDecode
Config: Decode the forwarded message before attaching it.
Definition: sendlib.c:87
bool C_EncodeFrom
Config: Encode &#39;From &#39; as &#39;quote-printable&#39; at the beginning of lines.
Definition: sendlib.c:83
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 for mutt_write_address()
Definition: sendlib.c:1796
struct Content * mutt_get_content_info(const char *fname, struct Body *b)
Analyze file to determine MIME encoding to use.
Definition: sendlib.c:1031
bool C_HiddenHost
Config: Don&#39;t use the hostname, just the domain, when generating the message id.
Definition: sendlib.c:85
Duplicate the structure of an entire email.
bool C_Use8bitmime
Config: Use 8-bit messages and ESMTP to send messages.
Definition: sendlib.c:93
void mutt_write_references(const struct ListHead *r, FILE *fp, size_t trim)
Add the message references to a list.
Definition: sendlib.c:1842
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
Definition: copy.h:49
struct Body * mutt_make_file_attach(const char *path)
Create a file attachment.
Definition: sendlib.c:1650
void mutt_stamp_attachment(struct Body *a)
Timestamp an Attachment.
Definition: sendlib.c:1443
char * C_Inews
Config: (nntp) External command to post news articles.
Definition: sendlib.c:86
Write protected headers.
Definition: sendlib.h:64
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body&#39;s character set.
Definition: sendlib.c:1456
int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, const char *fcc, char **finalpath)
Write email to FCC mailbox.
Definition: sendlib.c:3258
void mutt_prepare_envelope(struct Envelope *env, bool final)
Prepare an email header.
Definition: sendlib.c:3003
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:84
int mutt_write_mime_body(struct Body *a, FILE *fp)
Write a MIME part.
Definition: sendlib.c:553
char * C_MimeTypeQueryCommand
Config: External command to determine the MIME type of an attachment.
Definition: sendlib.c:89
void mutt_update_encoding(struct Body *a)
Update the encoding type.
Definition: sendlib.c:1480