#include <h/fmt_scan.h>
#include <h/scansbr.h>
#include <h/signals.h>
-#include <zotnet/tws/tws.h>
+#include <h/tws.h>
#include <zotnet/mts/mts.h>
#include <errno.h>
#include <signal.h>
# define APOPminc(a) 0
#endif
+#ifndef KPOP
+# define KPOPminc(a) (a)
+#else
+# define KPOPminc(a) 0
+#endif
+
static struct swit switches[] = {
#define AUDSW 0
{ "audit audit-file", 0 },
#define VERSIONSW 20
{ "version", 0 },
#define HELPSW 21
- { "help", 4 },
+ { "help", 0 },
#define SNOOPSW 22
{ "snoop", -5 },
+#define KPOPSW 23
+ { "kpop", KPOPminc (-4) },
{ NULL, 0 }
};
int chgflag = 1, trnflag = 1;
int noisy = 1, width = 0, locked = 0;
int rpop, i, hghnum, msgnum;
+ int kpop = 0;
char *cp, *maildir, *folder = NULL;
char *format = NULL, *form = NULL;
char *newmail, *host = NULL, *user = NULL;
snoop++;
#endif /* POP */
-#ifdef KPOP
- rpop = 1;
-#else
rpop = 0;
-#endif
while ((cp = *argp++)) {
if (*cp == '-') {
rpop = 0;
continue;
+ case KPOPSW:
+ kpop = 1;
+ continue;
+
case SNOOPSW:
snoop++;
continue;
if (inc_type == INC_POP) {
if (user == NULL)
user = getusername ();
- if (rpop > 0)
+ if ( strcmp( POPSERVICE, "kpop" ) == 0 ) {
+ kpop = 1;
+ }
+ if (kpop || ( rpop > 0))
pass = getusername ();
else
ruserpass (host, &user, &pass);
/*
* initialize POP connection
*/
- if (pop_init (host, user, pass, snoop, rpop) == NOTOK)
+ if (pop_init (host, user, pass, snoop, kpop ? 1 : rpop, kpop) == NOTOK)
adios (NULL, "%s", response);
/* Check if there are any messages */