struct Address *mutt_expand_aliases(struct Address *a);
struct Address *mutt_get_address(struct Envelope *env, char **pfxp);
+bool mutt_addr_is_user(struct Address *addr);
+int mutt_alias_complete(char *buf, size_t buflen);
+void mutt_alias_add_reverse(struct Alias *t);
+void mutt_alias_delete_reverse(struct Alias *t);
+struct Address *mutt_alias_reverse_lookup(struct Address *a);
+
#endif /* _MUTT_ALIAS_H */
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mutt_window.h"
+#include "muttlib.h"
#include "mx.h"
#include "opcodes.h"
#include "options.h"
#endif
};
+void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles);
+void mutt_browser_select_dir(char *f);
+
#endif /* _MUTT_BROWSER_H */
#define MUTT_BUFFY_CHECK_FORCE (1 << 0)
#define MUTT_BUFFY_CHECK_FORCE_STATS (1 << 1)
+void mutt_buffy(char *s, size_t slen);
+bool mutt_buffy_list(void);
+int mutt_buffy_check(int force);
+bool mutt_buffy_notify(void);
+int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
+
/* These variables are backing for config items */
WHERE short MailCheck;
WHERE short MailCheckStatsInterval;
--- /dev/null
+/**
+ * @file
+ * Color and attribute parsing
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_COLOR_H
+#define MUTT_COLOR_H
+
+struct Buffer;
+
+int mutt_alloc_color(int fg, int bg);
+int mutt_combine_color(int fg_attr, int bg_attr);
+void mutt_free_color(int fg, int bg);
+void mutt_free_colors(void);
+int mutt_parse_color(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_mono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+
+#endif /* MUTT_COLOR_H */
#include "keymap.h"
#include "mailbox.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
+#include "recvattach.h"
#include "mx.h"
#include "ncrypt/ncrypt.h"
#include "options.h"
--- /dev/null
+/**
+ * @file
+ * Manage where the email is piped to external commands
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_COMMANDS_H
+#define MUTT_COMMANDS_H
+
+#include <stdio.h>
+
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+void ci_bounce_message(struct Header *h);
+void mutt_check_stats(void);
+int mutt_check_traditional_pgp(struct Header *h, int *redraw);
+void mutt_display_address(struct Envelope *env);
+int mutt_display_message(struct Header *cur);
+int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp);
+void mutt_enter_command(void);
+void mutt_pipe_message(struct Header *h);
+void mutt_print_message(struct Header *h);
+int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, struct Context *ctx);
+int mutt_save_message(struct Header *h, int delete, int decode, int decrypt);
+void mutt_shell_escape(void);
+void mutt_version(void);
+
+#endif /* MUTT_COMMANDS_H */
#include "mutt_attach.h"
#include "mutt_curses.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "mx.h"
#include "globals.h"
#include "keymap.h"
#include "mutt_account.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "opcodes.h"
#include "options.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "mutt.h"
+#include "browser.h"
#include "context.h"
#include "enter_state.h"
#include "globals.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "opcodes.h"
--- /dev/null
+/**
+ * @file
+ * GUI miscellaneous curses (window drawing) routines
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_CURS_LIB_H
+#define MUTT_CURS_LIB_H
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <wchar.h>
+
+struct Context;
+
+bool message_is_tagged(struct Context *ctx, int index);
+bool message_is_visible(struct Context *ctx, int index);
+int mutt_addwch(wchar_t wc);
+int mutt_any_key_to_continue(const char *s);
+void mutt_edit_file(const char *editor, const char *data);
+int mutt_enter_fname_full(const char *prompt, char *buf, size_t blen, int buffy, int multiple, char ***files, int *numfiles, int flags);
+void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s);
+void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s);
+int mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete, int multiple, char ***files, int *numfiles);
+int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
+int mutt_multi_choice(char *prompt, char *letters);
+void mutt_paddstr(int n, const char *s);
+void mutt_perror_debug(const char *s);
+void mutt_query_exit(void);
+void mutt_show_error(void);
+void mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, int justify, char pad_char, const char *s, size_t n, int arboreal);
+int mutt_strwidth(const char *s);
+size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width);
+int mutt_yesorno(const char *msg, int def);
+
+#endif /* MUTT_CURS_LIB_H */
#include "conn/conn.h"
#include "mutt.h"
#include "alias.h"
+#include "browser.h"
#include "buffy.h"
#include "context.h"
#include "format_flags.h"
#include "mailbox.h"
#include "mutt_curses.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_thread.h"
#include "mutt_window.h"
#include "pattern.h"
#include "progress.h"
#include "protos.h"
+#include "recvattach.h"
#include "sort.h"
#include "terminal.h"
#ifdef USE_SIDEBAR
#include <wctype.h>
#include "mutt/mutt.h"
#include "mutt.h"
+#include "alias.h"
+#include "browser.h"
+#include "buffy.h"
#include "enter_state.h"
#include "globals.h"
#include "history.h"
#include "filter.h"
#include "globals.h"
#include "keymap.h"
+#include "mutt_attach.h"
+#include "mutt_logging.h"
#include "ncrypt/ncrypt.h"
#include "opcodes.h"
#include "options.h"
#include "protos.h"
+#include "recvattach.h"
#include "rfc1524.h"
#include "rfc3676.h"
#include "state.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "mutt.h"
+#include "alias.h"
#include "context.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "mutt.h"
+#include "alias.h"
#include "globals.h"
#include "mailbox.h"
#include "ncrypt/ncrypt.h"
--- /dev/null
+/**
+ * @file
+ * Parse and execute user-defined hooks
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_HOOK_H
+#define MUTT_HOOK_H
+
+#include <stdio.h>
+
+struct Address;
+struct Buffer;
+struct Context;
+struct Header;
+struct ListHead;
+
+void mutt_account_hook(const char *url);
+void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
+void mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
+void mutt_delete_hooks(int type);
+char *mutt_find_hook(int type, const char *pat);
+void mutt_folder_hook(const char *path);
+void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type);
+int mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr);
+void mutt_startup_shutdown_hook(int type);
+void mutt_timeout_hook(void);
+
+#endif /* MUTT_HOOK_H */
#include "conn/conn.h"
#include "auth.h"
#include "mutt_account.h"
+#include "mutt_logging.h"
#include "mutt_socket.h"
#include "options.h"
#include "protos.h"
#include "context.h"
#include "globals.h"
#include "imap/imap.h"
+#include "mutt_logging.h"
#include "options.h"
#include "protos.h"
#include "mailbox.h"
#include "message.h"
#include "mutt_account.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_socket.h"
#include "mx.h"
#include "mailbox.h"
#include "mutt_account.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_socket.h"
#include "mx.h"
#include "options.h"
#include "globals.h"
#include "group.h"
#include "history.h"
+#include "keymap.h"
#include "mutt_commands.h"
#include "mutt_logging.h"
#include "mutt_options.h"
#include "functions.h"
#include "globals.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_window.h"
#include "ncrypt/ncrypt.h"
#include "opcodes.h"
void mutt_free_keys(void);
+int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
+
#endif /* _MUTT_KEYMAP_H */
#include "conn/conn.h"
#include "mutt.h"
#include "alias.h"
+#include "browser.h"
#include "buffy.h"
#include "globals.h"
#include "keymap.h"
#include "globals.h"
#include "keymap.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "opcodes.h"
#include <stdbool.h>
#include "where.h"
+struct Buffer;
struct ListHead;
struct Mapping;
int safe_asprintf(char **, const char *, ...);
-int mutt_inbox_cmp(const char *a, const char *b);
-
char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items);
+int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags);
+void mutt_free_opts(void);
+int query_quadoption(int opt, const char *prompt);
+int mutt_label_complete(char *buf, size_t buflen, int numtabs);
+int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
+int mutt_var_value_complete(char *buf, size_t buflen, int pos);
+void myvar_set(const char *var, const char *val);
+bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
+bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
+int mutt_dump_variables(bool hide_sensitive);
+int mutt_get_hook_type(const char *name);
+int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
+int mutt_query_variables(struct ListHead *queries);
+bool set_default_value(const char *name, intptr_t value);
+void reset_value(const char *name);
+
/* All the variables below are backing for config items */
/* Quad-options */
#include "globals.h"
#include "handler.h"
#include "mailbox.h"
+#include "mutt_attach.h"
#include "mutt_curses.h"
#include "mx.h"
#include "ncrypt/ncrypt.h"
#include "options.h"
#include "pager.h"
#include "protos.h"
+#include "recvattach.h"
#include "rfc1524.h"
#include "state.h"
int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, struct AttachCtx *actx);
+void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
+int mutt_compose_attachment(struct Body *a);
+int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags);
+int mutt_edit_attachment(struct Body *a);
+int mutt_get_tmp_attachment(struct Body *a);
+int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
+int mutt_print_attachment(FILE *fp, struct Body *a);
+int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr);
+
#endif /* _MUTT_ATTACH2_H */
#include <string.h>
#include "mutt/mutt.h"
#include "email/email.h"
+#include "mutt_attach.h"
#include "protos.h"
/**
int mutt_log_set_level(int level, bool verbose);
int mutt_log_set_file(const char *file, bool verbose);
+void mutt_clear_error(void);
+
#endif /* _LOGGING2_H */
--- /dev/null
+/**
+ * @file
+ * Some miscellaneous functions
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_MUTTLIB_H
+#define MUTT_MUTTLIB_H
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+
+struct Address;
+struct Body;
+
+struct passwd;
+struct stat;
+
+void mutt_adv_mktemp(char *s, size_t l);
+int mutt_check_overwrite(const char *attname, const char *path, char *fname, size_t flen, int *append, char **directory);
+void mutt_encode_path(char *dest, size_t dlen, const char *src);
+void mutt_expand_file_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
+void mutt_expand_fmt(char *dest, size_t destlen, const char *fmt, const char *src);
+char * mutt_expand_path(char *s, size_t slen);
+char * mutt_expand_path_regex(char *s, size_t slen, bool regex);
+char * mutt_gecos_name(char *dest, size_t destlen, struct passwd *pw);
+void mutt_get_parent_path(char *output, char *path, size_t olen);
+int mutt_inbox_cmp(const char *a, const char *b);
+bool mutt_is_text_part(struct Body *b);
+const char *mutt_make_version(void);
+void mutt_mktemp_full(char *s, size_t slen, const char *prefix, const char *suffix, const char *src, int line);
+bool mutt_needs_mailcap(struct Body *m);
+FILE * mutt_open_read(const char *path, pid_t *thepid);
+void mutt_pretty_mailbox(char *s, size_t buflen);
+uint32_t mutt_rand32(void);
+uint64_t mutt_rand64(void);
+void mutt_rand_base32(void *out, size_t len);
+int mutt_randbuf(void *out, size_t len);
+size_t mutt_realpath(char *buf);
+void mutt_safe_path(char *s, size_t l, struct Address *a);
+int mutt_save_confirm(const char *s, struct stat *st);
+void mutt_save_path(char *d, size_t dsize, struct Address *a);
+void mutt_sleep(short s);
+
+#endif /* MUTT_MUTTLIB_H */
#include "maildir/maildir.h"
#include "mbox/mbox.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "mutt_thread.h"
#include "ncrypt/ncrypt.h"
#include "opcodes.h"
#include "globals.h"
#include "handler.h"
#include "keymap.h"
+#include "mutt_attach.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "ncrypt.h"
#include "options.h"
#include "pager.h"
#include "protos.h"
+#include "recvattach.h"
#include "sort.h"
#include "state.h"
#ifdef ENABLE_NLS
#include "filter.h"
#include "globals.h"
#include "handler.h"
+#include "mutt_attach.h"
#include "mutt_curses.h"
#include "ncrypt.h"
#include "options.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_window.h"
#include "ncrypt.h"
#include "pgp.h"
#include "globals.h"
#include "gnupgparse.h"
#include "keymap.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "ncrypt.h"
#include "pgpinvoke.h"
#include "pgplib.h"
#include "protos.h"
+#include "recvattach.h"
#include "sort.h"
/**
#include "handler.h"
#include "keymap.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "ncrypt.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt_account.h"
+#include "mutt_logging.h"
#include "mutt_socket.h"
#include "mutt_window.h"
#include "mx.h"
#include "globals.h"
#include "mailbox.h"
#include "maildir/maildir.h"
+#include "mutt_logging.h"
#include "mutt_thread.h"
#include "mx.h"
#include "progress.h"
#include "mutt.h"
#include "pager.h"
#include "alias.h"
+#include "buffy.h"
#include "context.h"
#include "format_flags.h"
#include "globals.h"
#include "mutt_attach.h"
#include "mutt_curses.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "mx.h"
#include "opcodes.h"
#include "options.h"
#include "protos.h"
+#include "recvattach.h"
#include "recvcmd.h"
#include "sort.h"
#include "terminal.h"
int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *extra);
void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcount, int index_hint);
+void mutt_clear_pager_position(void);
+
#endif /* _MUTT_PAGER_H */
#include "ncrypt/ncrypt.h"
#include "options.h"
#include "protos.h"
+#include "recvattach.h"
#include "rfc2047.h"
#include "rfc2231.h"
#include "url.h"
--- /dev/null
+/**
+ * @file
+ * Miscellaneous email parsing routines
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_PARSE_H
+#define MUTT_PARSE_H
+
+#include <stdbool.h>
+#include <stdio.h>
+
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+int mutt_check_encoding(const char *c);
+int mutt_check_mime_type(const char *s);
+int mutt_count_body_parts(struct Context *ctx, struct Header *hdr);
+char * mutt_extract_message_id(const char *s, const char **saveptr);
+void mutt_parse_content_type(char *s, struct Body *ct);
+void mutt_parse_mime_message(struct Context *ctx, struct Header *cur);
+struct Body * mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest);
+void mutt_parse_part(FILE *fp, struct Body *b);
+struct Body * mutt_read_mime_header(FILE *fp, bool digest);
+int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p, short user_hdrs, short weed, short do_2047);
+struct Body * mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, short user_hdrs, short weed);
+char * mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
+
+#endif /* MUTT_PARSE_H */
#include "conn/conn.h"
#include "mutt.h"
#include "pattern.h"
+#include "alias.h"
#include "context.h"
#include "copy.h"
#include "globals.h"
#include "group.h"
#include "handler.h"
#include "mailbox.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mx.h"
#include "ncrypt/ncrypt.h"
#include "mailbox.h"
#include "mutt_account.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "mutt_socket.h"
#include "mx.h"
#include "ncrypt/ncrypt.h"
#include "globals.h"
#include "mutt_account.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_socket.h"
#include "options.h"
#include "pop.h"
#include "handler.h"
#include "keymap.h"
#include "mailbox.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_thread.h"
#include "ncrypt/ncrypt.h"
#include <sys/time.h>
#include "mutt/mutt.h"
#include "mutt.h"
+#include "mutt_logging.h"
#include "progress.h"
#include "globals.h"
#include "mutt_curses.h"
#define _MUTT_PROTOS_H
#include <stddef.h>
-#include <ctype.h>
-#include <iconv.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>
-#include <wctype.h>
#include "mutt.h"
#include "format_flags.h"
struct Address;
-struct Alias;
struct AliasList;
struct Body;
struct Buffer;
XDG_CONFIG_DIRS,
};
-int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, int flags);
-
void mutt_make_string_info(char *buf, size_t buflen, int cols, const char *s,
struct HdrFormatInfo *hfi, enum FormatFlag flags);
-void mutt_free_opts(void);
-
int mutt_system(const char *cmd);
void mutt_parse_content_type(char *s, struct Body *ct);
void mutt_generate_boundary(struct ParameterList *parm);
-#ifdef USE_NOTMUCH
-int mutt_parse_virtual_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
-#endif
-
FILE *mutt_open_read(const char *path, pid_t *thepid);
-int query_quadoption(int opt, const char *prompt);
-
char *mutt_extract_message_id(const char *s, const char **saveptr);
struct Address *mutt_default_from(void);
int is_from(const char *s, char *path, size_t pathlen, time_t *tp);
-const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols,
- char op, const char *src, const char *prec,
- const char *if_str, const char *else_str,
- unsigned long data, enum FormatFlag flags);
-
char *mutt_expand_path(char *s, size_t slen);
char *mutt_expand_path_regex(char *s, size_t slen, bool regex);
char *mutt_find_hook(int type, const char *pat);
void mutt_adv_mktemp(char *s, size_t l);
void mutt_alias_menu(char *buf, size_t buflen, struct AliasList *aliases);
int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to);
-void mutt_buffy(char *s, size_t slen);
-bool mutt_buffy_list(void);
void mutt_check_stats(void);
int mutt_count_body_parts(struct Context *ctx, struct Header *hdr);
void mutt_check_rescore(struct Context *ctx);
-void mutt_clear_error(void);
-void mutt_clear_pager_position(void);
void mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
void mutt_display_address(struct Envelope *env);
void mutt_draw_statusline(int cols, const char *buf, size_t buflen);
int mutt_edit_content_type (struct Header *h, struct Body *b, FILE *fp);
void mutt_edit_file(const char *editor, const char *data);
-int mutt_label_complete(char *buf, size_t buflen, int numtabs);
void mutt_encode_descriptions(struct Body *b, short recurse);
void mutt_encode_path(char *dest, size_t dlen, const char *src);
void mutt_enter_command(void);
void mutt_free_color(int fg, int bg);
void mutt_free_colors(void);
void mutt_help(int menu);
-void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
void mutt_save_path(char *d, size_t dsize, struct Address *a);
void mutt_score_message(struct Context *ctx, struct Header *hdr, bool upd_ctx);
void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr);
-void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfiles);
void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type);
void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx);
#define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, true)
void mutt_tag_set_flag(int flag, int bf);
void mutt_update_encoding(struct Body *a);
void mutt_version(void);
-void mutt_view_attachments(struct Header *hdr);
void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
-bool mutt_addr_is_user(struct Address *addr);
int mutt_addwch(wchar_t wc);
-int mutt_alias_complete(char *buf, size_t buflen);
-void mutt_alias_add_reverse(struct Alias *t);
-void mutt_alias_delete_reverse(struct Alias *t);
int mutt_alloc_color(int fg, int bg);
int mutt_combine_color(int fg_attr, int bg_attr);
int mutt_any_key_to_continue(const char *s);
-int mutt_buffy_check(int force);
-bool mutt_buffy_notify(void);
int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur);
int mutt_change_flag(struct Header *h, int bf);
int mutt_check_encoding(const char *c);
int mutt_check_overwrite(const char *attname, const char *path, char *fname,
size_t flen, int *append, char **directory);
int mutt_check_traditional_pgp(struct Header *h, int *redraw);
-int mutt_command_complete(char *buf, size_t buflen, int pos, int numtabs);
-int mutt_var_value_complete(char *buf, size_t buflen, int pos);
-void myvar_set(const char *var, const char *val);
-#ifdef USE_NOTMUCH
-bool mutt_nm_query_complete(char *buf, size_t buflen, int pos, int numtabs);
-bool mutt_nm_tag_complete(char *buf, size_t buflen, int numtabs);
-#endif
int mutt_complete(char *buf, size_t buflen);
-int mutt_compose_attachment(struct Body *a);
-int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags);
int mutt_display_message(struct Header *cur);
-int mutt_dump_variables(bool hide_sensitive);
-int mutt_edit_attachment(struct Body *a);
int mutt_edit_message(struct Context *ctx, struct Header *hdr);
int mutt_view_message(struct Context *ctx, struct Header *hdr);
int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags);
#define mutt_get_field(A, B, C, D) mutt_get_field_full(A, B, C, D, 0, NULL, NULL)
int mutt_get_field_full(const char *field, char *buf, size_t buflen, int complete,
int multiple, char ***files, int *numfiles);
-int mutt_get_hook_type(const char *name);
int mutt_get_field_unbuffered(char *msg, char *buf, size_t buflen, int flags);
#define mutt_get_password(A, B, C) mutt_get_field_unbuffered(A, B, C, MUTT_PASS)
int mutt_get_postponed(struct Context *ctx, struct Header *hdr, struct Header **cur, char *fcc, size_t fcclen);
int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app);
-int mutt_get_tmp_attachment(struct Body *a);
int mutt_index_menu(void);
int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc,
const char *msg, int eightbit);
bool mutt_is_mail_list(struct Address *addr);
-bool mutt_is_message_type(int type, const char *subtype);
bool mutt_is_subscribed_list(struct Address *addr);
bool mutt_is_text_part(struct Body *b);
int mutt_lookup_mime_type(struct Body *att, const char *path);
int mutt_multi_choice(char *prompt, char *letters);
bool mutt_needs_mailcap(struct Body *m);
int mutt_num_postponed(int force);
-int mutt_parse_bind(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_exec(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_color(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_macro(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_mono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_push(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-int mutt_parse_rc_line(/* const */ char *line, struct Buffer *token, struct Buffer *err);
int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p,
short user_hdrs, short weed, short do_2047);
int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
void mutt_delete_hooks(int type);
-int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
-int mutt_print_attachment(FILE *fp, struct Body *a);
int mutt_query_complete(char *buf, size_t buflen);
-int mutt_query_variables(struct ListHead *queries);
-int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr);
int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, struct Context *ctx);
int mutt_save_message(struct Header *h, int delete, int decode, int decrypt);
#ifdef USE_SMTP
void mutt_sleep(short s);
int mutt_save_confirm(const char *s, struct stat *st);
-void mutt_browser_select_dir(char *f);
void mutt_get_parent_path(char *output, char *path, size_t olen);
size_t mutt_realpath(char *buf);
uint64_t mutt_rand64(void);
int mutt_randbuf(void *out, size_t len);
-struct Address *mutt_alias_reverse_lookup(struct Address *a);
-
int getdnsdomainname(char *d, size_t len);
-/* unsorted */
void ci_bounce_message(struct Header *h);
int ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur);
-/* prototypes for compatibility functions */
-
#ifndef HAVE_WCSCASECMP
int wcscasecmp(const wchar_t *a, const wchar_t *b);
#endif
bool message_is_tagged(struct Context *ctx, int index);
bool message_is_visible(struct Context *ctx, int index);
-bool set_default_value(const char *name, intptr_t value);
-void reset_value(const char *name);
-
#endif /* _MUTT_PROTOS_H */
#include "format_flags.h"
#include "globals.h"
#include "keymap.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "opcodes.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "mutt.h"
+#include "recvattach.h"
#include "context.h"
#include "filter.h"
#include "format_flags.h"
#include "mailbox.h"
#include "mutt_attach.h"
#include "mutt_curses.h"
+#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_window.h"
#include "mx.h"
#ifndef _MUTT_RECVATTACH_H
#define _MUTT_RECVATTACH_H
+#include "format_flags.h"
+
struct AttachCtx;
void mutt_attach_init(struct AttachCtx *actx);
void mutt_update_tree(struct AttachCtx *actx);
+const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, unsigned long data, enum FormatFlag flags);
+void mutt_view_attachments(struct Header *hdr);
+bool mutt_is_message_type(int type, const char *subtype);
+
#endif /* _MUTT_RECVATTACH_H */
#include "globals.h"
#include "handler.h"
#include "mutt_body.h"
+#include "mutt_logging.h"
#include "mutt_window.h"
#include "options.h"
#include "protos.h"
+#include "recvattach.h"
#include "state.h"
#ifdef ENABLE_NLS
#include <libintl.h>
#include "opcodes.h"
#include "options.h"
#include "protos.h"
+#include "recvattach.h"
/**
* struct Coord - Screen coordinates
#include "mutt.h"
#include "rfc1524.h"
#include "globals.h"
+#include "mutt_attach.h"
#include "options.h"
#include "protos.h"
#include "filter.h"
#include "globals.h"
#include "mailbox.h"
+#include "mutt_attach.h"
#include "mutt_header.h"
+#include "mutt_logging.h"
#include "ncrypt/ncrypt.h"
#include "options.h"
#include "pattern.h"
--- /dev/null
+/**
+ * @file
+ * Prepare and send an email
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_SEND_H
+#define MUTT_SEND_H
+
+#include <stdio.h>
+
+struct Address;
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+
+int ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur);
+void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv);
+int mutt_compose_to_sender(struct Header *hdr);
+struct Address *mutt_default_from(void);
+void mutt_encode_descriptions(struct Body *b, short recurse);
+int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags);
+void mutt_fix_reply_recipients(struct Envelope *env);
+void mutt_forward_intro(struct Context *ctx, struct Header *cur, FILE *fp);
+void mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp);
+void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
+void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
+void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
+void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out);
+struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b);
+int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur);
+void mutt_set_followup_to(struct Envelope *e);
+
+#endif /* MUTT_SEND_H */
#include "options.h"
#include "pager.h"
#include "protos.h"
+#include "recvattach.h"
#include "rfc2047.h"
#include "rfc2231.h"
#include "state.h"
--- /dev/null
+/**
+ * @file
+ * Miscellaneous functions for sending an email
+ *
+ * @authors
+ * Copyright (C) 2018 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * 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/>.
+ */
+
+#ifndef MUTT_SENDLIB_H
+#define MUTT_SENDLIB_H
+
+#include <stdbool.h>
+#include <stdio.h>
+
+struct Address;
+struct Body;
+struct Context;
+struct Envelope;
+struct Header;
+struct ListHead;
+struct ParameterList;
+
+char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
+int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to);
+const char * mutt_fqdn(bool may_hide_host);
+void mutt_generate_boundary(struct ParameterList *parm);
+struct Content *mutt_get_content_info(const char *fname, struct Body *b);
+int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc, const char *msg, int eightbit);
+int mutt_lookup_mime_type(struct Body *att, const char *path);
+struct Body * mutt_make_file_attach(const char *path);
+struct Body * mutt_make_message_attach(struct Context *ctx, struct Header *hdr, bool attach_msg);
+struct Body * mutt_make_multipart(struct Body *b);
+void mutt_message_to_7bit(struct Body *a, FILE *fp);
+void mutt_prepare_envelope(struct Envelope *env, bool final);
+struct Address *mutt_remove_duplicates(struct Address *addr);
+struct Body * mutt_remove_multipart(struct Body *b);
+int mutt_rfc822_write_header(FILE *fp, struct Envelope *env, struct Body *attach, int mode, bool privacy);
+void mutt_stamp_attachment(struct Body *a);
+void mutt_unprepare_envelope(struct Envelope *env);
+void mutt_update_encoding(struct Body *a);
+void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
+int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int mutt_write_mime_body(struct Body *a, FILE *f);
+int mutt_write_mime_header(struct Body *a, FILE *f);
+int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid, int post, char *fcc, char **finalpath);
+int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
+void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);
+
+#endif /* MUTT_SENDLIB_H */
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "mutt_window.h"
+#include "muttlib.h"
#include "mx.h"
#include "opcodes.h"
#include "options.h"
#include "mutt/mutt.h"
#include "email/email.h"
#include "sort.h"
+#include "alias.h"
#include "context.h"
#include "globals.h"
+#include "mutt_logging.h"
#include "mutt_thread.h"
#include "options.h"
#include "protos.h"
#include "config.h"
#include <stdio.h>
#include "mutt/mutt.h"
+#include "buffy.h"
#include "context.h"
#include "format_flags.h"
#include "globals.h"