Improve sendmail(1) argument processing..
commit964efea86b1fccf3bdf748ed91137f8e79928561
authorSteffen "Daode" Nurpmeso <sdaoden@users.sf.net>
Mon, 22 Oct 2012 20:52:26 +0000 (22 22:52 +0200)
committerSteffen "Daode" Nurpmeso <sdaoden@users.sf.net>
Thu, 25 Oct 2012 15:19:29 +0000 (25 17:19 +0200)
tree2a03994d2a7da0b90b785a79058b89aa4bfcdaca
parent53251d295b253473c5b63d17d6195c38b0219012
Improve sendmail(1) argument processing..

(Add -O option to pass options through to MTA.., 2012-06-30)
added -O as a general approach to pass options through to the
MTA, and (Fix what -r passes through to MTA.., 2012-09-18) added
the possibility to pass real names instead of plain addresses.

The entire mechanism that was implemented in nail(1) was however
broken, since someone decided to simply use struct name to hold
sendmail arguments, even though those are ment for header fields
(with addresses).
Also, in interactive sessions, the sendmail arguments given on
the command line would have been lost.

So change this a bit.
Throw away that terrible unpack(), that in addition existed in
names.c (but the entire source is such a mess that this is
a fuzzy comment).
Instead prepare a normal char** array of all sendmail(1) related
options from the command line, and export that via glob.h,
including the count of array members that are actually set.
Drop a lot of function arguments and the useless struct
header.h_smopts field accordingly.

We need to warp those smopts for each and every mail send
(interactive sessions should be possible now, too..), because
the user may change the values of *metoo* and *verbose* on the
fly though, and of course the recipient addresses change, too.

While here, improve main() look+feel a bit (IMHO).
It is still terrible, just like everything else.  ;
catd/en_US
def.h
extern.h
glob.h
main.c
names.c
sendout.c