Commit d98d211d authored by Eric S. Raymond's avatar Eric S. Raymond

This is what I sent Harris.

svn path=/trunk/; revision=9
parent 62a66ecb
......@@ -3,6 +3,9 @@
# Carl Harris, [email protected]
#
# $Log: Makefile.in,v $
# Revision 1.2 1996/06/26 19:08:55 esr
# This is what I sent Harris.
#
# Revision 1.1 1996/06/25 14:29:44 esr
# Initial revision
#
......@@ -97,16 +100,14 @@ ETAGS = etags -tw
CTAGS = ctags -tw
objs = socket.o getpass.o pop2.o pop3.o popclient.o options.o \
poprc_l.o poprc_y.o poprc.o xmalloc.o \
poprc_l.o poprc_y.o poprc.o daemon.o xmalloc.o \
$(EXTRAOBJ) $(extras)
srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
$(srcdir)/pop3.c $(srcdir)/popclient.c $(srcdir)/options.c \
$(srcdir)/poprc_l.c $(srcdir)/poprc_y.c $(srcdir)/poprc.c \
$(srcdir)/xmalloc.c \
$(srcdir)/poprc.c $(srcdir)/daemon.c $(srcdir)/xmalloc.c \
$(EXTRASRC)
.SUFFIXES:
.SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
......@@ -160,7 +161,7 @@ MAKE = make
FORCE:
tagsrcs = $(srcs)
tagsrcs = $(srcs) $(srcdir)/poprc_l.c $(srcdir)/poprc_y.c
TAGS: $(tagsrcs)
$(ETAGS) $(tagsrcs)
tags: $(tagsrcs)
......@@ -200,7 +201,7 @@ $(mandir)/$(instname).$(manext): popclient.man
.PHONY: clean realclean distclean mostlyclean
clean:
-rm -f popclient *.o core popclient.dvi \
poprc_l.c poprc_y.h poprc_y.c
poprc_l.c poprc_y.h poprc_y.c popclient.tar popclient.tar.gz
distclean: clean
-rm -f Makefile config.h
......@@ -232,6 +233,26 @@ configure: configure.in
$(srcdir)/poprc_l.c: $(srcdir)/poprc_l.l
$(srcdir)/poprc_y.c: $(srcdir)/poprc_y.y
parser = $(srcdir)/poprc_l.l $(srcdir)/poprc_y.y
headers = $(srcdir)/popclient.h $(srcdir)/socket.h $(srcdir)/poproto.h
extra = $(srcdir)/alloca.c $(srcdir)/bzero.[ch] $(srcdir)/errorcodes \
$(srcdir)/getopt.[ch] $(srcdir)/getopt1.c $(srcdir)/md5*.[ch] \
$(srcdir)/strcasecmp.c $(srcdir)/strdup.c
docs = $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/RFC/*.txt \
$(srcdir)/*.man $(srcdir)/*.texi $(srcdir)/*.info \
$(srcdir)/sample.poprc $(srcdir)/TODO
config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/config.guess \
$(srcdir)/config.h.in $(srcdir)/config.sub
scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs
all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts)
manifest:
@echo $(all) | tr "[ \t]" '\n' | sort
popclient.tar: $(all)
tar -cf popclient.tar $(all)
popclient.tar.gz: popclient.tar
gzip -f popclient.tar
# The automatically generated dependencies below may omit config.h
# because it is included with ``#include <config.h>'' rather than
......
Popclient README
$Log: README,v $
Revision 1.2 1996/06/26 19:08:55 esr
This is what I sent Harris.
Revision 1.1 1996/06/26 15:27:06 esr
Initial revision
......@@ -19,6 +22,94 @@ be a "developer/tester" release only.
Release History
3.0b7:
Eric S. Raymond <[email protected]> hacked on 3.0b6. Here are his change notes:
CONFIGURATION AND BUILDING
* The autoconfigure script incorrectly assumed that all Linuxes use
/usr/bin/deliver. Under Linux it now checks for both /usr/bin/delivermail
and /bin/mail.
* I added a distribution-maker production to Makefile.in.
OPTIONS AND COMMAND LINE
* I have removed the -p command-line option. Given that there's a .poprc
facility there is no excuse for encouraging users to put plaintext passwords
in scripts which might be readable.
* Calling popclient with no arguments now causes it to query or operate
on every host in the .poprc file.
* I have made --version more useful by having it dump the computed
connection options for each server specified.
* The user can now explicitly set an MDA (such as procmail) with the
new option -m or -mda. Various possible MDAs are listed on the man page.
POPRC FILE SYNTAX
* The .poprc lexer now supports "-enclosed strings which may contain
whitespace.
* I added a --yydebug option to enable .poprc parser debugging at runtime
if the parser was generated with --debug. It's not documented.
* You may now have a `defaults' entry in .poprc which sets overrideable
values for other entries. See the man page for details.
* It is now possible to set keep, flush and fetchall in your .poprc file.
* Fixed incorrect numbering of source lines in .poprc parse error messages.
* The configure.in specification no longer uses the obsolete AC_TRY_COMPILE
macro (it uses AC_TRY_LINK instead).
MAILBOX LOCKING
* I have added mandatory locking of mailbox files where supported.
This will cover Linux systems, in particular.
* The default behavior is now to do lock-protected append on the user's
system mailbox rather than using delivermail or some other MDA.
(This is a performance hack.)
* The autoconfigure script now looks for standard mail locations. The
default mail delivery agent is used only if it can't find a mail spool
directory in the standard places.
FUNCTIONAL ENHANCEMENTS
* When using POP3, message headers are edited so that replies won't foo up.
Anything that looks like a mail ID local to the POP host gets @ and the
pop servername attached to it before being appended to the user's
mailbox or passed to an MDA.
* I have implemented daemon mode.
DOCUMENTATION
* All changes and feature additions have been tested in actual use and are
documented on the man page.
* I have turned the comments in the sample.poprc into a new manual
section documenting the .poprc format.
MISCELLANEOUS BUG FIXES
* I fixed some de-initialization bugs in pop2.c and pop3.c that led to
fd leaks (these became painfully obvious when I tested daemon mode!).
* I've fixed the flaky parser error messages. They turned out to be due
to a misdeclaration of yytext.
There's only one feature I haven't been able to add successfully. I
want a --logfile option that redirects the daemon-mode output to a
given file, but the code (in daemon.c near 200) unaccountably doesn't
work (so I haven't documented it yet).
3.0b5
o "From " header fix in pop2.c and pop3.c
o Surpress "..." output when --stdout option specified in pop3.c
......
......@@ -4,6 +4,9 @@ dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl $Log: configure.in,v $
dnl Revision 1.2 1996/06/26 19:08:56 esr
dnl This is what I sent Harris.
dnl
dnl Revision 1.1 1996/06/24 20:43:13 esr
dnl Initial revision
dnl
......@@ -51,43 +54,56 @@ test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
AC_CANONICAL_HOST
AC_MSG_CHECKING(system mailbox directory)
if test -d /var/mail
then
AC_DEFINE(USERFOLDER, "/var/mail/%s")
userfolder='/var/mail/$u'
elif test -d /usr/mail
then
AC_DEFINE(USERFOLDER, "/usr/mail/%s")
userfolder='/usr/mail/$u'
elif test -d /usr/spool/mail
then
AC_DEFINE(USERFOLDER, "/usr/spool/mail/%s")
userfolder='/usr/spool/mail/$u'
elif test -d /var/spool/mail
then
AC_DEFINE(USERFOLDER, "/var/spool/mail/%s")
userfolder='/var/mail/$u'
else
userfolder="can't find one, will fall back on system MDA."
fi
AC_MSG_RESULT($userfolder)
AC_MSG_CHECKING(delivery agent for $host)
case $host in
*-*-*bsd*)
AC_DEFINE(MDA_PATH,"/usr/libexec/mail.local")
AC_DEFINE(MDA_ALIAS,"mail.local")
AC_DEFINE(MDA_ARGS,"$u")
AC_DEFINE(DEF_MDA,"/usr/libexec/mail.local %s")
mdacmd="/usr/libexec/mail.local \$u"
;;
*-*-linux*)
AC_DEFINE(MDA_PATH,"/usr/bin/deliver")
AC_DEFINE(MDA_ALIAS,"deliver")
AC_DEFINE(MDA_ARGS,"$u")
mdacmd="/usr/bin/deliver \$u"
;;
*-*-aix*)
AC_DEFINE(MDA_PATH,"/usr/bin/bellmail")
AC_DEFINE(MDA_ALIAS,"bellmail")
AC_DEFINE(MDA_ARGS,"$u")
AC_DEFINE(DEF_MDA,"/usr/bin/bellmail %s")
mdacmd="/usr/bin/bellmail \$u"
;;
*-*-hpux*)
AC_DEFINE(MDA_PATH,"/bin/rmail")
AC_DEFINE(MDA_ALIAS,"rmail")
AC_DEFINE(MDA_ARGS,"-d $u")
AC_DEFINE(DEF_MDA,"/bin/rmail -d %s")
mdacmd="/bin/rmail -d \$u"
;;
# default case assumes /bin/mail is an MDA -- may LOSE mail on
# systems where it is not an MDA.
*)
AC_DEFINE(MDA_PATH,"/bin/mail")
AC_DEFINE(MDA_ALIAS,"mail")
AC_DEFINE(MDA_ARGS,"-d $u")
mdacmd="/bin/mail -d \$u"
if test -x "/usr/bin/deliver %s"
then
AC_DEFINE(DEF_MDA,"/usr/bin/deliver %s")
mdacmd="/usr/bin/deliver \$u"
else
# default case assumes /bin/mail is an MDA -- may LOSE mail on
# systems where it is not an MDA.
AC_DEFINE(DEF_MDA,"/bin/mail -d %s")
mdacmd="/bin/mail -d \$u"
fi
;;
esac
AC_MSG_RESULT($mdacmd)
......@@ -156,7 +172,7 @@ dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs
AC_SUBST(EXTRASRC)
AC_SUBST(EXTRAOBJ)
AC_CHECK_FUNCS(dup2 strerror tcsetattr stty setsid)
AC_CHECK_FUNCS(dup2 strerror tcsetattr stty setsid flock)
dnl AC_FUNC_SETVBUF_REVERSED
......@@ -183,7 +199,8 @@ AC_TRY_COMPILE([],
dnl Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
AC_COMPILE_CHECK(union wait, [#include <sys/types.h>
AC_MSG_CHECKING(for union wait);
AC_TRY_LINK([#include <sys/types.h>
#include <sys/wait.h>],
[union wait status; int pid; pid = wait (&status);
#ifdef WEXITSTATUS
......@@ -197,19 +214,20 @@ if (WEXITSTATUS (status) != 0) pid = -1;
pid = waitpid (-1, &status, 0);
#endif
],
AC_DEFINE(HAVE_UNION_WAIT))
[AC_DEFINE(HAVE_UNION_WAIT) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h,
[#include <signal.h>
AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h)
AC_TRY_LINK([#include <signal.h>
/* NetBSD declares sys_siglist in <unistd.h>. */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif], [char *msg = *(sys_siglist + 1);],
AC_DEFINE(SYS_SIGLIST_DECLARED))
[AC_DEFINE(SYS_SIGLIST_DECLARED) AC_MSG_RESULT(yes)],
AC_MSG_RESULT(no))
# The presence of the following is not meant to imply
# that necessarily works on those systems.
# that popclient necessarily works on those systems.
dnl AC_DYNIX_SEQ
dnl AC_XENIX_DIR
dnl AC_IRIX_SUN
......
......@@ -25,6 +25,9 @@
BSD systems.
$Log: daemon.c,v $
Revision 1.2 1996/06/26 19:08:57 esr
This is what I sent Harris.
Revision 1.1 1996/06/25 14:32:01 esr
Initial revision
......@@ -98,7 +101,7 @@ sigchld_handler ()
become process group leader of our own process group,
and set up to catch child process termination signals.
arguments:
options command-line options.
logfile file to direct stdout and stderr to, if non-NULL.
ret. value: none.
globals: refers to the address of sigchld_handler().
......@@ -106,12 +109,12 @@ sigchld_handler ()
*****************************************************************/
int
daemonize (options)
struct optrec *options;
daemonize (logfile)
const char *logfile;
{
int fd;
pid_t childpid;
RETSIGTYPE sigchild_handler();
RETSIGTYPE sigchld_handler();
/* if we are started by init (process 1) via /etc/inittab we needn't
bother to detach from our process group context */
......@@ -195,13 +198,15 @@ nottyDetach:
return(PS_IOERR);
}
if (dup(fd) < 0) { /* stdout */
log_perror("dup");
return(PS_IOERR);
}
if (logfile)
open(logfile, O_CREAT|O_WRONLY, 0777); /* stdout */
else
if (dup(fd) < 0) { /* stdout */
perror("dup");
return(PS_IOERR);
}
if (dup(fd) < 0) { /* stderr */
log_perror("dup");
perror("dup");
return(PS_IOERR);
}
......@@ -216,6 +221,6 @@ nottyDetach:
#endif
/* set up to catch child process termination signals */
signal(SIGCLD, sigchild_handler);
signal(SIGCLD, sigchld_handler);
}
This diff is collapsed.
......@@ -23,6 +23,9 @@
description: global constant, type, and variable definitions.
$Log: fetchmail.h,v $
Revision 1.2 1996/06/26 19:08:59 esr
This is what I sent Harris.
Revision 1.1 1996/06/24 18:14:08 esr
Initial revision
......@@ -67,10 +70,11 @@
#define POPBUFSIZE 512 /* per RFC 937 */
#define MSGBUFSIZE 1024 /* size of message read buffer */
#define HOSTLEN 128 /* max hostname length */
#define USERIDLEN 32 /* max user-length */
#define USERNAMELEN 32 /* max user-length */
#define PASSWORDLEN MAX_PASSWORD_LENGTH
#define FOLDERLEN 256 /* max folder name length */
#define DIGESTLEN 33 /* length of MD5 digest */
#define MDALEN 33 /* length of delivery agent command */
/* exit code values */
#define PS_SUCCESS 0 /* successful receipt of messages */
......@@ -88,10 +92,10 @@
#define O_NORMAL 1 /* user-friendly */
#define O_VERBOSE 2 /* excessive */
/* output folder type, used in options record */
#define OF_SYSMBOX 1 /* use system default mailbox */
#define OF_USERMBOX 2 /* use user's specified mailbox */
#define OF_STDOUT 3 /* use stdout */
/* output sink type */
#define TO_FOLDER 1 /* use a mailbox */
#define TO_STDOUT 2 /* use stdout */
#define TO_MDA 3 /* use agent */
/* Command-line arguments are passed in this structure type */
struct optrec {
......@@ -103,16 +107,17 @@ struct optrec {
int limit;
int fetchall;
int flush;
int foldertype;
char loginid [USERIDLEN];
int output;
char loginid [USERNAMELEN];
char *poprcfile;
char userid [USERIDLEN];
char username [USERNAMELEN];
char password [PASSWORDLEN];
#if defined(HAVE_APOP_SUPPORT)
char digest [DIGESTLEN];
#endif
char userfolder [FOLDERLEN];
char remotefolder [FOLDERLEN];
char mda [MDALEN];
};
......@@ -123,12 +128,23 @@ struct prc_server {
char *username;
char *password;
char *remotefolder;
char *localfolder;
char *userfolder;
char *mda;
int keep;
int flush;
int fetchall;
};
/* Controls the detail of status/progress messages written to stderr */
extern int outlevel; /* see the O_.* constants above */
extern int outlevel; /* see the O_.* constants above */
extern int yydebug; /* enable parse debugging */
/* daemon mode control */
extern int poll_interval; /* poll interval in seconds */
extern char *logfile; /* log file for daemon mode */
extern char *prc_pathname; /* path name of rc file */
#ifdef HAVE_PROTOTYPES
......@@ -145,12 +161,18 @@ int openmailpipe (struct optrec *options);
int closemailpipe (int fd);
char *MD5Digest (char *);
char *prc_getpathname (struct optrec *cmd_opts, struct optrec *def_opts);
void reply_hack(char *buf, const char *host);
void append_server_names(int *pargc, char **argv);
int daemonize(const char *logfile);
#else
char *getnextserver();
char *MD5Digest ();
char *prc_getpathname();
void reply_hack ();
void append_server_names ();
int daemonize ();
#endif
This diff is collapsed.
......@@ -22,6 +22,9 @@
description: command-line option processing
$Log: options.c,v $
Revision 1.2 1996/06/26 19:08:57 esr
This is what I sent Harris.
Revision 1.1 1996/06/24 18:11:08 esr
Initial revision
......@@ -80,12 +83,13 @@
#define LA_DAEMON 11
#define LA_POPRC 12
#define LA_USERNAME 13
#define LA_PASSWORD 14
#define LA_REMOTEFILE 15
#define LA_LOCALFILE 16
#define LA_REMOTEFILE 14
#define LA_LOCALFILE 15
#define LA_MDA 16
#define LA_LOGFILE 17
#define LA_YYDEBUG 18
static char *shortoptions = "23VaKkvscl:Fd:f:u:p:r:o:";
static char *shortoptions = "23VaKkvscl:Fd:f:u:r:o:m:";
static struct option longoptions[] = {
{"version", no_argument, (int *) 0, LA_VERSION },
{"all", no_argument, (int *) 0, LA_ALL },
......@@ -102,9 +106,11 @@ static struct option longoptions[] = {
{"poprc", required_argument, (int *) 0, LA_POPRC },
{"user", required_argument, (int *) 0, LA_USERNAME },
{"username", required_argument, (int *) 0, LA_USERNAME },
{"password", required_argument, (int *) 0, LA_PASSWORD },
{"remote", required_argument, (int *) 0, LA_REMOTEFILE },
{"local", required_argument, (int *) 0, LA_LOCALFILE },
{"mda", required_argument, (int *) 0, LA_MDA },
{"logfile", required_argument, (int *) 0, LA_LOGFILE },
{"yydebug", no_argument, (int *) 0, LA_YYDEBUG },
{(char *) 0, no_argument, (int *) 0, 0 }
};
......@@ -187,7 +193,7 @@ struct optrec *options;
errflag++;
else {
fflag++;
options->foldertype = OF_STDOUT;
options->output = TO_STDOUT;
}
break;
case 'l':
......@@ -221,7 +227,7 @@ struct optrec *options;
break;
case 'd':
case LA_DAEMON:
fprintf(stderr,"Got daemonize option with argument '%s'\n",optarg);
poll_interval = atoi(optarg);
break;
case 'f':
case LA_POPRC:
......@@ -230,13 +236,7 @@ struct optrec *options;
break;
case 'u':
case LA_USERNAME:
strncpy(options->userid,optarg,sizeof(options->userid)-1);
break;
case 'p':
case LA_PASSWORD:
strncpy(options->password,optarg,sizeof(options->password)-1);
for (i = strlen(options->password)-1; i >= 0; i--)
argv[optind-1][i] = '*';
strncpy(options->username,optarg,sizeof(options->username)-1);
break;
case 'o':
case LA_LOCALFILE:
......@@ -244,7 +244,7 @@ struct optrec *options;
errflag++;
else {
fflag++;
options->foldertype = OF_USERMBOX;
options->output = TO_FOLDER;
strncpy(options->userfolder,optarg,sizeof(options->userfolder)-1);
}
break;
......@@ -252,24 +252,25 @@ struct optrec *options;
case LA_REMOTEFILE:
strncpy(options->remotefolder,optarg,sizeof(options->remotefolder)-1);
break;
case 'm':
case LA_MDA:
strncpy(options->mda,optarg,sizeof(options->mda)-1);
break;
case 'L':
case LA_LOGFILE:
logfile = optarg;
break;
case LA_YYDEBUG:
yydebug = 1;
break;
default:
errflag++;
}
}
if (!options->versioninfo)
/* if options don't obviate the need, we must have server name(s)
left on the command line. */
if (optind >= argc)
errflag++;
else
;
else
optind = 0;
if (errflag) {
/* squawk if syntax errors were detected */
fputs("usage: popclient [options] server [server ...]\n", stderr);
fputs("usage: popclient [options] [server ...]\n", stderr);
fputs(" options\n",stderr);
fputs(" -2 use POP2 protocol\n", stderr);
fputs(" -3 use POP3 protocol\n", stderr);
......@@ -281,15 +282,16 @@ struct optrec *options;
fputs(" -K, --kill delete new messages after retrieval\n", stderr);
fputs(" -k, --keep save new messages after retrieval\n", stderr);
fputs(" -l, --limit retrieve at most n message lines\n", stderr);
fputs(" -m, --mda set mail user agent to pass to\n", stderr);
fputs(" -s, --silent work silently\n", stderr);
fputs(" -v, --verbose work noisily (diagnostic output)\n", stderr);
fputs(" -d, --daemon run as a daemon\n", stderr);
fputs(" -d, --daemon run as a daemon once per n seconds\n", stderr);
fputs(" -f, --poprc specify alternate config file\n", stderr);
fputs(" -u, --username specify server user ID\n", stderr);
fputs(" -p, --password specify server password\n", stderr);
fputs(" -c, --stdout write received mail to stdout\n", stderr);
fputs(" -o, --local specify filename for received mail\n", stderr);
fputs(" -r, --remote specify remote folder name\n", stderr);
fputs(" -L, --logfile specify logfile name\n", stderr);
return(-1);
}
else {
......@@ -332,7 +334,6 @@ struct optrec *options;
strcpy(options->loginid,pw->pw_name);
options->whichpop = DEF_PROTOCOL;
options->foldertype = OF_SYSMBOX;
#if defined(KEEP_IS_DEFAULT)
options->keep = 1;
......@@ -340,7 +341,16 @@ struct optrec *options;
options->keep = 0;
#endif
strcpy(options->userid,pw->pw_name);
strcpy(options->username,pw->pw_name);
#if defined(USERFOLDER) && defined(HAVE_FLOCK)
options->output = TO_FOLDER;
sprintf(options->userfolder, USERFOLDER, options->username);
#else
options->output = TO_MDA;
#endif
(void) sprintf(options->mda, DEF_MDA, options->username);
options->poprcfile =
(char *) xmalloc(strlen(pw->pw_dir)+strlen(POPRC_NAME)+2);
......
......@@ -23,6 +23,9 @@
description: POP2 client code.
$Log: pop2.c,v $
Revision 1.2 1996/06/26 19:08:57 esr
This is what I sent Harris.
Revision 1.1 1996/06/24 19:00:51 esr
Initial revision
......@@ -142,21 +145,23 @@ struct optrec *options;
}
/* open/lock the folder if it is a user folder or stdout */
if (options->foldertype != OF_SYSMBOX)
if (options->output == TO_FOLDER)
if ((mboxfd = openuserfolder(options)) < 0)
return(PS_IOERR);
/* wait for the POP2 greeting */
if (POP2_stateGREET(socket) != 0) {
POP2_quit(socket);
return(PS_PROTOCOL);
status = PS_PROTOCOL;
goto closeUp;
}
/* log the user onto the server */
POP2_sendHELO(options->userid,options->password,socket);
POP2_sendHELO(options->username,options->password,socket);
if ((number = POP2_stateNMBR(socket)) < 0) {
POP2_quit(socket);
return(PS_AUTHFAIL);
status = PS_AUTHFAIL;
goto closeUp;
}
/* set the remote folder if selected */
......@@ -164,7 +169,8 @@ struct optrec *options;
POP2_sendFOLD(options->remotefolder,socket);
if ((number = POP2_stateNMBR(socket)) < 0) {
POP2_quit(socket);
return(PS_PROTOCOL);
status = PS_PROTOCOL;
goto closeUp;
}
}
......@@ -182,7 +188,7 @@ struct optrec *options;
while (msgsize > 0) {
/* open the pipe */
if (options->foldertype == OF_SYSMBOX)
if (options->output == TO_MDA)
if ((mboxfd = openmailpipe(options)) < 0) {
POP2_quit(socket);
return(PS_IOERR);
......@@ -190,7 +196,7 @@ struct optrec *options;
POP2_sendcmd("RETR",socket);
actsize = POP2_stateXFER(msgsize,socket,mboxfd,
options->foldertype == OF_SYSMBOX);
options->output == TO_MDA);
if (actsize == msgsize)
if (options->keep)
POP2_sendcmd("ACKS",socket);
......@@ -200,14 +206,16 @@ struct optrec *options;
POP2_sendcmd("NACK",socket);
else {
POP2_quit(socket);
return(PS_SOCKET);
status = PS_SOCKET;
goto closeUp;
}
/* close the pipe */
if (options->foldertype == OF_SYSMBOX)
if (options->output == TO