diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-11-19 14:43:02 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-11-19 14:43:02 +0100 |
| commit | fc186711fe75cfc4abda9a7ff29050bc7a56313b (patch) | |
| tree | fd0355365355f6ab9cd36e8ecb16cd9518ea1369 /mailutils | |
| parent | 3bc4fc5857e2daba601442f95771a590bce915bc (diff) | |
| download | busybox-w32-fc186711fe75cfc4abda9a7ff29050bc7a56313b.tar.gz busybox-w32-fc186711fe75cfc4abda9a7ff29050bc7a56313b.tar.bz2 busybox-w32-fc186711fe75cfc4abda9a7ff29050bc7a56313b.zip | |
makemime: document our current behavior. Tweak help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'mailutils')
| -rw-r--r-- | mailutils/makemime.c | 29 | ||||
| -rw-r--r-- | mailutils/reformime.c | 1 |
2 files changed, 25 insertions, 5 deletions
diff --git a/mailutils/makemime.c b/mailutils/makemime.c index f1ef602a4..4b07e54de 100644 --- a/mailutils/makemime.c +++ b/mailutils/makemime.c | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* | 2 | /* |
| 3 | * makemime: create MIME-encoded message | 3 | * makemime: create MIME-encoded message |
| 4 | * reformime: parse MIME-encoded message | ||
| 5 | * | 4 | * |
| 6 | * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> | 5 | * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> |
| 7 | * | 6 | * |
| @@ -135,12 +134,35 @@ Content-Transfer-Encoding: 7bit | |||
| 135 | //usage: "\n -o FILE Output. Default: stdout" | 134 | //usage: "\n -o FILE Output. Default: stdout" |
| 136 | //usage: "\n -a HDR Add header. Examples:" | 135 | //usage: "\n -a HDR Add header. Examples:" |
| 137 | //usage: "\n \"From: user@host.org\", \"Date: `date -R`\"" | 136 | //usage: "\n \"From: user@host.org\", \"Date: `date -R`\"" |
| 138 | //usage: "\n -c CT Content type. Default: text/plain" | 137 | //usage: "\n -c CT Content type. Default: application/octet-stream" |
| 139 | //usage: "\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET | 138 | //usage: "\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET |
| 140 | /* //usage: "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ | 139 | /* //usage: "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ |
| 141 | //usage: "\n" | 140 | //usage: "\n" |
| 142 | //usage: "\nOther options are silently ignored" | 141 | //usage: "\nOther options are silently ignored" |
| 143 | 142 | ||
| 143 | /* | ||
| 144 | * -c [Content-Type] should create just one MIME section | ||
| 145 | * with "Content-Type:", "Content-Transfer-Encoding:", and HDR from "-a HDR". | ||
| 146 | * NB: without "Content-Disposition:" auto-added, unlike we do now | ||
| 147 | * NB2: -c has *optional* param which nevertheless _can_ be specified after a space :( | ||
| 148 | * | ||
| 149 | * -m [multipart/mixed] should create multipart MIME section | ||
| 150 | * with "Content-Type:", "Content-Transfer-Encoding:", and HDR from "-a HDR", | ||
| 151 | * and add FILE to it _verbatim_: | ||
| 152 | * HEADERS | ||
| 153 | * | ||
| 154 | * --=_1_1321709112_1605 | ||
| 155 | * FILE_CONTENTS | ||
| 156 | * --=_1_1321709112_1605 | ||
| 157 | * without any encoding of FILE_CONTENTS. (Basically, it expects that FILE | ||
| 158 | * is the result of "makemime -c"). | ||
| 159 | * | ||
| 160 | * -j MULTIPART_FILE1 SINGLE_FILE2 should output MULTIPART_FILE1 + SINGLE_FILE2 | ||
| 161 | * | ||
| 162 | * Our current behavior is a mutant "-m + -c + -j" one: we create multipart MIME | ||
| 163 | * and we put "-c" encoded FILEs into many multipart sections. | ||
| 164 | */ | ||
| 165 | |||
| 144 | int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 166 | int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| 145 | int makemime_main(int argc UNUSED_PARAM, char **argv) | 167 | int makemime_main(int argc UNUSED_PARAM, char **argv) |
| 146 | { | 168 | { |
| @@ -148,7 +170,6 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
| 148 | const char *opt_output; | 170 | const char *opt_output; |
| 149 | const char *content_type = "application/octet-stream"; | 171 | const char *content_type = "application/octet-stream"; |
| 150 | #define boundary opt_output | 172 | #define boundary opt_output |
| 151 | |||
| 152 | enum { | 173 | enum { |
| 153 | OPT_c = 1 << 0, // create (non-multipart) section | 174 | OPT_c = 1 << 0, // create (non-multipart) section |
| 154 | OPT_e = 1 << 1, // Content-Transfer-Encoding. Ignored. Assumed base64 | 175 | OPT_e = 1 << 1, // Content-Transfer-Encoding. Ignored. Assumed base64 |
| @@ -165,7 +186,7 @@ int makemime_main(int argc UNUSED_PARAM, char **argv) | |||
| 165 | // parse options | 186 | // parse options |
| 166 | opt_complementary = "a::"; | 187 | opt_complementary = "a::"; |
| 167 | opts = getopt32(argv, | 188 | opts = getopt32(argv, |
| 168 | "c:e:o:C:N:a:", //:m:j:", | 189 | "c:e:o:C:N:a:", // "m:j:", |
| 169 | &content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL | 190 | &content_type, NULL, &opt_output, &G.opt_charset, NULL, &opt_headers //, NULL, NULL |
| 170 | ); | 191 | ); |
| 171 | //argc -= optind; | 192 | //argc -= optind; |
diff --git a/mailutils/reformime.c b/mailutils/reformime.c index 5e28ef729..8e7d455f6 100644 --- a/mailutils/reformime.c +++ b/mailutils/reformime.c | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* | 2 | /* |
| 3 | * makemime: create MIME-encoded message | ||
| 4 | * reformime: parse MIME-encoded message | 3 | * reformime: parse MIME-encoded message |
| 5 | * | 4 | * |
| 6 | * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> | 5 | * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> |
