X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/301196a95d7490b1d9178aa27036c9ae5f865868..8664e81329d0811d0b0f35521a850b74ac276da3:/uip/inc.c diff --git a/uip/inc.c b/uip/inc.c index 12da6ba1..3d0830e5 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -46,6 +46,8 @@ # define SASLminc(a) 0 #endif +extern m_getfld_state_t gstate; + static struct swit switches[] = { #define AUDSW 0 { "audit audit-file", 0 }, @@ -89,9 +91,11 @@ static struct swit switches[] = { { "snoop", -5 }, #define SASLSW 20 { "sasl", SASLminc(-4) }, -#define SASLMECHSW 21 +#define NOSASLSW 21 + { "nosasl", SASLminc(-6) }, +#define SASLMECHSW 22 { "saslmech", SASLminc(-8) }, -#define PROXYSW 22 +#define PROXYSW 23 { "proxy command", 0 }, { NULL, 0 } }; @@ -359,6 +363,9 @@ main (int argc, char **argv) case SASLSW: sasl++; continue; + case NOSASLSW: + sasl = 0; + continue; case SASLMECHSW: if (!(saslmech = *argp++) || *saslmech == '-') @@ -582,6 +589,8 @@ go_to_it: fflush (stdout); } + m_getfld_state_init (&gstate); + /* * Get the mail from a POP server */ @@ -715,7 +724,7 @@ go_to_it: * Get the mail from file (usually mail spool) */ if (inc_type == INC_FILE && Maildir == NULL) { - m_unknown (in); /* the MAGIC invocation... */ + m_unknown (gstate, in); /* the MAGIC invocation... */ hghnum = msgnum = mp->hghmsg; for (;;) { /* @@ -729,19 +738,6 @@ go_to_it: break; } -#if 0 - /* copy file from spool to tmp file */ - tmpfilenam = m_scratch ("", invo_name); - if ((fd = creat (tmpfilenam, m_gmprot ())) == NOTOK) - adios (tmpfilenam, "unable to create"); - chmod (tmpfilenam, m_gmprot ()); - if (!(in2 = fdopen (fd, "r+"))) - adios (tmpfilenam, "unable to access"); - cpymsg (in, in2); - - /* link message into folder */ - newmsg = folder_addmsg(mp, tmpfilenam); -#endif /* create scanline for new message */ switch (incerr = scan (in, msgnum + 1, msgnum + 1, nfs, width, msgnum == hghnum && chgflag, 1, NULL, 0L, noisy)) { @@ -895,6 +891,8 @@ go_to_it: free (Maildir); /* From now on Maildir is just a flag - don't dref! */ } + m_getfld_state_destroy (&gstate); + if (incerr < 0) { /* error */ if (locked) { GETGROUPPRIVS(); /* Be sure we can unlock mail file */ @@ -970,39 +968,6 @@ go_to_it: } -#if 0 - -/* - * Copy message message from spool into - * temporary file. Massage the "From " line - * while copying. - */ - -cpymsg (FILE *in, FILE *out) -{ - int state; - char *tmpbuf, name[NAMESZ]; - - for (;;) { - state = m_getfld (state, name, tmpbuf, rlwidth, in); - switch (state) { - case FLD: - case FLDPLUS: - break; - case BODY: - break; - case LENERR: - case FMTERR: - break; - case FILEEOF: - break; - default: - } - } -} -#endif /* if 0 */ - - static void inc_done (int status) {