+Thu Feb 03 17:22:48 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
+
+ * Applied wesley.craig@umich.edu's KPOP patches. According to him:
+
+ The following patch fixes a problem with requesting a
+ service key for a machine that has multiple 'A' records. It
+ also makes "-kpop" a command line option, for users who
+ would like to use both "kpop" and "pop".
+
+ Did no testing of the new features, as I don't have access to a
+ KPOP server.
+
+ * Modified inc.man and msgchk.man to document Wesley's new -kpop.
+
Fri Jan 28 17:39:24 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
* All %-escapes in mhn.defaults that actually expand to something
int pop_exists (int (*)());
#endif
-int pop_init (char *, char *, char *, int, int);
+int pop_init (char *, char *, char *, int, int, int);
int pop_fd (char *, int, char *, int);
int pop_stat (int *, int *);
int pop_retr (int, int (*)());
\%[\-user\ username]
\%[\-pack\ file]
\%[\-nopack]
+\%[\-kpop]
.br
%nmhendpop%
\%[\-version]
For debugging purposes, you may give the switch `\-snoop', which will
allow you to watch the POP transaction take place between you and the
POP server.
+
+If nmh has been compiled with KPOP #defined, but without POPSERVICE being set to
+"kpop", the -kpop switch may be specified to cause the use of Kerberized POP
+rather than standard POP3 during a given invocation of \fIinc\fR.
%nmhendpop%
.Fi
^$HOME/\&.mh\(ruprofile~^The user profile
%nmhbeginpop%
\%[\-host\ hostname]
\%[\-user\ username]
+\%[\-kpop]
.br
%nmhendpop%
\%[users\ ...]
For debugging purposes, there is also a switch `\-snoop', which will
allow you to watch the POP transaction take place between you and the
POP server.
+
+If nmh has been compiled with KPOP #defined, but without POPSERVICE being set to
+"kpop", the -kpop switch may be specified to cause the use of Kerberized POP
+rather than standard POP3 during a given invocation of \fImsgchk\fR.
%nmhendpop%
.Fi
^$HOME/\&.mh\(ruprofile~^The user profile
# 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 },
{ "help", 4 },
#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 (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 */
# define APOPminc(a) 0
#endif
+#ifndef KPOP
+# define KPOPminc(a) (a)
+#else
+# define KPOPminc(a) 0
+#endif
+
static struct swit switches[] = {
#define DATESW 0
{ "date", 0 },
{ "help", 4 },
#define SNOOPSW 12
{ "snoop", -5 },
+#define KPOPSW 13
+ { "kpop", KPOPminc (-4) },
{ NULL, 0 }
};
static int checkmail (char *, char *, int, int, int);
#ifdef POP
-static int remotemail (char *, char *, int, int, int, int);
+static int remotemail (char *, char *, int, int, int, int, int);
#endif
{
int datesw = 1, notifysw = NT_ALL;
int rpop, status = 0;
+ int kpop = 0;
int snoop = 0, vecp = 0;
uid_t uid;
char *cp, *host = NULL, *user, buf[BUFSIZ];
snoop++;
#endif
-#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;
#ifdef POP
if (host) {
if (vecp == 0) {
- status = remotemail (host, user, rpop, notifysw, 1, snoop);
+ status = remotemail (host, user, rpop, kpop, notifysw, 1, snoop);
} else {
for (vecp = 0; vec[vecp]; vecp++)
- status += remotemail (host, vec[vecp], rpop, notifysw, 0, snoop);
+ status += remotemail (host, vec[vecp], rpop, kpop, notifysw, 0, snoop);
}
} else {
#endif /* POP */
extern char response[];
static int
-remotemail (char *host, char *user, int rpop, int notifysw, int personal, int snoop)
+remotemail (char *host, char *user, int rpop, int kpop, int notifysw, int personal, int snoop)
{
int nmsgs, nbytes, status;
char *pass = NULL;
if (user == NULL)
user = getusername ();
- if (rpop > 0)
+ if (kpop || (rpop > 0))
pass = getusername ();
else
ruserpass (host, &user, &pass);
/* open the POP connection */
- if (pop_init (host, user, pass, snoop, rpop) == NOTOK
+ if (pop_init (host, user, pass, snoop, kpop ? 1 : rpop, kpop) == NOTOK
|| pop_stat (&nmsgs, &nbytes) == NOTOK /* check for messages */
|| pop_quit () == NOTOK) { /* quit POP connection */
advise (NULL, "%s", response);
int
-pop_init (char *host, char *user, char *pass, int snoop, int rpop)
+pop_init (char *host, char *user, char *pass, int snoop, int rpop, int kpop)
{
int fd1, fd2;
char buffer[BUFSIZ];
#endif
#ifndef NNTP
-# ifndef KPOP
- if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK)
-# else /* KPOP */
- snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, POPSERVICE);
- if ((fd1 = client (host, "tcp", buffer, rpop, response, sizeof(response))) == NOTOK)
-# endif
+# ifdef KPOP
+ if ( kpop ) {
+ snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, "kpop");
+ if ((fd1 = client (host, "tcp", buffer, 0, response, sizeof(response))) == NOTOK) {
+ return NOTOK;
+ }
+ } else {
+# endif /* KPOP */
+ if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK)
+ return NOTOK;
+# ifdef KPOP
+ }
+# endif /* KPOP */
#else /* NNTP */
if ((fd1 = client (host, "tcp", "nntp", rpop, response, sizeof(response))) == NOTOK)
-#endif
return NOTOK;
+#endif
if ((fd2 = dup (fd1)) == NOTOK) {
char *s;
#ifdef KPOP
int rem;
+ struct hostent *hp2;
#endif /* KPOP */
for (ap = nets; ap < n1; ap++)
if (kservice) { /* "pop" */
char *instance;
- if ((instance = strdup (hp->h_name)) == NULL) {
+ if (( hp2 = gethostbyaddr( hp->h_addr, hp->h_length, hp->h_addrtype ))
+ == NULL ) {
+ return NOTOK;
+ }
+ if ((instance = strdup (hp2->h_name)) == NULL) {
close (sd);
strncpy (response, "Out of memory.", len_response);
return OOPS2;