diff options
Diffstat (limited to 'mailutils/mime.c')
-rw-r--r-- | mailutils/mime.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/mailutils/mime.c b/mailutils/mime.c index 682cf4536..1e393ed31 100644 --- a/mailutils/mime.c +++ b/mailutils/mime.c | |||
@@ -99,6 +99,28 @@ Content-Transfer-Encoding: 7bit | |||
99 | ...random junk added by mailing list robots and such... | 99 | ...random junk added by mailing list robots and such... |
100 | */ | 100 | */ |
101 | 101 | ||
102 | /* man makemime: | ||
103 | |||
104 | * -c TYPE: create a (non-multipart) MIME section with Content-Type: TYPE | ||
105 | * makemime -c TYPE [-e ENCODING] [-o OUTFILE] [-C CHARSET] [-N NAME] [-a HEADER...] FILE | ||
106 | * The -C option sets the MIME charset attribute for text/plain content. | ||
107 | * The -N option sets the name attribute for Content-Type: | ||
108 | * Encoding must be one of the following: 7bit, 8bit, quoted-printable, or base64. | ||
109 | |||
110 | * -m multipart/TYPE: create a multipart MIME collection with Content-Type: multipart/TYPE | ||
111 | * makemime -m multipart/TYPE [-e ENCODING] [-o OUTFILE] [-a HEADER...] FILE | ||
112 | * Type must be either "multipart/mixed", "multipart/alternative", or some other MIME multipart content type. | ||
113 | * Additionally, encoding can only be "7bit" or "8bit", and will default to "8bit" if not specified. | ||
114 | * Finally, filename must be a MIME-formatted section, NOT a regular file. | ||
115 | * The -m option creates an initial multipart MIME collection, that contains only one MIME section, taken from filename. | ||
116 | * The collection is written to standard output, or the pipe or to outputfile. | ||
117 | |||
118 | * -j FILE1: add a section to a multipart MIME collection | ||
119 | * makemime -j FILE1 [-o OUTFILE] FILE2 | ||
120 | * FILE1 must be a MIME collection that was previously created by the -m option. | ||
121 | * FILE2 must be a MIME section that was previously created by the -c option. | ||
122 | * The -j options adds the MIME section in FILE2 to the MIME collection in FILE1. | ||
123 | */ | ||
102 | int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 124 | int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
103 | int makemime_main(int argc UNUSED_PARAM, char **argv) | 125 | int makemime_main(int argc UNUSED_PARAM, char **argv) |
104 | { | 126 | { |
@@ -107,14 +129,14 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
107 | #define boundary opt_output | 129 | #define boundary opt_output |
108 | 130 | ||
109 | enum { | 131 | enum { |
110 | OPT_c = 1 << 0, // Content-Type: | 132 | OPT_c = 1 << 0, // create (non-multipart) section |
111 | OPT_e = 1 << 1, // Content-Transfer-Encoding. Ignored. Assumed base64 | 133 | OPT_e = 1 << 1, // Content-Transfer-Encoding. Ignored. Assumed base64 |
112 | OPT_o = 1 << 2, // output to | 134 | OPT_o = 1 << 2, // output to |
113 | OPT_C = 1 << 3, // charset | 135 | OPT_C = 1 << 3, // charset |
114 | OPT_N = 1 << 4, // COMPAT | 136 | OPT_N = 1 << 4, // COMPAT |
115 | OPT_a = 1 << 5, // additional headers | 137 | OPT_a = 1 << 5, // additional headers |
116 | OPT_m = 1 << 6, // COMPAT | 138 | //OPT_m = 1 << 6, // create mutipart section |
117 | OPT_j = 1 << 7, // COMPAT | 139 | //OPT_j = 1 << 7, // join section to multipart section |
118 | }; | 140 | }; |
119 | 141 | ||
120 | INIT_G(); | 142 | INIT_G(); |
@@ -122,8 +144,8 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
122 | // parse options | 144 | // parse options |
123 | opt_complementary = "a::"; | 145 | opt_complementary = "a::"; |
124 | opts = getopt32(argv, | 146 | opts = getopt32(argv, |
125 | "c:e:o:C:N:a:m:j:", | 147 | "c:e:o:C:N:a", //:m:j:", |
126 | &G.content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers, NULL, NULL | 148 | &G.content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL |
127 | ); | 149 | ); |
128 | //argc -= optind; | 150 | //argc -= optind; |
129 | argv += optind; | 151 | argv += optind; |