# HG changeset patch # User Gerd Moellmann # Date 944819581 0 # Node ID 535af4b150592d33669547f481b2c803d9f8bdbb # Parent ddb7b0201ffb54d26f0428fdbf42aed5a02d1665 (popmail): Allow mailbox specifications of the form `po:username:hostname'. diff -r ddb7b0201ffb -r 535af4b15059 lib-src/movemail.c --- a/lib-src/movemail.c Fri Dec 10 08:55:12 1999 +0000 +++ b/lib-src/movemail.c Fri Dec 10 09:53:01 1999 +0000 @@ -685,8 +685,20 @@ 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 @@ char *getenv (); popserver server; int start, end, increment; + char *user, *hostname; - server = pop_open (0, user, password, POP_NO_GETPASS); + user = mailbox; + if ((hostname = index(mailbox, ':'))) + *hostname++ = '\0'; + + server = pop_open (hostname, user, password, POP_NO_GETPASS); if (! server) { error ("Error connecting to POP server: %s", pop_error);