Article View: comp.mail.mh
Article #1892Re: Problem with POP mailer
From: Johan Widen
Date: Wed, 24 May 1989 23:47
Date: Wed, 24 May 1989 23:47
239 lines
7052 bytes
7052 bytes
>I am experiencing a problem using the pop daemon that comes with
>mh-6.6.
>
>The pop server is accepting connections properly, but it does not differentiate
>between mail messages properly. The entire contents of /usr/spool/mail
>is treated as one message.
I have just encountered the same problem. It turned out that enabling pop
without enabling DPOP would not work. You can fix the problems by
commenting out some of the #ifdef DPOP lines (together with the corresponding
#endif's), in support/pop/popser.c. I also discovered a null dereference
in support/pop/popwrd.c
I enclose a couple of diffs. Note that the my changes to popser.c are in
need of a cleanup, take the diff as a pointer to the trouble spots.
*** popwrd.c~ Fri Oct 30 00:02:01 1987
--- popwrd.c Mon May 22 16:44:49 1989
***************
*** 163,169 ****
for (; *ap; ap++)
fprintf (fp, "%s%s", ap != bb -> bb_aka ? "," : "", *ap);
fprintf (fp, ":%s:%s:", tail (bb -> bb_file), bb -> bb_passwd);
! if ((ap = bb -> bb_leader) != NULL
&& (strcmp (*ap, POPUID) != 0 || ap[1] != NULL))
for (; *ap; ap++)
fprintf (fp, "%s%s", ap != bb -> bb_leader ? "," : "", *ap);
--- 163,169 ----
for (; *ap; ap++)
fprintf (fp, "%s%s", ap != bb -> bb_aka ? "," : "", *ap);
fprintf (fp, ":%s:%s:", tail (bb -> bb_file), bb -> bb_passwd);
! if ((ap = bb -> bb_leader) != NULL && *ap
&& (strcmp (*ap, POPUID) != 0 || ap[1] != NULL))
for (; *ap; ap++)
fprintf (fp, "%s%s", ap != bb -> bb_leader ? "," : "", *ap);
*** popser.c.orig Fri Oct 30 00:01:59 1987
--- popser.c Mon May 22 22:17:38 1989
***************
*** 80,89 ****
/* */
! #ifdef DPOP
static int pop_uid;
static int pop_gid;
! #endif DPOP
static int rproto;
static char *hostname;
--- 80,89 ----
/* */
! /* #ifdef DPOP */
static int pop_uid;
static int pop_gid;
! /* #endif DPOP */
static int rproto;
static char *hostname;
***************
*** 227,235 ****
{
char buffer[BUFSIZ],
*vec[NVEC + 1];
! #if defined (DPOP) || defined (BPOP)
register struct passwd *pw;
! #endif defined (DPOP) || defined (BPOP)
register struct vector *v;
m_foil (NULLCP);
--- 227,235 ----
{
char buffer[BUFSIZ],
*vec[NVEC + 1];
! /* #if defined (DPOP) || defined (BPOP) */
register struct passwd *pw;
! /* #endif defined (DPOP) || defined (BPOP) */
register struct vector *v;
m_foil (NULLCP);
***************
*** 246,252 ****
}
(void) signal (SIGPIPE, pipeser);
! #ifdef DPOP
if ((pw = getpwnam (POPUID)) == NULL || !setpwinfo (pw, POPDB, 1)) {
(void) respond (NOTOK, "%s loses on DB initialization -- %s",
server, pw ? getbberr () : "POP user-id unknown");
--- 246,252 ----
}
(void) signal (SIGPIPE, pipeser);
! /* #ifdef DPOP */
if ((pw = getpwnam (POPUID)) == NULL || !setpwinfo (pw, POPDB, 1)) {
(void) respond (NOTOK, "%s loses on DB initialization -- %s",
server, pw ? getbberr () : "POP user-id unknown");
***************
*** 254,260 ****
}
pop_uid = pw -> pw_uid;
pop_gid = pw -> pw_gid;
! #endif DPOP
#ifdef BPOP
if ((pw = getpwnam (popbbuser)) && pw -> pw_uid) {
guest_uid = pw -> pw_uid;
--- 254,260 ----
}
pop_uid = pw -> pw_uid;
pop_gid = pw -> pw_gid;
! /* #endif DPOP */
#ifdef BPOP
if ((pw = getpwnam (popbbuser)) && pw -> pw_uid) {
guest_uid = pw -> pw_uid;
***************
*** 408,424 ****
static int rpop (vec)
register char **vec;
{
! #ifndef DPOP
register struct passwd *pw;
! #else DPOP
register int hostok = 0;
register char *bp,
*cp;
char buffer[BUFSIZ];
register struct bboard *pw;
! #endif DPOP
! #ifndef DPOP
if (!rproto || (pw = getpwnam (username)) == NULL) {
#ifdef TRUSTED
trusted (0, hostname, vec[1], 0, username, 0, "rpop", "tcp",
--- 408,424 ----
static int rpop (vec)
register char **vec;
{
! /* #ifndef DPOP
register struct passwd *pw;
! #else DPOP */
register int hostok = 0;
register char *bp,
*cp;
char buffer[BUFSIZ];
register struct bboard *pw;
! /* #endif DPOP */
! /* #ifndef DPOP
if (!rproto || (pw = getpwnam (username)) == NULL) {
#ifdef TRUSTED
trusted (0, hostname, vec[1], 0, username, 0, "rpop", "tcp",
***************
*** 435,441 ****
#endif TRUSTED
return respond (NOTOK, "permission denied");
}
! #else DPOP
if (!rproto
|| ((pw = getbbnam (username)) == NULL
&& (pw = getbbaka (username)) == NULL)) {
--- 435,441 ----
#endif TRUSTED
return respond (NOTOK, "permission denied");
}
! #else DPOP */
if (!rproto
|| ((pw = getbbnam (username)) == NULL
&& (pw = getbbaka (username)) == NULL)) {
***************
*** 467,481 ****
#endif TRUSTED
return respond (NOTOK, "permission denied");
}
! #endif DPOP
#ifdef TRUSTED
if (trusted (1, hostname, vec[1], 0, username,
! #ifndef DPOP
pw -> pw_uid == 0,
! #else DPOP
0,
! #endif DPOP
"rpop", "tcp", NULL)
== 0)
return respond (NOTOK, "permission denied");
--- 467,481 ----
#endif TRUSTED
return respond (NOTOK, "permission denied");
}
! /* #endif DPOP */
#ifdef TRUSTED
if (trusted (1, hostname, vec[1], 0, username,
! /* #ifndef DPOP
pw -> pw_uid == 0,
! #else DPOP */
0,
! /* #endif DPOP */
"rpop", "tcp", NULL)
== 0)
return respond (NOTOK, "permission denied");
***************
*** 502,516 ****
}
else {
#endif BPOP
! #ifndef DPOP
(void) setgid (pw -> pw_gid);
(void) initgroups (pw -> pw_name, pw -> pw_gid);
(void) setuid (pw -> pw_uid);
! #else DPOP
(void) setgid (pop_gid);
(void) initgroups (POPUID, pop_gid);
(void) setuid (pop_uid);
! #endif DPOP
#ifdef BPOP
}
#endif BPOP
--- 502,516 ----
}
else {
#endif BPOP
! /* #ifndef DPOP
(void) setgid (pw -> pw_gid);
(void) initgroups (pw -> pw_name, pw -> pw_gid);
(void) setuid (pw -> pw_uid);
! #else DPOP */
(void) setgid (pop_gid);
(void) initgroups (POPUID, pop_gid);
(void) setuid (pop_uid);
! /* #endif DPOP */
#ifdef BPOP
}
#endif BPOP
--
Johan Widen
SICS, PO Box 1263, S-164 28 KISTA, SWEDEN Internet: jw@sics.se
Tel: +46 8 752 15 32 Ttx: 812 61 54 SICS S Fax: +46 8 751 72 30
Technical Details
Message-ID:
<JW.89May25014710@echnaton.sics.se>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!kth!sunic!sics.se!jwReferences:
<3808@sdsu.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!kth!sunic!sics.se!jw From: jw@sics.se (Johan Widen) Newsgroups: comp.mail.mh Subject: Re: Problem with POP mailer Message-ID: <JW.89May25014710@echnaton.sics.se> Date: 24 May 89 23:47:10 GMT References: <3808@sdsu.UUCP> Sender: news@osiris.sics.se Organization: Swedish Institute of Computer Science, Kista Lines: 239 In-reply-to: arul@sdsu.UUCP's message of 23 May 89 19:05:40 GMT