Send/reply with an attachment. More...
#include "config.h"#include <locale.h>#include <stdbool.h>#include <stdio.h>#include "mutt/lib.h"#include "address/lib.h"#include "config/lib.h"#include "email/lib.h"#include "core/lib.h"#include "alias/lib.h"#include "gui/lib.h"#include "mutt.h"#include "recvcmd.h"#include "editor/lib.h"#include "expando/lib.h"#include "history/lib.h"#include "index/lib.h"#include "question/lib.h"#include "send/lib.h"#include "attach.h"#include "globals.h"#include "mutt_logging.h"#include <libintl.h>Go to the source code of this file.
Functions | |
| static bool | check_msg (struct Body *b, bool err) |
| Are we working with an RFC822 message. | |
| static bool | check_all_msg (struct AttachPtrArray *aa, bool err) |
| Are all the selected Attachments RFC822 messages? | |
| static bool | check_can_decode (struct AttachPtrArray *aa) |
| Can we decode all selected attachments? | |
| static bool | aa_contains_body (struct AttachPtrArray *aa, const struct Body *b) |
| Does the selection contain a Body? | |
| static short | count_selected_children (struct AttachCtx *actx, short i, struct AttachPtrArray *aa) |
| Selected children below a multipart/message attachment. | |
| void | attach_bounce_message (struct AttachPtrArray *aa, struct Mailbox *m) |
| Bounce function, from the attachment menu. | |
| void | mutt_attach_resend (struct AttachPtrArray *aa, struct Mailbox *m) |
| Resend-message, from the attachment menu. | |
| static struct AttachPtr * | find_common_parent (struct AttachCtx *actx, struct AttachPtrArray *aa) |
| Find a common parent message for the selected attachments. | |
| static int | is_parent (short i, struct AttachCtx *actx, const struct Body *b) |
| Check whether one attachment is the parent of another. | |
| static struct AttachPtr * | find_parent (struct AttachCtx *actx, struct AttachPtrArray *aa) |
| Find the parent of a selected Attachment set. | |
| static void | include_header (bool quote, FILE *fp_in, struct Email *e, FILE *fp_out, const char *prefix) |
| Write an email header to a file, optionally quoting it. | |
| static struct Body ** | copy_problematic_attachments (struct Body **last, struct AttachPtrArray *aa, bool force) |
| Attach the body parts which can't be decoded. | |
| static void | attach_forward_bodies (struct Email *e, struct AttachCtx *actx, struct AttachPtrArray *aa) |
| Forward one or several MIME bodies. | |
| static void | attach_forward_msgs (struct AttachPtrArray *aa, SendFlags flags) |
| Forward one or several message-type attachments. | |
| void | mutt_attach_forward (struct AttachPtrArray *aa, struct Email *e, struct AttachCtx *actx, SendFlags flags) |
| Forward selected attachments. | |
| static int | attach_reply_envelope_defaults (struct Envelope *env, struct AttachPtrArray *aa, struct Email *parent, SendFlags flags) |
| Create the envelope defaults for a reply. | |
| static void | attach_include_reply (FILE *fp, FILE *fp_tmp, struct Email *e) |
| This is very similar to send.c's include_reply(). | |
| void | mutt_attach_reply (struct AttachPtrArray *aa, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, SendFlags flags) |
| Attach a reply. | |
| void | mutt_attach_mail_sender (struct AttachPtrArray *aa) |
| Compose an email to the sender in the email attachment. | |
Send/reply with an attachment.
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 recvcmd.c.
|
static |
Are we working with an RFC822 message.
| b | Body of email |
| err | If true, display a message if this isn't an RFC822 message |
| true | This is an RFC822 message |
some helper functions to verify that we are exclusively operating on message/rfc822 attachments
Definition at line 68 of file recvcmd.c.
|
static |
Are all the selected Attachments RFC822 messages?
| aa | Selected attachments |
| err | If true, report errors |
| true | All parts are RFC822 messages |
Definition at line 85 of file recvcmd.c.
|
static |
Can we decode all selected attachments?
| aa | Selected attachments |
| true | All selected attachments are decodable |
Definition at line 101 of file recvcmd.c.
|
static |
Does the selection contain a Body?
| aa | Selected attachments |
| b | Candidate Body |
| true | Body is selected |
Definition at line 119 of file recvcmd.c.
|
static |
Selected children below a multipart/message attachment.
| actx | Attachment context |
| i | Index of first attachment |
| aa | Selected attachments |
| num | Number of selected attachments |
Definition at line 141 of file recvcmd.c.
| void attach_bounce_message | ( | struct AttachPtrArray * | aa, |
| struct Mailbox * | m ) |
Bounce function, from the attachment menu.
| aa | Selected attachments |
| m | Mailbox |
Definition at line 158 of file recvcmd.c.
| void mutt_attach_resend | ( | struct AttachPtrArray * | aa, |
| struct Mailbox * | m ) |
Resend-message, from the attachment menu.
| aa | Selected attachments |
| m | Current mailbox |
Definition at line 255 of file recvcmd.c.
|
static |
Find a common parent message for the selected attachments.
| actx | Attachment context |
| aa | Selected attachments |
| ptr | Parent attachment |
| NULL | Failure, no common parent |
Definition at line 274 of file recvcmd.c.
Check whether one attachment is the parent of another.
| i | Index of parent Attachment |
| actx | Attachment context |
| b | Potential child Attachment |
| true | Attachment |
check whether attachment i is a parent of the attachment pointed to by b
Definition at line 308 of file recvcmd.c.
Find the parent of a selected Attachment set.
| actx | Attachment context |
| aa | Selected attachments |
| ptr | Parent attachment |
| NULL | No parent exists |
Definition at line 328 of file recvcmd.c.
|
static |
Write an email header to a file, optionally quoting it.
| quote | If true, prefix the lines |
| fp_in | File to read from |
| e | |
| fp_out | File to write to |
| prefix | Prefix for each line (OPTIONAL) |
Definition at line 364 of file recvcmd.c.
|
static |
Attach the body parts which can't be decoded.
| [out] | last | Body pointer to update |
| [in] | aa | Selected attachments |
| [in] | force | If true, attach parts that can't be decoded |
| ptr | Pointer to last Body part |
This code is shared by forwarding and replying.
Definition at line 410 of file recvcmd.c.
|
static |
Forward one or several MIME bodies.
| e | |
| actx | Attachment Context |
| aa | Selected attachments |
(non-message types)
Definition at line 434 of file recvcmd.c.
|
static |
Forward one or several message-type attachments.
| aa | Selected attachments |
| flags | Send mode, see SendFlags |
This is different from the previous function since we want to mimic the index menu's behavior.
Code reuse from mutt_send_message() is not possible here. It relies on a context structure to find messages, while, on the attachment menu, messages are referenced through the attachment index.
Definition at line 621 of file recvcmd.c.
| void mutt_attach_forward | ( | struct AttachPtrArray * | aa, |
| struct Email * | e, | ||
| struct AttachCtx * | actx, | ||
| SendFlags | flags ) |
Forward selected attachments.
Definition at line 737 of file recvcmd.c.
|
static |
Create the envelope defaults for a reply.
| env | Envelope to fill in |
| aa | Selected attachments |
| parent | Parent Email |
| flags | Flags, see SendFlags |
| 0 | Success |
| -1 | Error |
This function can be invoked in two ways.
Either, parent is NULL. In this case, all selected bodies are of a message type, and the header information is fetched from them.
Or, parent is non-NULL. In this case, parent is the common parent of all the selected attachments.
Note that this code is horribly similar to envelope_defaults() from send.c.
Definition at line 769 of file recvcmd.c.
|
static |
This is very similar to send.c's include_reply().
| fp | File handle to attachment |
| fp_tmp | File handle to temporary file |
| e |
Definition at line 856 of file recvcmd.c.
| void mutt_attach_reply | ( | struct AttachPtrArray * | aa, |
| struct Mailbox * | m, | ||
| struct Email * | e, | ||
| struct AttachCtx * | actx, | ||
| SendFlags | flags ) |
Attach a reply.
| aa | Selected attachments |
| m | Mailbox |
| e | |
| actx | Attachment Context |
| flags | Send mode, see SendFlags |
Definition at line 885 of file recvcmd.c.
| void mutt_attach_mail_sender | ( | struct AttachPtrArray * | aa | ) |
Compose an email to the sender in the email attachment.
| aa | Selected attachments |
Definition at line 1074 of file recvcmd.c.