X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fwhatnowsbr.c;h=ac9dc3a516790d7d565a2dc967a5b1b0573169eb;hb=703b7d98727c1f7e1e76434a04a3125d76d7d168;hp=723d40878785c38703c9bf5f789f0f5bfe4d181d;hpb=5dd6771b28c257af405d7248639ed0e3bcdce38b;p=mmh diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 723d408..ac9dc3a 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -409,6 +409,11 @@ WhatNow (int argc, char **argv) break; } + if (*(argp+1) == (char *)0) { + advise((char *)0, "attach command requires file argument(s)."); + break; + } + /* * Build a command line that causes the user's shell to list the file name * arguments. This handles and wildcard expansion, tilde expansion, etc. @@ -691,7 +696,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, context_save (); /* save the context file */ fflush (stdout); - switch (pid = vfork ()) { + switch (pid = vfork()) { case NOTOK: advise ("fork", "unable to"); status = NOTOK; @@ -721,13 +726,6 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, default: if ((status = pidwait (pid, NOTOK))) { -#ifdef ATTVIBUG - if ((cp = r1bindex (*ed, '/')) - && strcmp (cp, "vi") == 0 - && (status & 0x00ff) == 0) - status = 0; - else { -#endif if (((status & 0xff00) != 0xff00) && (!reedit || (status & 0x00ff))) { if (!use && (status & 0xff00) && @@ -739,9 +737,6 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, } status = -2; /* maybe "reedit ? -2 : -1"? */ break; -#ifdef ATTVIBUG - } -#endif } reedit++; @@ -1059,17 +1054,21 @@ static struct swit sendswitches[] = { { "nodraftfolder", -3 }, #define SASLSW 36 { "sasl", SASLminc(-4) }, -#define SASLMECHSW 37 +#define NOSASLSW 37 + { "nosasl", SASLminc(-6) }, +#define SASLMXSSFSW 38 + { "saslmaxssf", SASLminc(-10) }, +#define SASLMECHSW 39 { "saslmech", SASLminc(-5) }, -#define USERSW 38 +#define USERSW 40 { "user", SASLminc(-4) }, -#define SNDATTACHSW 39 +#define SNDATTACHSW 41 { "attach file", 6 }, -#define SNDATTACHFORMAT 40 +#define SNDATTACHFORMAT 42 { "attachformat", 7 }, -#define PORTSW 41 +#define PORTSW 43 { "port server-port-name/number", 4 }, -#define TLSSW 42 +#define TLSSW 44 { "tls", TLSminc(-3) }, { NULL, 0 } }; @@ -1102,9 +1101,6 @@ sendit (char *sp, char **arg, char *file, int pushed) #ifndef lint int distsw = 0; #endif -#ifdef UCI - FILE *fp; -#endif /* * Make sure these are defined. In particular, we need @@ -1152,6 +1148,16 @@ sendit (char *sp, char **arg, char *file, int pushed) vec[vecp++] = "-library"; vec[vecp++] = getcpy (m_maildir ("")); + if ((cp = context_find ("fileproc"))) { + vec[vecp++] = "-fileproc"; + vec[vecp++] = cp; + } + + if ((cp = context_find ("mhlproc"))) { + vec[vecp++] = "-mhlproc"; + vec[vecp++] = cp; + } + while ((cp = *argp++)) { if (*cp == '-') { switch (smatch (++cp, sendswitches)) { @@ -1225,6 +1231,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case SOMLSW: case SNOOPSW: case SASLSW: + case NOSASLSW: case TLSSW: vec[vecp++] = --cp; continue; @@ -1234,6 +1241,7 @@ sendit (char *sp, char **arg, char *file, int pushed) case WIDTHSW: case CLIESW: case SERVSW: + case SASLMXSSFSW: case SASLMECHSW: case USERSW: case PORTSW: @@ -1295,18 +1303,6 @@ sendit (char *sp, char **arg, char *file, int pushed) if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = context_find ("signature")) && *cp) m_putenv ("SIGNATURE", cp); -#ifdef UCI - else { - snprintf (buf, sizeof(buf), "%s/.signature", mypath); - if ((fp = fopen (buf, "r")) != NULL - && fgets (buf, sizeof(buf), fp) != NULL) { - fclose (fp); - if (cp = strchr (buf, '\n')) - *cp = 0; - m_putenv ("SIGNATURE", buf); - } - } -#endif /* UCI */ if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; @@ -1323,6 +1319,7 @@ sendit (char *sp, char **arg, char *file, int pushed) && altmsg) { vec[vecp++] = "-dist"; distfile = getcpy (m_mktemp2(altmsg, invo_name, NULL, NULL)); + unlink(distfile); if (link (altmsg, distfile) == NOTOK) adios (distfile, "unable to link %s to", altmsg); } else { @@ -1358,7 +1355,7 @@ whomfile (char **arg, char *file) context_save (); /* save the context file */ fflush (stdout); - switch (pid = vfork ()) { + switch (pid = vfork()) { case NOTOK: advise ("fork", "unable to"); return 1;