X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fsend.c;h=514f0731ea5e251c624c66804238918772904096;hp=ec81aaa2eb58d2f822c68b2ffc52759f26bf55ca;hb=4885712264980e6cbc2039f9158027bee9213475;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/send.c b/uip/send.c index ec81aaa..514f073 100644 --- a/uip/send.c +++ b/uip/send.c @@ -102,6 +102,8 @@ static struct swit switches[] = { { "saslmech", SASLminc(-5) }, #define USERSW 39 { "user", SASLminc(-4) }, +#define ATTACHSW 40 + { "attach", 6 }, { NULL, 0 } }; @@ -127,7 +129,6 @@ extern char *altmsg; /* .. */ extern char *annotext; extern char *distfile; -extern int errno; int main (int argc, char **argv) @@ -140,6 +141,7 @@ main (int argc, char **argv) char *msgs[MAXARGS], *vec[MAXARGS]; struct msgs *mp; struct stat st; + char *attach = (char *)0; /* header field name for attachments */ #ifdef UCI FILE *fp; #endif /* UCI */ @@ -273,6 +275,11 @@ main (int argc, char **argv) adios (NULL, "missing argument to %s", argp[-2]); vec[vecp++] = cp; continue; + + case ATTACHSW: + if (!(attach = *argp++) || *attach == '-') + adios (NULL, "missing argument to %s", argp[-2]); + continue; } } else { msgs[msgp++] = cp; @@ -436,7 +443,7 @@ go_to_it: closefds (3); for (msgnum = 0; msgnum < msgp; msgnum++) { - switch (sendsbr (vec, vecp, msgs[msgnum], &st, 1)) { + switch (sendsbr (vec, vecp, msgs[msgnum], &st, 1, attach)) { case DONE: done (++status); case NOTOK: