diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-05 21:46:37 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-05 21:46:37 +0200 |
commit | 666e1d3978ebd2b72b18333f4face0e10cc816ba (patch) | |
tree | 05626b47c6a8a1a194b182baaabff1f587660508 | |
parent | fe4ef36bcd660598cac4bdb5f428b3f0bdbc3fa3 (diff) | |
download | busybox-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>
-rw-r--r-- | include/usage.h | 32 | ||||
-rw-r--r-- | mailutils/mime.c | 61 |
2 files changed, 79 insertions, 14 deletions
diff --git a/include/usage.h b/include/usage.h index f65406254..4e055168e 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -2541,12 +2541,17 @@ | |||
2541 | #define makemime_trivial_usage \ | 2541 | #define makemime_trivial_usage \ |
2542 | "[OPTIONS] [FILE]..." | 2542 | "[OPTIONS] [FILE]..." |
2543 | #define makemime_full_usage "\n\n" \ | 2543 | #define makemime_full_usage "\n\n" \ |
2544 | "Create MIME-encoded message\n" \ | 2544 | "Create multipart MIME-encoded message from FILEs.\n" \ |
2545 | "\nOptions:" \ | 2545 | /* "Transfer encoding is base64, disposition is inline (not attachment)\n" */ \ |
2546 | "\n -C Charset" \ | 2546 | "\nOptions:" \ |
2547 | "\n -e Transfer encoding. Ignored. base64 is assumed" \ | 2547 | "\n -o FILE Output. Default: stdout" \ |
2548 | "\n -a HDR Add header. Examples:" \ | ||
2549 | "\n \"From: user@host.org\", \"Date: `date -R`\"" \ | ||
2550 | "\n -c CT Content type. Default: text/plain" \ | ||
2551 | "\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET \ | ||
2552 | /* "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ \ | ||
2548 | "\n" \ | 2553 | "\n" \ |
2549 | "\nOther options are silently ignored." \ | 2554 | "\nOther options are silently ignored" \ |
2550 | 2555 | ||
2551 | #define man_trivial_usage \ | 2556 | #define man_trivial_usage \ |
2552 | "[OPTIONS] [MANPAGE]..." | 2557 | "[OPTIONS] [MANPAGE]..." |
@@ -3776,17 +3781,17 @@ | |||
3776 | #define selinuxenabled_full_usage "" | 3781 | #define selinuxenabled_full_usage "" |
3777 | 3782 | ||
3778 | #define sendmail_trivial_usage \ | 3783 | #define sendmail_trivial_usage \ |
3779 | "[OPTIONS] [rcpt]..." | 3784 | "[OPTIONS] [RECIPIENT_EMAIL]..." |
3780 | #define sendmail_full_usage "\n\n" \ | 3785 | #define sendmail_full_usage "\n\n" \ |
3781 | "Send an email\n" \ | 3786 | "Read email from stdin and send it\n" \ |
3782 | "\nStandard options:" \ | 3787 | "\nStandard options:" \ |
3783 | "\n -t Read recipients from message body, add them to those on cmdline" \ | 3788 | "\n -t Read additional recipients from message body" \ |
3784 | "\n -f sender Sender. REQUIRED!" \ | 3789 | "\n -f sender Sender (required)" \ |
3785 | "\n -o options various options. -oi IMPLIED! others are IGNORED!" \ | 3790 | "\n -o options Various options. -oi implied, others are ignored" \ |
3786 | "\n" \ | 3791 | "\n" \ |
3787 | "\nBusybox specific options:" \ | 3792 | "\nBusybox specific options:" \ |
3788 | "\n -w seconds Network timeout" \ | 3793 | "\n -w seconds Network timeout" \ |
3789 | "\n -H 'prog args' Run connection helper" \ | 3794 | "\n -H 'PROG ARGS' Run connection helper" \ |
3790 | "\n Examples:" \ | 3795 | "\n Examples:" \ |
3791 | "\n -H 'exec openssl s_client -quiet -tls1 -starttls smtp" \ | 3796 | "\n -H 'exec openssl s_client -quiet -tls1 -starttls smtp" \ |
3792 | "\n -connect smtp.gmail.com:25' <email.txt" \ | 3797 | "\n -connect smtp.gmail.com:25' <email.txt" \ |
@@ -3797,9 +3802,12 @@ | |||
3797 | "\n -S server[:port] Server" \ | 3802 | "\n -S server[:port] Server" \ |
3798 | "\n -au<username> Username for AUTH LOGIN" \ | 3803 | "\n -au<username> Username for AUTH LOGIN" \ |
3799 | "\n -ap<password> Password for AUTH LOGIN" \ | 3804 | "\n -ap<password> Password for AUTH LOGIN" \ |
3800 | "\n -am<method> Authentication method. Ignored. login is implied." \ | 3805 | "\n -am<method> Authentication method. Ignored. LOGIN is implied" \ |
3801 | "\n" \ | 3806 | "\n" \ |
3802 | "\nOther options are silently ignored; -oi -t is implied" \ | 3807 | "\nOther options are silently ignored; -oi -t is implied" \ |
3808 | IF_MAKEMIME( \ | ||
3809 | "\nUse makemime applet to create message with attachments" \ | ||
3810 | ) | ||
3803 | 3811 | ||
3804 | #define seq_trivial_usage \ | 3812 | #define seq_trivial_usage \ |
3805 | "[-w] [-s SEP] [FIRST [INC]] LAST" | 3813 | "[-w] [-s SEP] [FIRST [INC]] LAST" |
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} | ||
51 | Mime-Version: 1.0 | ||
52 | Content-Type: multipart/mixed; boundary="24269534-2145583448-1655890676" | ||
53 | |||
54 | --24269534-2145583448-1655890676 | ||
55 | Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii} | ||
56 | Content-Disposition: inline; filename="A" | ||
57 | Content-Transfer-Encoding: base64 | ||
58 | |||
59 | ...file A contents... | ||
60 | --24269534-2145583448-1655890676 | ||
61 | Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii} | ||
62 | Content-Disposition: inline; filename="B" | ||
63 | Content-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... | ||
75 | Content-Type: multipart/mixed; boundary="=-tOfTf3byOS0vZgxEWcX+" | ||
76 | ...other headers... | ||
77 | Mime-Version: 1.0 | ||
78 | ...other headers... | ||
79 | |||
80 | |||
81 | --=-tOfTf3byOS0vZgxEWcX+ | ||
82 | Content-Type: text/plain | ||
83 | Content-Transfer-Encoding: 7bit | ||
84 | |||
85 | ...email text... | ||
86 | ...email text... | ||
87 | |||
88 | |||
89 | --=-tOfTf3byOS0vZgxEWcX+ | ||
90 | Content-Disposition: attachment; filename="xyz" | ||
91 | Content-Type: text/plain; name="xyz"; charset="UTF-8" | ||
92 | Content-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 | ||
46 | int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 102 | int 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( |