Handling of email attachments. More...
Include dependency graph for mutt_attach.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Enumerations | |
| enum | ViewAttachMode { MUTT_VA_REGULAR = 1 , MUTT_VA_MAILCAP , MUTT_VA_AS_TEXT , MUTT_VA_PAGER } |
| Options for mutt_view_attachment() More... | |
| enum | SaveAttach { MUTT_SAVE_NONE = 0 , MUTT_SAVE_APPEND = 1U << 0 } |
| Options for saving attachments. More... | |
Functions | |
| int | mutt_attach_display_loop (struct ConfigSubset *sub, struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv) |
| Event loop for the Attachment menu. | |
| void | mutt_save_attachment_list (struct AttachPtrArray *aa, struct Email *e, struct Menu *menu) |
| Save a list of selected attachments. | |
| void | mutt_pipe_attachment_list (struct AttachPtrArray *aa, bool filter) |
| Pipe selected attachments to a command. | |
| void | mutt_print_attachment_list (struct AttachPtrArray *aa) |
| Print selected attachments. | |
| int | mutt_view_attachment (FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win) |
| View an attachment. | |
| void | mutt_check_lookup_list (struct Body *b, char *type, size_t len) |
| Update the mime type. | |
| int | mutt_compose_attachment (struct Body *b) |
| Create an attachment. | |
| int | mutt_decode_save_attachment (FILE *fp, struct Body *b, const char *path, StateFlags flags, enum SaveAttach opt) |
| Decode, then save an attachment. | |
| bool | mutt_edit_attachment (struct Body *b) |
| Edit an attachment. | |
| int | mutt_get_tmp_attachment (struct Body *b) |
| Get a temporary copy of an attachment. | |
| int | mutt_pipe_attachment (FILE *fp, struct Body *b, const char *path, const char *outfile) |
| Pipe an attachment to a command. | |
| int | mutt_print_attachment (FILE *fp, struct Body *b) |
| Print out an attachment. | |
| int | mutt_save_attachment (FILE *fp, struct Body *b, const char *path, enum SaveAttach opt, struct Email *e) |
| Save an attachment. | |
| void | mutt_add_temp_attachment (const char *filename) |
| Add file to list of temporary attachments. | |
| void | mutt_temp_attachments_cleanup (struct ListHead *list) |
| Delete all temporary attachments. | |
Handling of email attachments.
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 mutt_attach.h.
| enum ViewAttachMode |
Options for mutt_view_attachment()
Definition at line 43 of file mutt_attach.h.
| enum SaveAttach |
Options for saving attachments.
| Enumerator | |
|---|---|
| MUTT_SAVE_NONE | Overwrite existing file (the default) |
| MUTT_SAVE_APPEND | Append to existing file. |
Definition at line 57 of file mutt_attach.h.
| int mutt_attach_display_loop | ( | struct ConfigSubset * | sub, |
| struct Menu * | menu, | ||
| int | op, | ||
| struct Email * | e, | ||
| struct AttachCtx * | actx, | ||
| bool | recv ) |
Event loop for the Attachment menu.
| sub | Config Subset |
| menu | Menu listing Attachments |
| op | Operation, e.g. OP_ATTACH_VIEW |
| e | |
| actx | Attachment context |
| recv | true if these are received attachments (rather than in compose) |
| num | Operation performed |
Definition at line 917 of file recvattach.c.
Here is the call graph for this function:
Here is the caller graph for this function:Save a list of selected attachments.
| aa | Selected attachments |
| e | Parent email |
| menu | Menu listing attachments |
Definition at line 423 of file recvattach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_pipe_attachment_list | ( | struct AttachPtrArray * | aa, |
| bool | filter ) |
Pipe selected attachments to a command.
| aa | Selected attachments |
| filter | Is this command a filter? |
Definition at line 697 of file recvattach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_print_attachment_list | ( | struct AttachPtrArray * | aa | ) |
Print selected attachments.
| aa | Selected attachments |
Definition at line 846 of file recvattach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_view_attachment | ( | FILE * | fp, |
| struct Body * | b, | ||
| enum ViewAttachMode | mode, | ||
| struct Email * | e, | ||
| struct AttachCtx * | actx, | ||
| struct MuttWindow * | win ) |
View an attachment.
| fp | Source file stream. Can be NULL |
| b | The message body containing the attachment |
| mode | How the attachment should be viewed, see ViewAttachMode |
| e | Current Email. Can be NULL |
| actx | Attachment context |
| win | Window |
| 0 | The viewer is run and exited successfully |
| -1 | Error |
| num | Return value of mutt_do_pager() when it is used |
Display a message attachment using the viewer program configured in mailcap. If there is no mailcap entry for a file type, view the image as text. Viewer processes are opened and waited on synchronously so viewing an attachment this way will block the main neomutt process until the viewer process exits.
Definition at line 418 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_check_lookup_list | ( | struct Body * | b, |
| char * | type, | ||
| size_t | len ) |
Update the mime type.
| b | Message attachment body |
| type | Buffer with mime type of attachment in "type/subtype" format |
| len | Buffer length |
Definition at line 339 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_compose_attachment | ( | struct Body * | b | ) |
Create an attachment.
| b | Body of email |
| 1 | Require full screen redraw |
| 0 | Otherwise |
Definition at line 116 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_decode_save_attachment | ( | FILE * | fp, |
| struct Body * | b, | ||
| const char * | path, | ||
| StateFlags | flags, | ||
| enum SaveAttach | opt ) |
Decode, then save an attachment.
| fp | File to read from (OPTIONAL) |
| b | Attachment |
| path | Path to save the Attachment to |
| flags | Flags, e.g. STATE_DISPLAY |
| opt | Save option, see SaveAttach |
| 0 | Success |
| -1 | Error |
Definition at line 1036 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| bool mutt_edit_attachment | ( | struct Body * | b | ) |
Edit an attachment.
| b | Email containing attachment |
| true | Editor found |
| false | Editor not found |
Currently, this only works for send mode, as it assumes that the Body->filename actually contains the information. I'm not sure we want to deal with editing attachments we've already received, so this should be ok.
Returning 0 is useful to tell the calling menu to redraw
Definition at line 261 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_get_tmp_attachment | ( | struct Body * | b | ) |
Get a temporary copy of an attachment.
| b | Attachment to copy |
| 0 | Success |
| -1 | Error |
Definition at line 68 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_pipe_attachment | ( | FILE * | fp, |
| struct Body * | b, | ||
| const char * | path, | ||
| const char * | outfile ) |
Pipe an attachment to a command.
| fp | File to pipe into the command |
| b | Attachment |
| path | Path to command |
| outfile | File to save output to |
| 1 | Success |
| 0 | Error |
Definition at line 737 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_print_attachment | ( | FILE * | fp, |
| struct Body * | b ) |
Print out an attachment.
| fp | File to write to |
| b | Attachment |
| 1 | Success |
| 0 | Error |
Ok, the difference between send and receive: recv: Body->filename is a suggested name, and Mailbox|Email points to the attachment in mailbox which is encoded send: Body->filename points to the un-encoded file which contains the attachment
Definition at line 1134 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int mutt_save_attachment | ( | FILE * | fp, |
| struct Body * | b, | ||
| const char * | path, | ||
| enum SaveAttach | opt, | ||
| struct Email * | e ) |
Save an attachment.
| fp | Source file stream. Can be NULL |
| b | Email Body |
| path | Where to save the attachment |
| opt | Save option, see SaveAttach |
| e | Current Email. Can be NULL |
| 0 | Success |
| -1 | Error |
Definition at line 903 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_add_temp_attachment | ( | const char * | filename | ) |
Add file to list of temporary attachments.
| filename | filename with full path |
Definition at line 1294 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void mutt_temp_attachments_cleanup | ( | struct ListHead * | list | ) |
Delete all temporary attachments.
| list | List of temporary attachment files |
Definition at line 1306 of file mutt_attach.c.
Here is the call graph for this function:
Here is the caller graph for this function: