diff options
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | fetchmail.h | 5 | ||||
| -rw-r--r-- | options.c | 7 | ||||
| -rw-r--r-- | pop3.c | 20 | ||||
| -rw-r--r-- | rcfile_l.l | 1 | ||||
| -rw-r--r-- | rcfile_y.y | 6 | 
6 files changed, 33 insertions, 9 deletions
@@ -1,5 +1,8 @@  				Release Notes: +fetchmail-4.5.6 (): +* SDPS support, experimental version 2.  Requires configure --enable-SDPS. +  fetchmail-4.5.5 (Mon Aug  3 16:08:14 EDT 1998):  * Brendan Cully's FAQ entry on GSSAPI.  * Andrew Cagney's improvement to Received-line parsing. diff --git a/fetchmail.h b/fetchmail.h index 7b1e7300..aa1c1215 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -142,7 +142,10 @@ struct hostdata		/* shared among all user connections to given server */      flag skip;				/* suppress poll in implicit mode? */      flag dns;				/* do DNS lookup on multidrop? */      flag uidl;				/* use RFC1725 UIDLs? */ -    flag checkalias;                  /* try to resolve aliases by comparing IPs ?*/ +#ifdef SDPS_ENABLE +    flag sdps;				/* use Demon Internet SDPS *ENV */ +#endif /* SDPS_ENABLE */ +    flag checkalias;                  	/* resolve aliases by comparing IPs? */  #ifdef linux @@ -285,6 +285,13 @@ struct query *ctl;	/* option record to be initialized */  	    /* XXX -- should probably use a table lookup here */  	    if (strcasecmp(optarg,"pop2") == 0)  		ctl->server.protocol = P_POP2; +#ifdef SDPS_ENABLE +	    else if (strcasecmp(optarg,"sdps") == 0) +	    { +	        ctl->server.protocol = P_POP3;  +                ctl->server.sdps = TRUE; +	    } +#endif /* SDPS_ENABLE */  	    else if (strcasecmp(optarg,"pop3") == 0)  		ctl->server.protocol = P_POP3;  	    else if (strcasecmp(optarg,"apop") == 0) @@ -120,7 +120,14 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting)       * If we see either, and we're in multidrop mode, try to use       * the SDPS *ENV extension.       */ -    sdps_enable = MULTIDROP(ctl) && strstr(greeting, "demon."); +    sdps_enable = (MULTIDROP(ctl) && strstr(greeting, "demon.")); +    /* +     * Use SDPS if configured, regardless of the greeting string +     * returned from the POP server. (Users accessing demon by a +     * POP3 proxy may need this) +     */ +    if (ctl->server.sdps) +        sdps_enable = ctl->server.sdps;  #endif /* SDPS_ENABLE */      switch (ctl->server.protocol) { @@ -543,22 +550,21 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)      if (sdps_enable)      {  	int	linecount = 0; -  	sdps_envto = (char *)NULL;  	gen_send(sock, "*ENV %d", number);  	do {  	    if (gen_recv(sock, buf, sizeof(buf))) +	    {  		break; +	    }  	    linecount++; -	    if (buf[0] == '-' || strncmp(buf , "+OK", 3)) -		break; -	    if (linecount == 4) +	    if (linecount == 5)  	    { -		sdps_envto = strdup(buf); +		sdps_envto = strdup(buf);   		error(0, 0, "*ENV returned envelope address %s");  	    }  	} while -	    (buf[0] != '.' && (buf[1] == '\r' || buf[1] == '\n')); +	    (buf[0] !='.');      }  #endif /* SDPS_ENABLE */ @@ -97,6 +97,7 @@ options		{/* EMPTY */}  (auto)|(AUTO)	{ yylval.proto = P_AUTO;  return PROTO; }  (pop2)|(POP2)	{ yylval.proto = P_POP2;  return PROTO; } +(sdps)|(SDPS)   { return SDPS; }  (pop3)|(POP3)	{ yylval.proto = P_POP3;  return PROTO; }  (imap-k4)|(IMAP-K4)   { yylval.proto = P_IMAP_K4;  return PROTO; }  (imap-gss)|(IMAP-GSS) { yylval.proto = P_IMAP_GSS;  return PROTO; } @@ -58,7 +58,7 @@ extern char * yytext;  }  %token DEFAULTS POLL SKIP VIA AKA LOCALDOMAINS PROTOCOL -%token AUTHENTICATE TIMEOUT KPOP KERBEROS4 KERBEROS5 KERBEROS +%token AUTHENTICATE TIMEOUT KPOP SDPS KERBEROS4 KERBEROS5 KERBEROS  %token ENVELOPE QVIRTUAL USERNAME PASSWORD FOLDER SMTPHOST MDA SMTPADDRESS  %token SPAMRESPONSE PRECONNECT POSTCONNECT LIMIT  %token NETSEC INTERFACE MONITOR @@ -139,6 +139,10 @@ serv_option	: AKA alias_list  					    current.server.port = KPOP_PORT;  #endif /* INET6 */  					} +		| SDPS			{ +					    current.server.protocol = P_POP3; +					    current.server.sdps = TRUE; +					}  		| UIDL			{current.server.uidl = FLAG_TRUE;}  		| NO UIDL		{current.server.uidl  = FLAG_FALSE;}  		| CHECKALIAS            {current.server.checkalias = FLAG_TRUE;}  | 
