tweak sendmail and makemime help texts

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2009-07-05 21:46:37 +02:00
parent fe4ef36bcd
commit 666e1d3978
2 changed files with 78 additions and 13 deletions

View File

@ -2541,12 +2541,17 @@
#define makemime_trivial_usage \ #define makemime_trivial_usage \
"[OPTIONS] [FILE]..." "[OPTIONS] [FILE]..."
#define makemime_full_usage "\n\n" \ #define makemime_full_usage "\n\n" \
"Create MIME-encoded message\n" \ "Create multipart MIME-encoded message from FILEs.\n" \
/* "Transfer encoding is base64, disposition is inline (not attachment)\n" */ \
"\nOptions:" \ "\nOptions:" \
"\n -C Charset" \ "\n -o FILE Output. Default: stdout" \
"\n -e Transfer encoding. Ignored. base64 is assumed" \ "\n -a HDR Add header. Examples:" \
"\n \"From: user@host.org\", \"Date: `date -R`\"" \
"\n -c CT Content type. Default: text/plain" \
"\n -C CS Charset. Default: " CONFIG_FEATURE_MIME_CHARSET \
/* "\n -e ENC Transfer encoding. Ignored. base64 is assumed" */ \
"\n" \ "\n" \
"\nOther options are silently ignored." \ "\nOther options are silently ignored" \
#define man_trivial_usage \ #define man_trivial_usage \
"[OPTIONS] [MANPAGE]..." "[OPTIONS] [MANPAGE]..."
@ -3776,17 +3781,17 @@
#define selinuxenabled_full_usage "" #define selinuxenabled_full_usage ""
#define sendmail_trivial_usage \ #define sendmail_trivial_usage \
"[OPTIONS] [rcpt]..." "[OPTIONS] [RECIPIENT_EMAIL]..."
#define sendmail_full_usage "\n\n" \ #define sendmail_full_usage "\n\n" \
"Send an email\n" \ "Read email from stdin and send it\n" \
"\nStandard options:" \ "\nStandard options:" \
"\n -t Read recipients from message body, add them to those on cmdline" \ "\n -t Read additional recipients from message body" \
"\n -f sender Sender. REQUIRED!" \ "\n -f sender Sender (required)" \
"\n -o options various options. -oi IMPLIED! others are IGNORED!" \ "\n -o options Various options. -oi implied, others are ignored" \
"\n" \ "\n" \
"\nBusybox specific options:" \ "\nBusybox specific options:" \
"\n -w seconds Network timeout" \ "\n -w seconds Network timeout" \
"\n -H 'prog args' Run connection helper" \ "\n -H 'PROG ARGS' Run connection helper" \
"\n Examples:" \ "\n Examples:" \
"\n -H 'exec openssl s_client -quiet -tls1 -starttls smtp" \ "\n -H 'exec openssl s_client -quiet -tls1 -starttls smtp" \
"\n -connect smtp.gmail.com:25' <email.txt" \ "\n -connect smtp.gmail.com:25' <email.txt" \
@ -3797,9 +3802,12 @@
"\n -S server[:port] Server" \ "\n -S server[:port] Server" \
"\n -au<username> Username for AUTH LOGIN" \ "\n -au<username> Username for AUTH LOGIN" \
"\n -ap<password> Password for AUTH LOGIN" \ "\n -ap<password> Password for AUTH LOGIN" \
"\n -am<method> Authentication method. Ignored. login is implied." \ "\n -am<method> Authentication method. Ignored. LOGIN is implied" \
"\n" \ "\n" \
"\nOther options are silently ignored; -oi -t is implied" \ "\nOther options are silently ignored; -oi -t is implied" \
IF_MAKEMIME( \
"\nUse makemime applet to create message with attachments" \
)
#define seq_trivial_usage \ #define seq_trivial_usage \
"[-w] [-s SEP] [FIRST [INC]] LAST" "[-w] [-s SEP] [FIRST [INC]] LAST"

View File

@ -35,12 +35,68 @@ Options:
-c auto to set Content-Type: to text/plain or -c auto to set Content-Type: to text/plain or
application/octet-stream based on picked encoding. application/octet-stream based on picked encoding.
-j file1 file2 - join mime section file2 to multipart section file1. -j file1 file2 - join mime section file2 to multipart section file1.
-o file - write ther result to file, instead of stdout (not -o file - write the result to file, instead of stdout (not
allowed in child processes). allowed in child processes).
-a header - prepend an additional header to the output. -a header - prepend an additional header to the output.
@file - read all of the above options from file, one option or @file - read all of the above options from file, one option or
value on each line. value on each line.
{which version of makemime is this? What do we support?}
*/
/* In busybox 1.15.0.svn, makemime generates output like this
* (empty lines are shown exactly!):
{headers added with -a HDR}
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="24269534-2145583448-1655890676"
--24269534-2145583448-1655890676
Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii}
Content-Disposition: inline; filename="A"
Content-Transfer-Encoding: base64
...file A contents...
--24269534-2145583448-1655890676
Content-Type: {set by -c, e.g. text/plain}; charset={set by -C, e.g. us-ascii}
Content-Disposition: inline; filename="B"
Content-Transfer-Encoding: base64
...file B contents...
--24269534-2145583448-1655890676--
*/
/* For reference: here is an example email to LKML which has
* 1st unnamed part (so it serves as an email body)
* and one attached file:
...other headers...
Content-Type: multipart/mixed; boundary="=-tOfTf3byOS0vZgxEWcX+"
...other headers...
Mime-Version: 1.0
...other headers...
--=-tOfTf3byOS0vZgxEWcX+
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
...email text...
...email text...
--=-tOfTf3byOS0vZgxEWcX+
Content-Disposition: attachment; filename="xyz"
Content-Type: text/plain; name="xyz"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
...file contents...
...file contents...
--=-tOfTf3byOS0vZgxEWcX+--
...random junk added by mailing list robots and such...
*/ */
int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int makemime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@ -86,7 +142,8 @@ int makemime_main(int argc UNUSED_PARAM, char **argv)
// make a random string -- it will delimit message parts // make a random string -- it will delimit message parts
srand(monotonic_us()); srand(monotonic_us());
boundary = xasprintf("%d-%d-%d", rand(), rand(), rand()); boundary = xasprintf("%u-%u-%u",
(unsigned)rand(), (unsigned)rand(), (unsigned)rand());
// put multipart header // put multipart header
printf( printf(