summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>1999-12-10 09:53:01 +0000
committerGerd Moellmann <gerd@gnu.org>1999-12-10 09:53:01 +0000
commitc4503297e041774c5f1cb3ad77532771e1a285b4 (patch)
treeb9062a6e26c173e9823849eca622ae4775a6d878 /lib-src
parenta5311bf08cdc4f236b75e192e589870e801103a4 (diff)
downloademacs-c4503297e041774c5f1cb3ad77532771e1a285b4.tar.gz
(popmail): Allow mailbox specifications of the
form `po:username:hostname'.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/movemail.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index df5cb5a2d1f..ed13e9f6be8 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -685,8 +685,20 @@ char ibuffer[BUFSIZ];
char obuffer[BUFSIZ];
char Errmsg[80];
-popmail (user, outfile, preserve, password, reverse_order)
- char *user;
+/*
+ * The full legal syntax for a POP mailbox specification for movemail
+ * is "po:username:hostname". The ":hostname" is optional; if it is
+ * omitted, the MAILHOST environment variable will be consulted. Note
+ * that by the time popmail() is called the "po:" has been stripped
+ * off of the front of the mailbox name.
+ *
+ * If the mailbox is in the form "po:username:hostname", then it is
+ * modified by this function -- the second colon is replaced by a
+ * null.
+ */
+
+popmail (mailbox, outfile, preserve, password, reverse_order)
+ char *mailbox;
char *outfile;
int preserve;
char *password;
@@ -699,8 +711,13 @@ popmail (user, outfile, preserve, password, reverse_order)
char *getenv ();
popserver server;
int start, end, increment;
+ char *user, *hostname;
+
+ user = mailbox;
+ if ((hostname = index(mailbox, ':')))
+ *hostname++ = '\0';
- server = pop_open (0, user, password, POP_NO_GETPASS);
+ server = pop_open (hostname, user, password, POP_NO_GETPASS);
if (! server)
{
error ("Error connecting to POP server: %s", pop_error);