aboutsummaryrefslogtreecommitdiff
path: root/mailutils/mime.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-07-05 21:46:37 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-07-05 21:46:37 +0200
commit666e1d3978ebd2b72b18333f4face0e10cc816ba (patch)
tree05626b47c6a8a1a194b182baaabff1f587660508 /mailutils/mime.c
parentfe4ef36bcd660598cac4bdb5f428b3f0bdbc3fa3 (diff)
downloadbusybox-w32-666e1d3978ebd2b72b18333f4face0e10cc816ba.tar.gz
busybox-w32-666e1d3978ebd2b72b18333f4face0e10cc816ba.tar.bz2
busybox-w32-666e1d3978ebd2b72b18333f4face0e10cc816ba.zip
tweak sendmail and makemime help texts
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r--mailutils/mime.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/mailutils/mime.c b/mailutils/mime.c
index d309d7f7f..358f4e903 100644
--- a/mailutils/mime.c
+++ b/mailutils/mime.c
@@ -35,12 +35,68 @@ Options:
35 -c auto to set Content-Type: to text/plain or 35 -c auto to set Content-Type: to text/plain or
36 application/octet-stream based on picked encoding. 36 application/octet-stream based on picked encoding.
37 -j file1 file2 - join mime section file2 to multipart section file1. 37 -j file1 file2 - join mime section file2 to multipart section file1.
38 -o file - write ther result to file, instead of stdout (not 38 -o file - write the result to file, instead of stdout (not
39 allowed in child processes). 39 allowed in child processes).
40 -a header - prepend an additional header to the output. 40 -a header - prepend an additional header to the output.
41 41
42 @file - read all of the above options from file, one option or 42 @file - read all of the above options from file, one option or
43 value on each line. 43 value on each line.
44 {which version of makemime is this? What do we support?}
45*/
46
47
48/* In busybox 1.15.0.svn, makemime generates output like this
49 * (empty lines are shown exactly!):
50{headers added with -a HDR}
51Mime-Version: 1.0
52Content-Type: multipart/mixed; boundary="24269534-2145583448-1655890676"
53
54--24269534-2145583448-1655890676
55Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii}
56Content-Disposition: inline; filename="A"
57Content-Transfer-Encoding: base64
58
59...file A contents...
60--24269534-2145583448-1655890676
61Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii}
62Content-Disposition: inline; filename="B"
63Content-Transfer-Encoding: base64
64
65...file B contents...
66--24269534-2145583448-1655890676--
67
68*/
69
70
71/* For reference: here is an example email to LKML which has
72 * 1st unnamed part (so it serves as an email body)
73 * and one attached file:
74...other headers...
75Content-Type: multipart/mixed; boundary="=-tOfTf3byOS0vZgxEWcX+"
76...other headers...
77Mime-Version: 1.0
78...other headers...
79
80
81--=-tOfTf3byOS0vZgxEWcX+
82Content-Type: text/plain
83Content-Transfer-Encoding: 7bit
84
85...email text...
86...email text...
87
88
89--=-tOfTf3byOS0vZgxEWcX+
90Content-Disposition: attachment; filename="xyz"
91Content-Type: text/plain; name="xyz"; charset="UTF-8"
92Content-Transfer-Encoding: 7bit
93
94...file contents...
95...file contents...
96
97--=-tOfTf3byOS0vZgxEWcX+--
98
99...random junk added by mailing list robots and such...
44*/ 100*/
45 101
46int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 102int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -86,7 +142,8 @@ int makemime_main(int argc UNUSED_PARAM, char **argv)
86 142
87 // make a random string -- it will delimit message parts 143 // make a random string -- it will delimit message parts
88 srand(monotonic_us()); 144 srand(monotonic_us());
89 boundary = xasprintf("%d-%d-%d", rand(), rand(), rand()); 145 boundary = xasprintf("%u-%u-%u",
146 (unsigned)rand(), (unsigned)rand(), (unsigned)rand());
90 147
91 // put multipart header 148 // put multipart header
92 printf( 149 printf(