X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fsend.c;h=514f0731ea5e251c624c66804238918772904096;hp=bf689f0d4154aea72ea55ed56e23fb1d0aa1db8a;hb=4885712264980e6cbc2039f9158027bee9213475;hpb=cfc525a9b85207225cb4071d1d3b01e8d1db2424 diff --git a/uip/send.c b/uip/send.c index bf689f0..514f073 100644 --- a/uip/send.c +++ b/uip/send.c @@ -3,6 +3,10 @@ * send.c -- send a composed message * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include @@ -98,6 +102,8 @@ static struct swit switches[] = { { "saslmech", SASLminc(-5) }, #define USERSW 39 { "user", SASLminc(-4) }, +#define ATTACHSW 40 + { "attach", 6 }, { NULL, 0 } }; @@ -123,7 +129,6 @@ extern char *altmsg; /* .. */ extern char *annotext; extern char *distfile; -extern int errno; int main (int argc, char **argv) @@ -136,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 */ @@ -269,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; @@ -432,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: