imapext-2007

changeset 13:20c025a380ab

imap-2007f
author HIROSE Yuuji <yuuji@gentei.org>
date Sun, 07 May 2023 12:07:19 +0900
parents 4f5400cea456
children c84e9e99e6ca
files Makefile docs/RELNOTES src/c-client/mail.h src/imapd/imapd.c src/osdep/unix/Makefile src/osdep/unix/env_unix.c src/osdep/unix/os_a52.c src/osdep/unix/os_a52.h src/osdep/unix/tcp_unix.c
diffstat 9 files changed, 150 insertions(+), 12 deletions(-) [+]
line diff
     1.1 --- a/Makefile	Sun May 07 12:47:12 2023 +0900
     1.2 +++ b/Makefile	Sun May 07 12:07:19 2023 +0900
     1.3 @@ -37,6 +37,7 @@
     1.4  # The following ports are bundled:
     1.5  # a32	AIX 3.2 for RS/6000
     1.6  # a41	AIX 4.1 for RS/6000
     1.7 +# a52	Attempt at AIX 5.2
     1.8  # aix	AIX/370 (not RS/6000!!)
     1.9  # ami	AmigaDOS
    1.10  # am2	AmigaDOS with a 68020+
    1.11 @@ -308,7 +309,7 @@
    1.12  
    1.13  # Note on SCO you may have to set LN to "ln".
    1.14  
    1.15 -a32 a41 aix bs3 bsi d-g d54 do4 drs epx ga4 gas gh9 ghp ghs go5 gsc gsg gso gul h11 hpp hpx lnp lyn mct mnt nec nto nxt nx3 osf os4 ptx qnx sc5 sco sgi sg6 shp sl4 sl5 slx snx soc sol sos uw2: an
    1.16 +a32 a41 a52 aix bs3 bsi d-g d54 do4 drs epx ga4 gas gh9 ghp ghs go5 gsc gsg gso gul h11 hpp hpx lnp lyn mct mnt nec nto nxt nx3 osf os4 ptx qnx sc5 sco sgi sg6 shp sl4 sl5 slx snx soc sol sos uw2: an
    1.17  	$(BUILD) BUILDTYPE=$@
    1.18  
    1.19  # If you use sv4, you may find that it works to move it to use the an process.
     2.1 --- a/docs/RELNOTES	Sun May 07 12:47:12 2023 +0900
     2.2 +++ b/docs/RELNOTES	Sun May 07 12:07:19 2023 +0900
     2.3 @@ -11,6 +11,17 @@
     2.4   * ========================================================================
     2.5   */
     2.6  
     2.7 +Updated: 22 July 2011
     2.8 +
     2.9 +imap-2007f fixes a couple bugs.
    2.10 +Fix for RFC 4959 Initial Client Response auth failures noted first by
    2.11 +  MacOSX Lion Mail users.
    2.12 +Adjust tcp_open.c:tcp_socket_open to make it a little more useful by adding
    2.13 +  a write file descriptor test to the select in the case that the open
    2.14 +  timeout is set.
    2.15 +In osdep/unix/env_unix.c:create_path there was a printf that should have
    2.16 +  been an sprintf. Doesn't matter on modern systems.
    2.17 +
    2.18  Updated: 16 December 2008
    2.19  
    2.20  imap-2007e is a maintenance release, consisting primarily of bugfixes to
     3.1 --- a/src/c-client/mail.h	Sun May 07 12:47:12 2023 +0900
     3.2 +++ b/src/c-client/mail.h	Sun May 07 12:07:19 2023 +0900
     3.3 @@ -21,12 +21,12 @@
     3.4   *		Internet: MRC@Washington.EDU
     3.5   *
     3.6   * Date:	22 November 1989
     3.7 - * Last Edited:	16 December 2008
     3.8 + * Last Edited:	22 July 2011
     3.9   */
    3.10  
    3.11  /* The Version */
    3.12  
    3.13 -#define CCLIENTVERSION "2007e"
    3.14 +#define CCLIENTVERSION "2007f"
    3.15  
    3.16  /* Build parameters */
    3.17  
     4.1 --- a/src/imapd/imapd.c	Sun May 07 12:47:12 2023 +0900
     4.2 +++ b/src/imapd/imapd.c	Sun May 07 12:07:19 2023 +0900
     4.3 @@ -21,7 +21,7 @@
     4.4   *		Internet: MRC@Washington.EDU
     4.5   *
     4.6   * Date:	5 November 1990
     4.7 - * Last Edited:	3 March 2008
     4.8 + * Last Edited:	22 July 2011
     4.9   */
    4.10  
    4.11  /* Parameter files */
    4.12 @@ -2148,7 +2148,7 @@
    4.13  				/* must be at least one BASE64 char */
    4.14    else if (!base64mask[*ret]) return NIL;
    4.15    else {			/* quick and dirty */
    4.16 -    while (base64mask[*s++]);	/* scan until end of BASE64 */
    4.17 +    while (base64mask[*s]) s++;	/* scan until end of BASE64 */
    4.18      if (*s == '=') ++s;		/* allow up to two padding chars */
    4.19      if (*s == '=') ++s;
    4.20    }
     5.1 --- a/src/osdep/unix/Makefile	Sun May 07 12:47:12 2023 +0900
     5.2 +++ b/src/osdep/unix/Makefile	Sun May 07 12:07:19 2023 +0900
     5.3 @@ -204,6 +204,14 @@
     5.4  	 BASECFLAGS="-g -Dunix=1 -D_BSD -qro -qroconst" \
     5.5  	 BASELDFLAGS="-ls"
     5.6  
     5.7 +a52:	# Attempt at AIX 5.2
     5.8 +	$(BUILD) `$(CAT) SPECIALS` OS=$@ \
     5.9 +	 SIGTYPE=psx CHECKPW=a41 CRXTYPE=nfs \
    5.10 +	 SPOOLDIR=/var/spool \
    5.11 +	 RSHPATH=/usr/bin/rsh \
    5.12 +	 BASECFLAGS="-g -Dunix=1 -D_BSD -qro -qroconst" \
    5.13 +	 BASELDFLAGS="-ls"
    5.14 +
    5.15  aix:	# AIX/370
    5.16  	@echo You are building for AIX on an S/370 class machine
    5.17  	@echo If you want AIX on an RS/6000 you need to use a32 or a41 instead!
     6.1 --- a/src/osdep/unix/env_unix.c	Sun May 07 12:47:12 2023 +0900
     6.2 +++ b/src/osdep/unix/env_unix.c	Sun May 07 12:07:19 2023 +0900
     6.3 @@ -21,7 +21,7 @@
     6.4   *		Internet: MRC@Washington.EDU
     6.5   *
     6.6   * Date:	1 August 1988
     6.7 - * Last Edited:	15 May 2008
     6.8 + * Last Edited:	23 February 2009
     6.9   */
    6.10  
    6.11  #include <grp.h>
    6.12 @@ -1868,7 +1868,7 @@
    6.13    restrictBox = NIL;		/* can't restrict */
    6.14    if (blackBox) {		/* if black box */
    6.15  				/* toss out driver dependent names */
    6.16 -    printf (path,"%s/INBOX",mymailboxdir ());
    6.17 +    sprintf (path,"%s/INBOX",mymailboxdir ());
    6.18      blackBox = NIL;		/* well that's evil - evil is going on */
    6.19      ret = mail_create (stream,path);
    6.20      blackBox = T;		/* restore the box */
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/osdep/unix/os_a52.c	Sun May 07 12:07:19 2023 +0900
     7.3 @@ -0,0 +1,63 @@
     7.4 +/* ========================================================================
     7.5 + * Copyright 1988-2006 University of Washington
     7.6 + *
     7.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     7.8 + * you may not use this file except in compliance with the License.
     7.9 + * You may obtain a copy of the License at
    7.10 + *
    7.11 + *     http://www.apache.org/licenses/LICENSE-2.0
    7.12 + *
    7.13 + * 
    7.14 + * ========================================================================
    7.15 + */
    7.16 +
    7.17 +/*
    7.18 + * Program:	Operating-system dependent routines -- AIX 4.1 on RS 6000
    7.19 + *
    7.20 + * Author:	Mark Crispin
    7.21 + *		Networks and Distributed Computing
    7.22 + *		Computing & Communications
    7.23 + *		University of Washington
    7.24 + *		Administration Building, AG-44
    7.25 + *		Seattle, WA  98195
    7.26 + *		Internet: MRC@CAC.Washington.EDU
    7.27 + *
    7.28 + * Date:	1 August 1988
    7.29 + * Last Edited:	30 August 2006
    7.30 + */
    7.31 + 
    7.32 +#include "tcp_unix.h"		/* must be before osdep includes tcp.h */
    7.33 +#include "mail.h"
    7.34 +#include "osdep.h"
    7.35 +#include <stdio.h>
    7.36 +#include <sys/time.h>
    7.37 +#include <sys/socket.h>
    7.38 +#include <sys/stat.h>
    7.39 +#include <netinet/in.h>
    7.40 +#include <arpa/inet.h>
    7.41 +#include <netdb.h>
    7.42 +#include <ctype.h>
    7.43 +#include <errno.h>
    7.44 +extern int errno;		/* just in case */
    7.45 +#include <pwd.h>
    7.46 +#include "misc.h"
    7.47 +#include <sys/select.h>
    7.48 +#include <stddef.h>		/* needed for authenticate() */
    7.49 +
    7.50 +int authenticate (char *UserName,char *Response,int *Reenter,char **Message);
    7.51 +
    7.52 +extern int sys_nerr;
    7.53 +extern char *sys_errlist[];
    7.54 +
    7.55 +
    7.56 +#include "fs_unix.c"
    7.57 +#include "ftl_unix.c"
    7.58 +#include "nl_unix.c"
    7.59 +#include "env_unix.c"
    7.60 +#include "tcp_unix.c"
    7.61 +#include "gr_waitp.c"
    7.62 +#include "tz_sv4.c"
    7.63 +#include "flocksim.c"
    7.64 +#undef setpgrp
    7.65 +#include "setpgrp.c"
    7.66 +#include "utime.c"
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/osdep/unix/os_a52.h	Sun May 07 12:07:19 2023 +0900
     8.3 @@ -0,0 +1,53 @@
     8.4 +/* ========================================================================
     8.5 + * Copyright 1988-2006 University of Washington
     8.6 + *
     8.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     8.8 + * you may not use this file except in compliance with the License.
     8.9 + * You may obtain a copy of the License at
    8.10 + *
    8.11 + *     http://www.apache.org/licenses/LICENSE-2.0
    8.12 + *
    8.13 + * 
    8.14 + * ========================================================================
    8.15 + */
    8.16 +
    8.17 +/*
    8.18 + * Program:	Operating-system dependent routines -- AIX on RS6000
    8.19 + *
    8.20 + * Author:	Mark Crispin
    8.21 + *		Networks and Distributed Computing
    8.22 + *		Computing & Communications
    8.23 + *		University of Washington
    8.24 + *		Administration Building, AG-44
    8.25 + *		Seattle, WA  98195
    8.26 + *		Internet: MRC@CAC.Washington.EDU
    8.27 + *
    8.28 + * Date:	1 August 1988
    8.29 + * Last Edited:	30 August 2006
    8.30 + */
    8.31 +
    8.32 +#include <stdlib.h>
    8.33 +#include <unistd.h>
    8.34 +#include <string.h>
    8.35 +#include <sys/types.h>
    8.36 +#include <time.h>		/* for struct tm */
    8.37 +#include <dirent.h>
    8.38 +#include <fcntl.h>
    8.39 +#include <utime.h>
    8.40 +#include <syslog.h>
    8.41 +#include <sys/file.h>
    8.42 +#include <ustat.h>
    8.43 +
    8.44 +
    8.45 +#define setpgrp(a,b) Setpgrp(a,b)
    8.46 +int Setpgrp (int pid,int gid);
    8.47 +
    8.48 +#define utime portable_utime
    8.49 +int portable_utime (char *file,time_t timep[2]);
    8.50 +
    8.51 +#include "env_unix.h"
    8.52 +#include "fs.h"
    8.53 +#include "ftl.h"
    8.54 +#include "nl.h"
    8.55 +#include "tcp.h"
    8.56 +#include "flocksim.h"
     9.1 --- a/src/osdep/unix/tcp_unix.c	Sun May 07 12:47:12 2023 +0900
     9.2 +++ b/src/osdep/unix/tcp_unix.c	Sun May 07 12:07:19 2023 +0900
     9.3 @@ -239,7 +239,7 @@
     9.4    size_t len;
     9.5    time_t now;
     9.6    struct protoent *pt = getprotobyname ("tcp");
     9.7 -  fd_set fds,efds;
     9.8 +  fd_set rfds,wfds,efds;
     9.9    struct timeval tmo;
    9.10    struct sockaddr *sadr = ip_sockaddr (family,adr,adrlen,port,&len);
    9.11    blocknotify_t bn = (blocknotify_t) mail_parameters (NIL,GET_BLOCKNOTIFY,NIL);
    9.12 @@ -285,13 +285,15 @@
    9.13        now = time (0);		/* open timeout */
    9.14        ti = ttmo_open ? now + ttmo_open : 0;
    9.15        tmo.tv_usec = 0;
    9.16 -      FD_ZERO (&fds);		/* initialize selection vector */
    9.17 +      FD_ZERO (&rfds);		/* initialize selection vector */
    9.18 +      FD_ZERO (&wfds);		/* initialize selection vector */
    9.19        FD_ZERO (&efds);		/* handle errors too */
    9.20 -      FD_SET (sock,&fds);	/* block for error or readable */
    9.21 +      FD_SET (sock,&rfds);	/* block for error or readable or writable */
    9.22 +      FD_SET (sock,&wfds);
    9.23        FD_SET (sock,&efds);
    9.24        do {			/* block under timeout */
    9.25  	tmo.tv_sec = ti ? ti - now : 0;
    9.26 -	i = select (sock+1,&fds,NIL,&efds,ti ? &tmo : NIL);
    9.27 +	i = select (sock+1,&rfds,&wfds,&efds,ti ? &tmo : NIL);
    9.28  	now = time (0);		/* fake timeout if interrupt & time expired */
    9.29  	if ((i < 0) && (errno == EINTR) && ti && (ti <= now)) i = 0;
    9.30        } while ((i < 0) && (errno == EINTR));
    9.31 @@ -300,7 +302,7 @@
    9.32  	fcntl (sock,F_SETFL,flgs);
    9.33  	/* This used to be a zero-byte read(), but that crashes Solaris */
    9.34  				/* get socket status */
    9.35 -	while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
    9.36 +	if(FD_ISSET(sock, &rfds)) while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
    9.37        }	
    9.38        if (i <= 0) {		/* timeout or error? */
    9.39  	i = i ? errno : ETIMEDOUT;/* determine error code */

UW-IMAP'd extensions by yuuji