X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fpopsbr.c;h=bfc39eaa5482f42e2516f26f887036acaac18a11;hp=f86d5d32c990f88b4c43c637cd540a6b2418bcdb;hb=0d1c5f533f3a6cd1c7f038f59585378f53b666c2;hpb=794dab6aa5027ffaf024506140c258f6a0a9322d diff --git a/uip/popsbr.c b/uip/popsbr.c index f86d5d3..bfc39ea 100644 --- a/uip/popsbr.c +++ b/uip/popsbr.c @@ -7,6 +7,9 @@ #include +extern int client(char *args, char *protocol, char *service, int rproto, + char *response, int len_response); + #if defined(NNTP) && !defined(PSHSBR) # undef NNTP #endif @@ -115,7 +118,7 @@ pop_auth (char *user, char *pass) int -pop_init (char *host, char *user, char *pass, int snoop, int rpop) +pop_init (char *host, char *user, char *pass, int snoop, int rpop, int kpop) { int fd1, fd2; char buffer[BUFSIZ]; @@ -128,16 +131,23 @@ pop_init (char *host, char *user, char *pass, int snoop, int rpop) #endif #ifndef NNTP -# ifndef KPOP - if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK) -# else /* KPOP */ - snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, POPSERVICE); - if ((fd1 = client (host, "tcp", buffer, rpop, response, sizeof(response))) == NOTOK) -# endif +# ifdef KPOP + if ( kpop ) { + snprintf (buffer, sizeof(buffer), "%s/%s", KPOP_PRINCIPAL, "kpop"); + if ((fd1 = client (host, "tcp", buffer, 0, response, sizeof(response))) == NOTOK) { + return NOTOK; + } + } else { +# endif /* KPOP */ + if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response, sizeof(response))) == NOTOK) + return NOTOK; +# ifdef KPOP + } +# endif /* KPOP */ #else /* NNTP */ if ((fd1 = client (host, "tcp", "nntp", rpop, response, sizeof(response))) == NOTOK) -#endif return NOTOK; +#endif if ((fd2 = dup (fd1)) == NOTOK) { char *s;