]> granicus.if.org Git - neomutt/blob - sendlib.h
merge: light refactoring
[neomutt] / sendlib.h
1 /**
2  * @file
3  * Miscellaneous functions for sending an email
4  *
5  * @authors
6  * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
7  * Copyright (C) 2019 Pietro Cerutti <gahr@gahr.ch>
8  *
9  * @copyright
10  * This program is free software: you can redistribute it and/or modify it under
11  * the terms of the GNU General Public License as published by the Free Software
12  * Foundation, either version 2 of the License, or (at your option) any later
13  * version.
14  *
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License along with
21  * this program.  If not, see <http://www.gnu.org/licenses/>.
22  */
23
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; /**< encode subject line with RFC2047 */
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
55 /**
56  * enum MuttWriteHeaderMode - Modes for mutt_rfc822_write_header()
57  */
58 enum MuttWriteHeaderMode
59 {
60   MUTT_WRITE_HEADER_NORMAL,   ///< A normal Email, write full header + MIME headers
61   MUTT_WRITE_HEADER_POSTPONE, ///< A postponed Email, just the envelope info
62   MUTT_WRITE_HEADER_EDITHDRS, ///< "light" mode (used for edit_hdrs)
63   MUTT_WRITE_HEADER_MIME,     ///< Write protected headers
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, const 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 */