head 1.6; access; symbols pkgsrc-2026Q1:1.6.0.114 pkgsrc-2026Q1-base:1.6 pkgsrc-2025Q4:1.6.0.112 pkgsrc-2025Q4-base:1.6 pkgsrc-2025Q3:1.6.0.110 pkgsrc-2025Q3-base:1.6 pkgsrc-2025Q2:1.6.0.108 pkgsrc-2025Q2-base:1.6 pkgsrc-2025Q1:1.6.0.106 pkgsrc-2025Q1-base:1.6 pkgsrc-2024Q4:1.6.0.104 pkgsrc-2024Q4-base:1.6 pkgsrc-2024Q3:1.6.0.102 pkgsrc-2024Q3-base:1.6 pkgsrc-2024Q2:1.6.0.100 pkgsrc-2024Q2-base:1.6 pkgsrc-2024Q1:1.6.0.98 pkgsrc-2024Q1-base:1.6 pkgsrc-2023Q4:1.6.0.96 pkgsrc-2023Q4-base:1.6 pkgsrc-2023Q3:1.6.0.94 pkgsrc-2023Q3-base:1.6 pkgsrc-2023Q2:1.6.0.92 pkgsrc-2023Q2-base:1.6 pkgsrc-2023Q1:1.6.0.90 pkgsrc-2023Q1-base:1.6 pkgsrc-2022Q4:1.6.0.88 pkgsrc-2022Q4-base:1.6 pkgsrc-2022Q3:1.6.0.86 pkgsrc-2022Q3-base:1.6 pkgsrc-2022Q2:1.6.0.84 pkgsrc-2022Q2-base:1.6 pkgsrc-2022Q1:1.6.0.82 pkgsrc-2022Q1-base:1.6 pkgsrc-2021Q4:1.6.0.80 pkgsrc-2021Q4-base:1.6 pkgsrc-2021Q3:1.6.0.78 pkgsrc-2021Q3-base:1.6 pkgsrc-2021Q2:1.6.0.76 pkgsrc-2021Q2-base:1.6 pkgsrc-2021Q1:1.6.0.74 pkgsrc-2021Q1-base:1.6 pkgsrc-2020Q4:1.6.0.72 pkgsrc-2020Q4-base:1.6 pkgsrc-2020Q3:1.6.0.70 pkgsrc-2020Q3-base:1.6 pkgsrc-2020Q2:1.6.0.66 pkgsrc-2020Q2-base:1.6 pkgsrc-2020Q1:1.6.0.46 pkgsrc-2020Q1-base:1.6 pkgsrc-2019Q4:1.6.0.68 pkgsrc-2019Q4-base:1.6 pkgsrc-2019Q3:1.6.0.64 pkgsrc-2019Q3-base:1.6 pkgsrc-2019Q2:1.6.0.62 pkgsrc-2019Q2-base:1.6 pkgsrc-2019Q1:1.6.0.60 pkgsrc-2019Q1-base:1.6 pkgsrc-2018Q4:1.6.0.58 pkgsrc-2018Q4-base:1.6 pkgsrc-2018Q3:1.6.0.56 pkgsrc-2018Q3-base:1.6 pkgsrc-2018Q2:1.6.0.54 pkgsrc-2018Q2-base:1.6 pkgsrc-2018Q1:1.6.0.52 pkgsrc-2018Q1-base:1.6 pkgsrc-2017Q4:1.6.0.50 pkgsrc-2017Q4-base:1.6 pkgsrc-2017Q3:1.6.0.48 pkgsrc-2017Q3-base:1.6 pkgsrc-2017Q2:1.6.0.44 pkgsrc-2017Q2-base:1.6 pkgsrc-2017Q1:1.6.0.42 pkgsrc-2017Q1-base:1.6 pkgsrc-2016Q4:1.6.0.40 pkgsrc-2016Q4-base:1.6 pkgsrc-2016Q3:1.6.0.38 pkgsrc-2016Q3-base:1.6 pkgsrc-2016Q2:1.6.0.36 pkgsrc-2016Q2-base:1.6 pkgsrc-2016Q1:1.6.0.34 pkgsrc-2016Q1-base:1.6 pkgsrc-2015Q4:1.6.0.32 pkgsrc-2015Q4-base:1.6 pkgsrc-2015Q3:1.6.0.30 pkgsrc-2015Q3-base:1.6 pkgsrc-2015Q2:1.6.0.28 pkgsrc-2015Q2-base:1.6 pkgsrc-2015Q1:1.6.0.26 pkgsrc-2015Q1-base:1.6 pkgsrc-2014Q4:1.6.0.24 pkgsrc-2014Q4-base:1.6 pkgsrc-2014Q3:1.6.0.22 pkgsrc-2014Q3-base:1.6 pkgsrc-2014Q2:1.6.0.20 pkgsrc-2014Q2-base:1.6 pkgsrc-2014Q1:1.6.0.18 pkgsrc-2014Q1-base:1.6 pkgsrc-2013Q4:1.6.0.16 pkgsrc-2013Q4-base:1.6 pkgsrc-2013Q3:1.6.0.14 pkgsrc-2013Q3-base:1.6 pkgsrc-2013Q2:1.6.0.12 pkgsrc-2013Q2-base:1.6 pkgsrc-2013Q1:1.6.0.10 pkgsrc-2013Q1-base:1.6 pkgsrc-2012Q4:1.6.0.8 pkgsrc-2012Q4-base:1.6 pkgsrc-2012Q3:1.6.0.6 pkgsrc-2012Q3-base:1.6 pkgsrc-2012Q2:1.6.0.4 pkgsrc-2012Q2-base:1.6 pkgsrc-2012Q1:1.6.0.2 pkgsrc-2012Q1-base:1.6 pkgsrc-2011Q4:1.5.0.52 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q3:1.5.0.50 pkgsrc-2011Q3-base:1.5 pkgsrc-2011Q2:1.5.0.48 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.46 pkgsrc-2011Q1-base:1.5 pkgsrc-2010Q4:1.5.0.44 pkgsrc-2010Q4-base:1.5 pkgsrc-2010Q3:1.5.0.42 pkgsrc-2010Q3-base:1.5 pkgsrc-2010Q2:1.5.0.40 pkgsrc-2010Q2-base:1.5 pkgsrc-2010Q1:1.5.0.38 pkgsrc-2010Q1-base:1.5 pkgsrc-2009Q4:1.5.0.36 pkgsrc-2009Q4-base:1.5 pkgsrc-2009Q3:1.5.0.34 pkgsrc-2009Q3-base:1.5 pkgsrc-2009Q2:1.5.0.32 pkgsrc-2009Q2-base:1.5 pkgsrc-2009Q1:1.5.0.30 pkgsrc-2009Q1-base:1.5 pkgsrc-2008Q4:1.5.0.28 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.26 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.24 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.22 pkgsrc-2008Q2-base:1.5 cwrapper:1.5.0.20 pkgsrc-2008Q1:1.5.0.18 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.16 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.14 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.12 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.10 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.8 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.6 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.4 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.2 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.4.0.18 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.16 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.14 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.12 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.10 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.8 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.6 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.4 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.2 pkgsrc-2003Q4-base:1.4 buildlink2-base:1.4 netbsd-1-5-RELEASE:1.3 netbsd-1-4-PATCH003:1.3 netbsd-1-4-PATCH002:1.3 comdex-fall-1999:1.3 netbsd-1-4-PATCH001:1.2 netbsd-1-4-RELEASE:1.2 netbsd-1-3-PATCH003:1.2 netbsd-1-3-PATCH002:1.1; locks; strict; comment @# @; 1.6 date 2012.03.22.14.13.29; author taca; state Exp; branches; next 1.5; 1.5 date 2006.01.08.17.34.47; author joerg; state Exp; branches; next 1.4; 1.4 date 2000.12.11.17.23.04; author itojun; state dead; branches; next 1.3; 1.3 date 99.09.15.21.30.59; author tron; state Exp; branches; next 1.2; 1.2 date 98.08.07.11.09.53; author agc; state Exp; branches; next 1.1; 1.1 date 98.02.13.02.06.59; author mellon; state Exp; branches; next ; desc @@ 1.6 log @Update qpopper to 4.1.0. 4.1 * IPv6 support * Significantly improved performance * Cygwin compatibility (for use under Windows) * Ability to execute arbitrary programs when users log in * And lots more @ text @$NetBSD: patch-ad,v 1.5 2006/01/08 17:34:47 joerg Exp $ --- popper/pop_init.c.orig 2011-05-30 19:13:39.000000000 +0000 +++ popper/pop_init.c @@@@ -213,7 +213,6 @@@@ # endif /* HAVE_HSTRERROR */ #endif /* not INET6 */ -extern int errno; int no_rev_lookup; /* Avoid reverse lookup? */ /* @ 1.5 log @Fix errno. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- popper/pop_init.c.orig 2006-01-08 17:27:18.000000000 +0000 d5 3 a7 3 @@@@ -211,7 +211,6 @@@@ #endif /* HAVE_HSTRERROR */ #endif /* INET6 */ @ 1.4 log @upgrde to 3.1.2, as 2.x had security issues and there's no support given any longer to 2.x. NOTE: kerberos support is dropped, kerberos guru please re-do it... from ftp://ftp.qualcomm.com/eudora/servers/unix/popper/Release.Notes Release Notes: 3.1 Can now set server mode and kerberos service name using run-time options. Can now specify plain-text password handling when APOP is available using '-p 0|1|2|3' run-time option. 0 is default; 1 means clear text passwords are never permitted for any user; 2 means they are always permitted (even if an APOP entry exists), which allows them to be used as a fallback when clients don't support APOP); 3 means they are permitted on the local interface (127.*.*.*) only. Added '-D drac-host' run-time option to specify the drac host. Only valid if compiled with --enable-drac. The default is localhost. Added '-f config-file' run-time option. Additional run-time options are read from the specified file. All current run-time options can now be set this way. See INSTALL file for option names and syntax. Added '-u' run-time option to read '.qpopper-options' file in user's home directory. Added Kerberos V support. BULLDB access now uses usleep(3C) if available, resulting in many more access attempts with a shorter maximum delay. Added run-time options 'bulldb-nonfatal' (-B) and 'bulldb-max-retries' to allow fine control over BULLDB access behavior. 'bulldb-nonfatal' allows a session to continue if the bulletin database can't be locked. 'bulldb-max-retries' sets the maximum number of attempts to lock the database. This value should only be changed if you know if your system has usleep(3C) or not. On systems with usleep(3C), this can be a large value (the default is 75). On systems without usleep(3C), this should remain small (the default is 10). Added new ./configure flags (see INSTALL for more details): --enable-timing to write log records with elapsed time for authentication, initialization, and cleanup. --enable-old-uidl to generates UIDs using old (pre-3.x) style encoding. This is only useful if you also set NO_STATUS and have existing users with old (pre-3.x) spool files and you want to keep the UIDs the same. --disable-status to prevent Qpopper from writing 'Status' or 'X-UIDL' headers (sets NO_STATUS). This forces UIDs for each message to be recalculated in each session. --enable-keep-temp-drop to prevents Qpopper from deleting the temp drop files. --disable-check-pw-max to prevent Qpopper from checking for expired passwords. --disable-old-spool-loc to not check for old .user.pop files in old locations when HASH_SPOOL or HOMEDIRMAIL used. --disable-check-hash-dir to not check for or create hash spool directories. Use this if you pre-create the directories. --enable-server-mode-group-include=group to set server mode for users in the specified group. --enable-server-mode-group-exclude=group to set server mode OFF for users in the specified group. --enable-secure-nis-plus for use with secure NIS+. --disable-optimizations to turn off compiler optimizations. --with-kerberos5 for Kerberos V support (using patch from Ken Hornstein). --enable-any-kerberos-principal to accept any principal in the client request. --enable-kuserok to use kuserok() to vet users. --enable-ksockinst to use getsockinst() for Kerberos instance. --enable-standalone to create standalone POP daemon instead of being run out of inetd. Can specify IP address and/or port number to bind to as parameter 1, e.g., 'popper 199.46.50.7:8110 -S' or 'popper 8110 -S -T600'. If not specified, IP address defaults to all available. The default port is 110 except when _DEBUG (not simply DEBUG) is defined, then it is 8765. --enable-auth-file=path to permit access only to users listed in the specified file. Format is one user per line. --enable-nonauth-file=path to deny access to users listed in the specified file. Format is one user per line. --disable-update-abort to avoid the default behavior of going into update mode if the session aborts (the default behavior violates of RFC 1939, but was found to be needed when noisy dialup lines otherwise prevented users from ever deleting messages). ([RCG]) 3.0 Both dot-locking and flock() now used on all platforms. (On some systems we emulate flock() using fcntl). Added POP3 extensions(CAPA). The extensions added so far are X-MANGLE, LOGIN-DELAY and EXPIRE. X-MANGLE condenses Mime messages into a single part for ease of use by lightweight clients. The transformations supported through X-MANGLE are to and from text/plain, format=flowed, and text/html. As a way to enable MIME-mangling with clients that do not support XMANGLE, add "-no-mime" to the user name. For example, if the userid is"mary", enter it in the client as "mary-no-mime". The optional LOGIN-DELAY and EXPIRE values are only announced through the CAPA command. The values to announce are passed as command line switches. Actual enforcement of minimum login delay and message expiration is up to the site by some other means. (For example, a simple script run from crontab could be used for message expiration.) Qpopper does support automatic deletion of downloaded messages through the --enable-auto-delete configure flag. This can be used to effect EXPIRE 0 (no retention). Added new run-time options: -R to disable reverse-lookups on client IP addresses; -c to downcase user name. A failure at some point in a transaction now releases all locks explicitly. Certain paths do not release locks where SysV .lock files are created. Fixed bugs with Bulletin Services and Server mode. DEBUGn macros for debug and trace messages. Added new ./configure flags (see INSTALL for more details): --with-warnings for extra compiler warnings. --enable-shy to hide qpopper's version number in the banner and CAPA IMPLEMENTATION tag. --enable-auto-delete to automatically mark for deletion all messages downloaded with RETR. --enable-hash-spool=1|2 to use hashed spool directories. --enable-home-dir-mail=file to use a spool file in the user's home directory. --enable-bulldb=path to enable bulletins and set the path for the bulletin directory. --with-new-bulls=number to specify the maximum number of bulletins for new users (default is 10). --enable-popbulldir=path to specify an alternate location for users' popbull files. --enable-log-login to log successful user logins. This can be used, for example, to validate subsequent SMTP sessions from the same IP address within a short time period, in the absence of SMTP AUTH support by client and server. (Suggested by Andy Harper et al). --with-pam=service-name to authenticate using PAM (based on patch contributed by German Poo). --with-log-facility=name to specify the log facility. Default is LOG_LOCAL1 or LOG_MAIL, depending on the OS. --enable-uw-kludge to check for and hide a UW IMAP status message. --enable-group-bulls to show bulletins by groups (group name is second element in bulletin name). Based on patch by Mikolaj Rydzewski. --enable-timing to report timing information in the log. --enable-drac to use DRAC. Based on patches by Mike McHenry, Forrest Aldrich, Steven Champeon, and others. Added file popper/banner.h -- modify this file to add a custom banner and CAPA IMPLEMENTATION tag suffix. Note that if you modify qpopper you should indicate this using banner.h. Improved error messages and warnings: warning "Unable to get canonical name of client" now includes IP address of client; logging added for I/O errors and discarded input (line too long); added errno to POP EOF -ERR message; "Possible probe of account" warning now logged as WARNING, not CRITICAL. @ text @d1 1 a1 1 $NetBSD: patch-ad,v 1.3 1999/09/15 21:30:59 tron Exp $ d3 5 a7 3 --- pop_init.c.orig Fri Jul 10 01:44:07 1998 +++ pop_init.c Wed Sep 15 23:28:18 1999 @@@@ -44,6 +44,8 @@@@ d9 2 a10 1 #include d12 1 a12 176 +#include "sockunion.h" + /* CNS Kerberos IV */ #ifdef KERBEROS AUTH_DAT kdata; @@@@ -75,9 +77,37 @@@@ } #endif +char * +sock_ntop(p) + struct sockaddr *p; +{ +#ifdef INET6 + static char ntop_buf[INET6_ADDRSTRLEN]; +#else + static char ntop_buf[INET_ADDRSTRLEN]; +#endif + union sockunion *su; + + su = (union sockunion *)p; + switch (su->su_family) { + case AF_INET: + inet_ntop(su->su_family, &su->su_sin.sin_addr, ntop_buf, + sizeof(ntop_buf)); + return ntop_buf; +#ifdef INET6 + case AF_INET6: + inet_ntop(su->su_family, &su->su_sin6.sin6_addr, ntop_buf, + sizeof(ntop_buf)); + return ntop_buf; +#endif + default: + return "(unsupported AF)"; + } +} + authenticate(p, addr) POP *p; - struct sockaddr_in *addr; + union sockunion *addr; { #ifdef KERBEROS @@@@ -87,10 +117,10 @@@@ char version[9]; int auth; - if (p->kerberos) { + if (p->kerberos && addr->su_family == AF_INET) { /*XXX*/ strcpy(instance, "*"); auth = krb_recvauth(0L, 0, &ticket, KERBEROS_SERVICE, instance, - addr, (struct sockaddr_in *) NULL, + (struct sockaddr_in *)addr, (struct sockaddr_in *) NULL, &kdata, "", schedule, version); if (auth != KSUCCESS) { @@@@ -105,7 +135,7 @@@@ # ifdef DEBUG if (p->debug) pop_log(p, POP_DEBUG, "%s.%s@@%s (%s): ok", kdata.pname, - kdata.pinst, kdata.prealm, inet_ntoa(addr->sin_addr)); + kdata.pinst, kdata.prealm, sock_ntop(addr)); # endif /* DEBUG */ strncpy(p->user, kdata.pname, sizeof(p->user)); @@@@ -126,7 +156,7 @@@@ char ** argmessage; { - struct sockaddr_in cs; /* Communication parameters */ + union sockunion cs; /* Communication parameters */ struct hostent * ch; /* Client host information */ int errflag = 0; int c; @@@@ -272,13 +302,25 @@@@ /* Save the dotted decimal form of the client's IP address in the POP parameter block */ - p->ipaddr = (char *)strdup(inet_ntoa(cs.sin_addr)); + p->ipaddr = (char *)strdup(sock_ntop(&cs)); /* Save the client's port */ - p->ipport = ntohs(cs.sin_port); + p->ipport = ntohs(cs.su_port); /* Get the canonical name of the host to whom I am speaking */ - ch = gethostbyaddr((char *) &cs.sin_addr, sizeof(cs.sin_addr), AF_INET); + switch (cs.su_family) { + case AF_INET: + ch = gethostbyaddr((char *) &cs.su_sin.sin_addr, sizeof(cs.su_sin.sin_addr), AF_INET); + break; +#ifdef INET6 + case AF_INET6: + ch = gethostbyaddr((char *) &cs.su_sin6.sin6_addr, sizeof(cs.su_sin6.sin6_addr), AF_INET6); + break; +#endif + default: + ch = NULL; + break; + } if (ch == NULL){ pop_log(p,POP_PRIORITY, "(v%s) Unable to get canonical name of client, err = %d", @@@@ -320,6 +362,7 @@@@ strncpy(h_name, ch->h_name, sizeof(h_name)); +#ifndef INET6 /* See if the name obtained for the client's IP address returns an address */ if ((ch_again = gethostbyname(h_name)) == NULL) { @@@@ -336,7 +379,7 @@@@ /* Look for the client's IP address in the list returned for its name */ for (addrp=ch_again->h_addr_list; *addrp; ++addrp) - if (bcmp(*addrp,&(cs.sin_addr),sizeof(cs.sin_addr)) == 0) break; + if (bcmp(*addrp,&(cs.su_sin.sin_addr),sizeof(cs.su_sin.sin_addr)) == 0) break; if (!*addrp) { pop_log (p,POP_PRIORITY, @@@@ -345,6 +388,54 @@@@ p->client = p->ipaddr; } } +#else + { + struct addrinfo hints, *res; + int error; + + p->client = (char *)strdup(ch->h_name); + + /* + * See if the name obtained for the client's IP + * address returns an address + */ + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + error = getaddrinfo(h_name, NULL, &hints, &res); + if (error) { + pop_log(p,POP_PRIORITY, + "Client at \"%s\" resolves to an unknown host name \"%s\"", + p->ipaddr, h_name); + p->client = p->ipaddr; + } else { + for ( ; res; res = res->ai_next) { + if (res->ai_addr->sa_family == AF_INET) { + if (!memcmp(&((struct sockaddr_in *)res->ai_addr)->sin_addr, + &(cs.su_sin.sin_addr), sizeof(cs.su_sin.sin_addr))) { + break; + } + } else if (res->ai_addr->sa_family == AF_INET6) { + if (!memcmp(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr, + &(cs.su_sin6.sin6_addr), sizeof(cs.su_sin6.sin6_addr))) { + break; + } + } else { + break; + } + } + + if (!res) { + pop_log (p,POP_PRIORITY, + "Client address \"%s\" not listed for its host name \"%s\"", + p->ipaddr,h_name); + p->client = p->ipaddr; + } + } + } +#endif #ifdef RES_DEFNAMES /* @ 1.3 log @Convert patches to unified format. @ text @d1 1 a1 1 $NetBSD$ @ 1.2 log @Add NetBSD RCS Ids. @ text @d3 182 a184 26 *** config.h.in Wed Nov 19 13:20:38 1997 --- config.h.in Thu Feb 12 17:34:12 1998 *************** *** 40,43 **** --- 40,44 ---- #undef APOP #undef POPUID + #undef KERBEROS #undef GDBM #undef MAIL_COMMAND *************** *** 144,147 **** --- 145,157 ---- /* Define if you have the header file. */ #undef HAVE_UNISTD_H + + /* Define if you have the header file. */ + #undef HAVE_STDLIB_H + + /* Define if you have the header file. */ + #undef HAVE_STRING_H + + /* Define if you have the header file. */ + #undef HAVE_TIME_H /* Define if you have the cposix library (-lcposix). */ @ 1.1 log @Make popper compile without errors or warnings, with kerberos. @ text @d1 2 @