path: root/NEWS
diff options
authorSergey Poznyakoff <>2017-01-13 14:45:09 +0200
committerSergey Poznyakoff <>2017-01-14 00:08:52 +0200
commiteabddf8f5f18afddc13281a5fbaa562f75e76b5f (patch)
treef50191fdbba7ca5b7b7d297e6c0fa93e077f57fd /NEWS
parent0c76b2b1a4325a8e96292161ee95523ecb6cbc14 (diff)
mail: new options to read attachments from file descriptors
* mail/mail.c (default_encoding,default_content_type) (content_name,content_filename): New statics. (cli_attach): Use the value of --content-name option as the content-type name parameter. The "-" argument instructs the program to read attachment from stdin (eqv --attach-fd=0) (cli_attach_fd): New function. (mail_options): New options: --content-name, --content-filename, --attach-fd * mail/mail.h (send_attach_file_default): Remove. (send_attach_file): New proto. * mail/send.c (atchinfo): New fields: id, name, source. (atchinfo_free): Update. (default_encoding,default_content_type): Remove globals. (send_attach_file): Rewrite. (send_attach_file_default): Remove. (escape_list_attachments): Print attachment identifier instead of the file name, which can be NULL. (saveatt): Use mu_attachment_create and mu_attachment_copy_from_stream. * NEWS: Update. * doc/texinfo/programs.texi: Document the new options.
Diffstat (limited to 'NEWS')
1 files changed, 49 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 90ac1884c..79d09c5fe 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU mailutils NEWS -- history of user-visible changes. 2016-12-17
+GNU mailutils NEWS -- history of user-visible changes. 2017-01-13
Copyright (C) 2002-2017 Free Software Foundation, Inc.
See the end of file for copying conditions.
@@ -7,6 +7,54 @@ Please send mailutils bug reports to <>.
Version 3.1.90 (Git)
+* mail
+** Modifying attachment name and filename
+Two new options are provided for modifying attachment name (a.k.a
+description), and file name:
+ --content-name=STRING
+ Sets the attachment name (description). Technically speaking, it
+ is the "name" parameter in the Content-Type MIME header.
+ --content-filename=NAME
+ Sets the file name (the "filename" parameter in the
+ Content-Description MIME header of the outgoing message.
+Both options affect only the next `--attach' or `--attach-fd' option.
+* Constructing attachments from command line
+The new option `--attach-fd=N' instructs mail to read attachment from
+file descriptor N. By default, the attachments created using this
+option are unnamed, i.e. neither name parameter of the Content-Type
+header, nor the filename parameter of the Content-Disposition header
+are set. Use the --content-name and --content-filename options to
+change these.
+The option `--attach-fd=0' causes attachment to be read from the
+standard input. The option `--attach=-' has the same effect. For
+obvious reasons, the interactive mode is suppressed in this case.
+The `--attach-fd' option is useful when calling `mail' from another
+Suppose that the 'mail' binary is opened at file descriptor 5 and
+the mail.c file is opened at descriptor 6, the following command
+line sends them as attachments:
+ mail --encoding=base64 \
+ --content-type=application/octet-stream \
+ --content-name="the mail(1) binary" --content-filename="mail" \
+ --attach-fd=5 \
+ --encoding=binary\
+ --content-type=text/plain --content-name="mail.c source file"\
+ --content-filename=mail.c --attach-fd=6 \
Version 3.1.1 - 2016-12-15

Return to:

Send suggestions and report system problems to the System administrator.