[PATCH] sendmail/ssmtp applet

Natanael copa natanael.copa at gmail.com
Thu Aug 2 04:42:46 UTC 2007


Hi,

Here is a crude sendmail applet based on ssmtp:
http://dev.alpinelinux.org/~ncopa/busybox-initial-sendmail.patch

(It is bigger than 40k so I was not allowed to post it on the mailing list)

It is an initial version but I post it anyway so experienced busybox'ers
can give hits and give the opportunity for volunteers (with more time
than me) to continue work on it.

Some issues I saw while preparing it:
* fix Copyright
* fix include files
* we will probably never want ssl support so that part can simply be
cutted
* argument parsing could use getopt32
* unused options could be cutted. Maybe have an config option for
sendmail compatibility.
* bool_t should be bool
* many of the global bool vars can be compressed into a "flags" variable
where every bool represent a bit.
* base64 code can probably be reuse from previous busybox code.
* md5 auth?
* logging could be handled with something from libbb?

I'm sure there are more things. The size is not too bad anyway and it
can only become smaller from here :-)

I do intend to fix those things (if there are enough interest) but by
posting it here early i give interested ppl a chance to give a hand.


function                                             old     new   delta
ssmtp                                                  -    2962   +2962
sendmail_main                                          -    1160   +1160
die                                                    -     565    +565
header_parse                                           -     545    +545
smtp_write                                             -     352    +352
rcpt_parse                                             -     334    +334
smtp_open                                              -     240    +240
log_event                                              -     223    +223
to64frombits                                           -     222    +222
TimeoutJmpBuf                                          -     200    +200
smtp_read                                              -     183    +183
paq                                                    -     161    +161
append_domain                                          -     152    +152
addr_parse                                             -     141    +141
packed_usage                                         318     446    +128
standardise                                            -      90     +90
rcpt_remap                                             -      84     +84
base64digits                                           -      65     +65
hostname                                               -      64     +64
strip_post_ws                                          -      37     +37
strip_pre_ws                                           -      32     +32
arpadate                                               -      32     +32
smtp_okay                                              -      20     +20
handler                                                -      19     +19
rcpt_list                                              -      16     +16
headers                                                -      16     +16
applets                                               48      64     +16
uad                                                    -       8      +8
static.stdin@@GLIBC_2                                  -       8      +8
rt                                                     -       8      +8
root                                                   -       8      +8
minus_f                                                -       8      +8
minus_F                                                -       8      +8
mailhost                                               -       8      +8
ht                                                     -       8      +8
gecos                                                  -       8      +8
from                                                   -       8      +8
auth_user                                              -       8      +8
auth_pass                                              -       8      +8
auth_method                                            -       8      +8
static.Version                                         -       7      +7
use_starttls                                           -       4      +4
port                                                   -       4      +4
override_from                                          -       4      +4
minus_v                                                -       4      +4
minus_t                                                -       4      +4
log_level                                              -       4      +4
have_from                                              -       4      +4
have_date                                              -       4      +4
------------------------------------------------------------------------------
(add/remove: 47/0 grow/shrink: 2/0 up/down: 8202/0)          Total: 8202
bytes
   text    data     bss     dec     hex filename
  14827     816    8280   23923    5d73 busybox_old
  27764    1155    8728   37647    930f busybox_unstripped



Natanael Copa




More information about the busybox mailing list