1 diff -rc alpine-2.20/alpine/alpine.c alpine-2.20.maildir/alpine/alpine.c
2 *** alpine-2.20/alpine/alpine.c 2015-01-11 22:12:25.464178246 -0700
3 --- alpine-2.20.maildir/alpine/alpine.c 2015-01-20 20:37:55.697011675 -0700
7 if(F_ON(F_MAILDROPS_PRESERVE_STATE, ps_global))
8 mail_parameters(NULL, SET_SNARFPRESERVE, (void *) TRUE);
11 + rv = F_ON(F_COURIER_FOLDER_LIST, ps_global) ? 1 : 0;
12 + mail_parameters(NULL,SET_COURIERSTYLE, (void *) &rv);
16 if(pine_state->VAR_NNTPRANGE){
17 if(!SVAR_NNTPRANGE(pine_state, rvl, tmp_20k_buf, SIZEOF_20KBUF))
18 diff -rc alpine-2.20/alpine/confscroll.c alpine-2.20.maildir/alpine/confscroll.c
19 *** alpine-2.20/alpine/confscroll.c 2015-01-11 22:12:25.464178246 -0700
20 --- alpine-2.20.maildir/alpine/confscroll.c 2015-01-20 20:37:55.723011676 -0700
24 (void *)var->current_val.p);
28 + else if(var == &ps->vars[V_MAILDIR_LOCATION]){
29 + if(var->current_val.p && var->current_val.p[0])
30 + mail_parameters(NULL, SET_MDINBOXPATH, (void *)var->current_val.p);
33 else if(revert && standard_radio_var(ps, var)){
35 cur_rule_value(var, TRUE, FALSE);
36 diff -rc alpine-2.20/alpine/Makefile alpine-2.20.maildir/alpine/Makefile
37 *** alpine-2.20/alpine/Makefile 2015-01-18 00:00:55.293703107 -0700
38 --- alpine-2.20.maildir/alpine/Makefile 2015-01-20 20:38:26.573015636 -0700
41 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
44 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
46 AM_CFLAGS = -g -pthread
47 AM_DEFAULT_VERBOSITY = 1
48 AM_LDFLAGS = `cat ../c-client/LDFLAGS`
50 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
51 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
52 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
55 CCDEPMODE = depmode=gcc3
57 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
60 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
62 AM_CFLAGS = -g -pthread
63 AM_DEFAULT_VERBOSITY = 1
64 AM_LDFLAGS = `cat ../c-client/LDFLAGS`
66 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
67 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
68 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
71 CCDEPMODE = depmode=gcc3
75 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
76 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
77 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
78 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
80 C_CLIENT_WITH_IPV6 = touch imap/ip6
83 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
84 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
85 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
86 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
88 C_CLIENT_WITH_IPV6 = touch imap/ip6
94 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
95 LIBTOOL = $(SHELL) $(top_builddir)/libtool
96 LIBTOOL_DEPS = ./ltmain.sh
102 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
103 LIBTOOL = $(SHELL) $(top_builddir)/libtool
104 LIBTOOL_DEPS = ./ltmain.sh
111 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
113 MKDIR_P = /usr/bin/mkdir -p
114 MSGFMT = /usr/bin/msgfmt
119 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
121 MKDIR_P = /usr/bin/mkdir -p
122 MSGFMT = /usr/bin/msgfmt
126 XGETTEXT = /usr/bin/xgettext
127 XGETTEXT_015 = /usr/bin/xgettext
128 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/alpine
129 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/alpine
130 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
131 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
137 XGETTEXT = /usr/bin/xgettext
138 XGETTEXT_015 = /usr/bin/xgettext
139 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/alpine
140 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/alpine
141 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
142 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
149 includedir = ${prefix}/include
150 infodir = ${datarootdir}/info
151 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
152 libdir = ${exec_prefix}/lib
153 libexecdir = ${exec_prefix}/libexec
154 localedir = ${datadir}/locale
157 includedir = ${prefix}/include
158 infodir = ${datarootdir}/info
159 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
160 libdir = ${exec_prefix}/lib
161 libexecdir = ${exec_prefix}/libexec
162 localedir = ${datadir}/locale
163 diff -rc alpine-2.20/alpine/osdep/Makefile alpine-2.20.maildir/alpine/osdep/Makefile
164 *** alpine-2.20/alpine/osdep/Makefile 2015-01-18 00:00:55.270703006 -0700
165 --- alpine-2.20.maildir/alpine/osdep/Makefile 2015-01-20 20:38:26.540015628 -0700
170 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
171 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
173 AM_CFLAGS = -g -pthread
174 AM_DEFAULT_VERBOSITY = 1
177 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
178 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
179 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
182 CCDEPMODE = depmode=gcc3
186 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
187 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
189 AM_CFLAGS = -g -pthread
190 AM_DEFAULT_VERBOSITY = 1
193 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
194 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
195 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
198 CCDEPMODE = depmode=gcc3
202 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
203 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
204 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
205 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
206 C_CLIENT_TARGET = lsu
207 C_CLIENT_WITH_IPV6 = touch imap/ip6
210 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
211 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
212 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
213 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
214 C_CLIENT_TARGET = lsu
215 C_CLIENT_WITH_IPV6 = touch imap/ip6
221 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
222 LIBTOOL = $(SHELL) $(top_builddir)/libtool
223 LIBTOOL_DEPS = ./ltmain.sh
229 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
230 LIBTOOL = $(SHELL) $(top_builddir)/libtool
231 LIBTOOL_DEPS = ./ltmain.sh
238 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
240 MKDIR_P = /usr/bin/mkdir -p
241 MSGFMT = /usr/bin/msgfmt
246 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
248 MKDIR_P = /usr/bin/mkdir -p
249 MSGFMT = /usr/bin/msgfmt
253 XGETTEXT = /usr/bin/xgettext
254 XGETTEXT_015 = /usr/bin/xgettext
255 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/alpine/osdep
256 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/alpine/osdep
257 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
258 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
264 XGETTEXT = /usr/bin/xgettext
265 XGETTEXT_015 = /usr/bin/xgettext
266 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/alpine/osdep
267 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/alpine/osdep
268 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
269 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
276 includedir = ${prefix}/include
277 infodir = ${datarootdir}/info
278 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
279 libdir = ${exec_prefix}/lib
280 libexecdir = ${exec_prefix}/libexec
281 localedir = ${datadir}/locale
284 includedir = ${prefix}/include
285 infodir = ${datarootdir}/info
286 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
287 libdir = ${exec_prefix}/lib
288 libexecdir = ${exec_prefix}/libexec
289 localedir = ${datadir}/locale
290 diff -rc alpine-2.20/imap/src/c-client/mail.c alpine-2.20.maildir/imap/src/c-client/mail.c
291 *** alpine-2.20/imap/src/c-client/mail.c 2015-01-11 22:12:25.521178518 -0700
292 --- alpine-2.20.maildir/imap/src/c-client/mail.c 2015-01-20 20:37:55.798011677 -0700
296 char *s,*t,tmp[MAILTMPLEN];
299 /* never allow names with newlines */
300 if (s = strpbrk (mailbox,"\015\012")) {
301 MM_LOG ("Can't create mailbox with such a name",ERROR);
304 char *s,*t,tmp[MAILTMPLEN];
307 /* never allow names with newlines */
308 if (s = strpbrk (mailbox,"\015\012")) {
309 MM_LOG ("Can't create mailbox with such a name",ERROR);
316 + /* Hack, we should do this better, but it works */
317 + for (md = maildrivers; md && strcmp (md->name, "md"); md = md->next);
318 /* see if special driver hack */
319 if ((mailbox[0] == '#') && ((mailbox[1] == 'd') || (mailbox[1] == 'D')) &&
320 ((mailbox[2] == 'r') || (mailbox[2] == 'R')) &&
324 (((*mailbox == '{') || (*mailbox == '#')) &&
325 (stream = mail_open (NIL,mailbox,OP_PROTOTYPE | OP_SILENT))))
327 + else if(mailbox[0] == '#'
328 + && (mailbox[1] == 'm' || mailbox[1] == 'M')
329 + && (mailbox[2] == 'd' || mailbox[2] == 'D'
330 + || mailbox[2] == 'c' || mailbox[2] == 'C')
331 + && mailbox[3] == '/'
332 + && mailbox[4] != '\0')
333 + return (*md->create)(stream, mailbox);
334 else if ((*mailbox != '{') && (ts = default_proto (NIL))) d = ts->dtb;
335 else { /* failed utterly */
336 sprintf (tmp,"Can't create mailbox %.80s: indeterminate format",mailbox);
337 diff -rc alpine-2.20/imap/src/c-client/mail.h alpine-2.20.maildir/imap/src/c-client/mail.h
338 *** alpine-2.20/imap/src/c-client/mail.h 2015-01-11 22:12:25.520178513 -0700
339 --- alpine-2.20.maildir/imap/src/c-client/mail.h 2015-01-20 20:37:55.804011677 -0700
343 #define SET_SCANCONTENTS (long) 573
344 #define GET_MHALLOWINBOX (long) 574
345 #define SET_MHALLOWINBOX (long) 575
346 + #define GET_COURIERSTYLE (long) 576
347 + #define SET_COURIERSTYLE (long) 577
348 + #define SET_MDINBOXPATH (long) 578
349 + #define GET_MDINBOXPATH (long) 579
353 diff -rc alpine-2.20/imap/src/osdep/unix/dummy.c alpine-2.20.maildir/imap/src/osdep/unix/dummy.c
354 *** alpine-2.20/imap/src/osdep/unix/dummy.c 2015-01-11 22:12:25.504178437 -0700
355 --- alpine-2.20.maildir/imap/src/osdep/unix/dummy.c 2015-01-20 20:37:55.833011678 -0700
358 * Accepts: mailbox name
359 * Returns: our driver if name is valid, NIL otherwise
362 DRIVER *dummy_valid (char *name)
364 ! char *s,tmp[MAILTMPLEN];
366 /* must be valid local mailbox */
367 ! if (name && *name && (*name != '{') && (s = mailboxfile (tmp,name))) {
368 /* indeterminate clearbox INBOX */
369 if (!*s) return &dummydriver;
370 else if (!stat (s,&sbuf)) switch (sbuf.st_mode & S_IFMT) {
372 * Accepts: mailbox name
373 * Returns: our driver if name is valid, NIL otherwise
375 ! char * maildir_remove_root(char *);
376 DRIVER *dummy_valid (char *name)
378 ! char *s,tmp[MAILTMPLEN], *rname;
381 + if(strlen(name) > MAILTMPLEN)
382 + name[MAILTMPLEN] = '\0';
385 + rname = maildir_remove_root(tmp);
386 /* must be valid local mailbox */
387 ! if (rname && *rname && (*rname != '{') && (s = mailboxfile (tmp,rname))) {
388 /* indeterminate clearbox INBOX */
389 if (!*s) return &dummydriver;
390 else if (!stat (s,&sbuf)) switch (sbuf.st_mode & S_IFMT) {
395 /* blackbox INBOX does not exist yet */
396 ! else if (!compare_cstring (name,"INBOX")) return &dummydriver;
404 /* blackbox INBOX does not exist yet */
405 ! else if (!compare_cstring (rname,"INBOX")) return &dummydriver;
407 + if(rname) fs_give((void **)&rname);
415 char *s,tmp[MAILTMPLEN];
417 + if(!strncmp(mailbox,"#md/",4) || !strncmp(mailbox,"#mc/", 4))
418 + return maildir_create(stream, mailbox);
420 if (!(compare_cstring (mailbox,"INBOX") && (s = dummy_file (tmp,mailbox)))) {
421 sprintf (tmp,"Can't create %.80s: invalid name",mailbox);
427 char *s,tmp[MAILTMPLEN];
428 + if (!strncmp(mailbox,"#md/",4) || !strncmp(mailbox,"#mc/", 4)
429 + || is_valid_maildir(&mailbox)){
430 + char tmp[MAILTMPLEN] = {'\0'};
431 + strcpy(tmp, mailbox);
432 + if(tmp[strlen(tmp) - 1] != '/')
433 + tmp[strlen(tmp)] = '/';
434 + return maildir_delete(stream, tmp);
436 if (!(s = dummy_file (tmp,mailbox))) {
437 sprintf (tmp,"Can't delete - invalid name: %.80s",s);
441 long dummy_rename (MAILSTREAM *stream,char *old,char *newname)
444 ! char c,*s,tmp[MAILTMPLEN],mbx[MAILTMPLEN],oldname[MAILTMPLEN];
445 /* no trailing / allowed */
446 ! if (!dummy_file (oldname,old) || !(s = dummy_file (mbx,newname)) ||
447 stat (oldname,&sbuf) || ((s = strrchr (s,'/')) && !s[1] &&
448 ((sbuf.st_mode & S_IFMT) != S_IFDIR))) {
449 ! sprintf (mbx,"Can't rename %.80s to %.80s: invalid name",old,newname);
454 long dummy_rename (MAILSTREAM *stream,char *old,char *newname)
457 ! char c,*s,tmp[MAILTMPLEN],mbx[MAILTMPLEN],oldname[MAILTMPLEN], *rold, *rnewname;
459 ! if(strlen(old) > MAILTMPLEN)
460 ! old[MAILTMPLEN] = '\0';
462 ! if(strlen(newname) > MAILTMPLEN)
463 ! newname[MAILTMPLEN] = '\0';
466 ! rold = maildir_remove_root(tmp);
467 ! strcpy(tmp, newname);
468 ! rnewname = maildir_remove_root(tmp);
469 /* no trailing / allowed */
470 ! if (!dummy_file (oldname,rold) || !(s = dummy_file (mbx,rnewname)) ||
471 stat (oldname,&sbuf) || ((s = strrchr (s,'/')) && !s[1] &&
472 ((sbuf.st_mode & S_IFMT) != S_IFDIR))) {
473 ! sprintf (mbx,"Can't rename %.80s to %.80s: invalid name",rold,rnewname);
481 /* rename of non-ex INBOX creates dest */
482 ! if (!compare_cstring (old,"INBOX") && stat (oldname,&sbuf))
483 return dummy_create (NIL,mbx);
484 if (rename (oldname,mbx)) {
485 ! sprintf (tmp,"Can't rename mailbox %.80s to %.80s: %.80s",old,newname,
490 return T; /* return success */
496 /* rename of non-ex INBOX creates dest */
497 ! if (!compare_cstring (rold,"INBOX") && stat (oldname,&sbuf))
498 return dummy_create (NIL,mbx);
499 if (rename (oldname,mbx)) {
500 ! sprintf (tmp,"Can't rename mailbox %.80s to %.80s: %.80s",rold,rnewname,
505 + if(rold) fs_give((void **)&rold);
506 + if(rnewname) fs_give((void **)&rnewname);
507 return T; /* return success */
510 diff -rc alpine-2.20/imap/src/osdep/unix/maildir.c alpine-2.20.maildir/imap/src/osdep/unix/maildir.c
511 *** alpine-2.20/imap/src/osdep/unix/maildir.c 2015-02-03 22:28:22.632016232 -0700
512 --- alpine-2.20.maildir/imap/src/osdep/unix/maildir.c 2015-01-21 20:06:56.462383814 -0700
517 + * Maildir driver for Alpine 2.20
519 + * Written by Eduardo Chappa <chappa@gmx.com>
520 + * Last Update: January 21, 2015
527 + extern int errno; /* just in case */
530 + #include <sys/stat.h>
531 + #include <sys/time.h>
533 + #include "rfc822.h"
534 + #include "fdstring.h"
537 + #include "maildir.h"
539 + /* Driver dispatch used by MAIL */
540 + DRIVER maildirdriver = {
541 + "md", /* driver name, yes it's md, not maildir */
542 + DR_MAIL|DR_LOCAL|DR_NAMESPACE|DR_DIRFMT, /* driver flags */
543 + (DRIVER *) NIL, /* next driver */
544 + maildir_valid, /* mailbox is valid for us */
545 + maildir_parameters, /* manipulate parameters */
546 + NIL, /* scan mailboxes */
547 + maildir_list, /* find mailboxes */
548 + maildir_lsub, /* find subscribed mailboxes */
549 + maildir_sub, /* subscribe to mailbox */
550 + maildir_unsub, /* unsubscribe from mailbox */
551 + maildir_create, /* create mailbox */
552 + maildir_delete, /* delete mailbox */
553 + maildir_rename, /* rename mailbox */
554 + mail_status_default, /* status of mailbox */
555 + maildir_open, /* open mailbox */
556 + maildir_close, /* close mailbox */
557 + maildir_fast, /* fetch message "fast" attributes */
558 + NIL, /* fetch message flags */
559 + NIL, /* fetch overview */
560 + NIL, /* fetch message structure */
561 + maildir_header, /* fetch message header */
562 + maildir_text, /* fetch message body */
563 + NIL, /* fetch partial message text */
564 + NIL, /* unique identifier */
565 + NIL, /* message number */
566 + NIL, /* modify flags */
567 + maildir_flagmsg, /* per-message modify flags */
568 + NIL, /* search for message based on criteria */
569 + NIL, /* sort messages */
570 + NIL, /* thread messages */
571 + maildir_ping, /* ping mailbox to see if still alive */
572 + maildir_check, /* check for new messages */
573 + maildir_expunge, /* expunge deleted messages */
574 + maildir_copy, /* copy messages to another mailbox */
575 + maildir_append, /* append string message to mailbox */
576 + NIL /* garbage collect stream */
580 + DRIVER courierdriver = {
581 + "mc", /* Why a separate driver? So that createproto will work */
582 + DR_MAIL|DR_LOCAL|DR_NAMESPACE|DR_DIRFMT, /* driver flags */
583 + (DRIVER *) NIL, /* next driver */
584 + maildir_valid, /* mailbox is valid for us */
585 + maildir_parameters, /* manipulate parameters */
586 + NIL, /* scan mailboxes */
587 + courier_list, /* find mailboxes */
588 + maildir_lsub, /* find subscribed mailboxes */
589 + maildir_sub, /* subscribe to mailbox */
590 + maildir_unsub, /* unsubscribe from mailbox */
591 + maildir_create, /* create mailbox */
592 + maildir_delete, /* delete mailbox */
593 + maildir_rename, /* rename mailbox */
594 + mail_status_default, /* status of mailbox */
595 + maildir_open, /* open mailbox */
596 + maildir_close, /* close mailbox */
597 + maildir_fast, /* fetch message "fast" attributes */
598 + NIL, /* fetch message flags */
599 + NIL, /* fetch overview */
600 + NIL, /* fetch message structure */
601 + maildir_header, /* fetch message header */
602 + maildir_text, /* fetch message body */
603 + NIL, /* fetch partial message text */
604 + NIL, /* unique identifier */
605 + NIL, /* message number */
606 + NIL, /* modify flags */
607 + maildir_flagmsg, /* per-message modify flags */
608 + NIL, /* search for message based on criteria */
609 + NIL, /* sort messages */
610 + NIL, /* thread messages */
611 + maildir_ping, /* ping mailbox to see if still alive */
612 + maildir_check, /* check for new messages */
613 + maildir_expunge, /* expunge deleted messages */
614 + maildir_copy, /* copy messages to another mailbox */
615 + maildir_append, /* append string message to mailbox */
616 + NIL /* garbage collect stream */
619 + MAILSTREAM maildirproto = {&maildirdriver}; /* prototype stream */
620 + MAILSTREAM courierproto = {&courierdriver}; /* prototype stream */
622 + long maildir_dirfmttest (char *name)
625 + for (i = 0; mdstruct[i] && strcmp(name, mdstruct[i]); i++);
626 + return (i < EndDir) || !strcmp(name, MDDIR)
627 + || !strncmp(name, MDUIDLAST, strlen(MDUIDLAST))
628 + || !strncmp(name, MDUIDTEMP, strlen(MDUIDTEMP)) ? LONGT : NIL;
632 + md_domain_name(void)
636 + strcpy(mdlocaldomain, mylocalhost ());
637 + for (i = 0; mdlocaldomain[i] != '\0' ;)
638 + if(mdlocaldomain[i] == '/' || mdlocaldomain[i] == ':'){
639 + for(j = strlen(mdlocaldomain); j >= i; j--)
640 + mdlocaldomain[j+4] = mdlocaldomain[j];
641 + mdlocaldomain[i++] = '\\';
642 + mdlocaldomain[i++] = '0';
643 + if(mdlocaldomain[i] == '/'){
644 + mdlocaldomain[i++] = '5';
645 + mdlocaldomain[i++] = '7';
647 + mdlocaldomain[i++] = '7';
648 + mdlocaldomain[i++] = '2';
656 + myrootdir(char *name)
658 + return myhomedir();
664 + char *path = maildir_parameters(GET_MDINBOXPATH, NIL);
665 + return path ? (path[0] ? path : ".") : "Maildir";
668 + /* remove the "#md/" or "#mc/" part from a folder name
669 + * memory freed by caller
672 + maildir_remove_root (char *name)
674 + int courier = IS_COURIER(name), offset;
675 + char realname[MAILTMPLEN];
677 + offset = maildir_valid_name(name) ? (name[3] == '/' ? 4 : 3) : 0;
679 + courier_realname(name+offset, realname);
681 + strcpy(realname, name+offset);
682 + return cpystr(realname);
686 + /* Check validity of the name, we accept:
687 + * a) #md/directory/folder
689 + * A few considerations: We can only accept as valid
690 + * a) names that start with #md/ and the directory exists or
691 + * b) names that do not start with #md/ but are maildir directories (have
692 + * the /cur, /tmp and /new structure)
694 + int maildir_valid_name (char *name)
696 + char tmpname[MAILTMPLEN] = {'\0'};
699 + fs_give((void **)&mdfpath);
700 + if (name && (name[0] != '#'))
701 + snprintf(tmpname, sizeof(tmpname), "%s%s",MDPREFIX(CCLIENT), name);
702 + mdfpath = cpystr(tmpname[0] ? tmpname : name);
704 + return IS_CCLIENT(name) || IS_COURIER(name);
707 + /* Check if the directory whose path is given by name is a valid maildir
708 + * directory (contains /cur, /tmp and /new)
710 + int maildir_valid_dir (char *name)
715 + char tmp[MAILTMPLEN];
717 + if(name[strlen(name) - 1] == '/')
718 + name[strlen(name) - 1] = '\0';
719 + len = strlen(name);
720 + for (i = Cur; i != EndDir; i++){
721 + MDFLD(tmp, name, i);
722 + if (stat(tmp, &sbuf) < 0 || !S_ISDIR(sbuf.st_mode))
726 + return (i == EndDir) ? T : NIL;
729 + void courier_realname(char *name, char *realname)
736 + for (i = 0, j = 0; i < MAILTMPLEN && j < strlen(name); j++, i++){
737 + realname[i] = name[j];
738 + if(name[j] == '/' && name[j+1] != '.' && name[j+1] != '%'
739 + && name[j+1] != '*')
740 + realname[++i] = '.';
742 + if(realname[i-1] == '.')
744 + realname[i] = '\0';
748 + /* given a maildir folder, return its path. Memory freed by caller. Directory
749 + * does not contain the trailing slash "/". On error NULL is returned.
751 + int maildir_file_path (char *name, char *tmp, size_t sizeoftmp)
753 + char *maildirpath = mdirpath(), *rname;
754 + int courier = IS_COURIER(name);
756 + /* There are several ways in which the path can come, so we will handle
757 + them here. First we deal with #mc/ or #md/ prefix by removing the
760 + if(strlen(name) >= MAILTMPLEN)
761 + name[MAILTMPLEN] = '\0';
763 + rname = maildir_remove_root(tmp);
764 + tmp[0] = '\0'; /* just in case something fails */
766 + if (strlen(myrootdir(rname)) +
767 + max(strlen(rname), strlen(maildirpath)) > sizeoftmp){
768 + errno = ENAMETOOLONG;
769 + snprintf(tmp, sizeoftmp, "Error opening \"%s\": %s", rname, strerror (errno));
771 + if(rname) fs_give((void **)&rname);
775 + /* There are two ways in which the name can come here, either as a
776 + full path or not. If it is not a full path it can come in two ways,
777 + either as a file system path (Maildir/.Drafts) or as a maildir path
781 + if(*rname == '/'){ /* full path */
782 + strncpy(tmp, rname, sizeoftmp); /* do nothing */
783 + tmp[sizeoftmp-1] = '\0';
786 + snprintf (tmp, sizeoftmp, "%s/%s%s%s", myrootdir (rname),
787 + strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
788 + ? rname : maildirpath,
789 + strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
790 + ? "" : (courier ? "/" : ""),
791 + strncmp (ucase (strcpy (tmp, rname)), "INBOX", 5)
792 + ? "" : (*(rname+5) == MDSEPARATOR(courier) ? rname+5 : ""));
793 + if(rname) fs_give((void **)&rname);
794 + return tmp[0] ? T : NIL;
797 + /* This function is given a full path for a mailbox and returns
798 + * if it is a valid maildir transformed to canonical notation
801 + is_valid_maildir (char **name)
803 + if (!strncmp(*name, myrootdir (*name), strlen(myrootdir(*name)))){
804 + (*name) += strlen(myrootdir(*name));
805 + if (**name == '/') (*name)++;
807 + return maildir_valid(*name) ? T : NIL;
810 + /* Check validity of mailbox. This routine does not send errors to log, other
811 + * routines calling this one may do so, though
814 + DRIVER *maildir_valid (char *name)
816 + char tmpname[MAILTMPLEN];
818 + maildir_file_path(name, tmpname, sizeof(tmpname));
820 + return maildir_valid_dir(tmpname)
821 + ? (IS_COURIER(name) ? &courierdriver : &maildirdriver) : NIL;
824 + void maildir_fast (MAILSTREAM *stream,char *sequence,long flags)
829 + if (stream && LOCAL && ((flags & FT_UID) ?
830 + mail_uid_sequence (stream,sequence) :
831 + mail_sequence (stream,sequence)))
832 + for (i = 1L; i <= stream->nmsgs; i++) {
833 + if ((elt = mail_elt (stream,i))->sequence && (elt->valid = T) &&
834 + !(elt->day && elt->rfc822_size)) {
835 + ENVELOPE **env = NIL;
837 + if (!stream->scache) env = &elt->private.msg.env;
838 + else if (stream->msgno == i) env = &stream->env;
840 + if (!*env || !elt->rfc822_size) {
843 + char *ht = (*stream->dtb->header) (stream,i,&hs,NIL);
845 + if (!*env) rfc822_parse_msg (env,NIL,ht,hs,NIL,BADHOST,
846 + stream->dtb->flags);
847 + if (!elt->rfc822_size) {
848 + (*stream->dtb->text) (stream,i,&bs,FT_PEEK);
849 + elt->rfc822_size = hs + SIZE (&bs) - GETPOS (&bs);
853 + if (!elt->day && *env && (*env)->date)
854 + mail_parse_date (elt,(*env)->date);
856 + if (!elt->day) elt->day = elt->month = 1;
857 + mail_free_envelope (&e);
863 + maildir_eliminate_duplicate (char *name, struct direct ***flist, unsigned long *nfiles)
865 + int i, j, k, error = 0, scanr;
866 + char new[MAILTMPLEN], old[MAILTMPLEN], tmp[MAILTMPLEN], *str;
867 + struct direct **names = NIL;
869 + if((scanr = maildir_doscandir(name, &names, CCLIENT)) < 0)
872 + if(nfiles) *nfiles = scanr;
873 + for(i = 0, j = 1, k = 0; j < scanr; i++, j++){
875 + names[i] = names[i+k];
876 + if(same_maildir_file(names[i]->d_name, names[j]->d_name)){
878 + maildir_getflag(names[i]->d_name, &d, &f, &r, &s, NIL);
879 + snprintf(old, sizeof(old), "%s/%s", name, names[i]->d_name);
880 + snprintf(new, sizeof(new), "%s/.%s", name, names[i]->d_name);
881 + if(rename(old, new) < 0 && errno != EEXIST)
885 + && same_maildir_file(names[i]->d_name, names[j]->d_name)
887 + maildir_getflag(names[j]->d_name, (d ? NIL : &d),
888 + (f ? NIL : &f), (r ? NIL : &r), (s ? NIL : &s), NIL);
889 + snprintf(tmp, sizeof(tmp), "%s/%s", name, names[j]->d_name);
890 + if(unlink(tmp) < 0){ /* Hmmm... a problem, let's see */
892 + if (stat(tmp, &sbuf) == 0 && (sbuf.st_mode & S_IFMT) == S_IFREG)
896 + if((str = strrchr(names[i]->d_name,FLAGSEP)) != NULL) *str = '\0';
897 + snprintf (old, sizeof(old), "%s/%s%s%s%s%s%s", name, names[i]->d_name, MDSEP(2),
898 + MDFLAG(Draft, d), MDFLAG(Flagged, f), MDFLAG(Replied, r),
900 + if(rename(new, old) < 0)
907 + fs_give((void **)&names);
910 + return error ? -1 : k;
914 + maildir_doscandir(char *name, struct direct ***flist, int flag)
916 + return scandir(name, flist,
917 + flag == CCLIENT ? maildir_select : courier_dir_select,
918 + flag == CCLIENT ? maildir_namesort : courier_dir_sort);
922 + * return all files in a given directory. This is a separate call
923 + * so that if there are warnings during compilation this only appears once.
926 + maildir_scandir (char *name, struct direct ***flist,
927 + unsigned long *nfiles, int *scand, int flag)
930 + int rv = -2; /* impossible value */
933 + *scand = -1; /* assume error for safety */
935 + if((stat(name,&sbuf) < 0)
936 + || (flag == CCLIENT
937 + && ((rv = maildir_eliminate_duplicate(name, flist, nfiles)) < 0)))
940 + if (scand && (rv > 0 || rv == -2))
941 + *nfiles = maildir_doscandir(name, flist, flag);
943 + if(scand) *scand = *nfiles;
945 + return (unsigned long) sbuf.st_ctime;
948 + /* Does a message with given name exists (or was it removed)?
949 + * Returns: 1 - yes, such message exist,
950 + * 0 - No, that message does not exist anymore
952 + * Parameters: stream, name of mailbox, new name if his message does not
956 + int maildir_message_exists(MAILSTREAM *stream, char *name, char *newfile)
958 + char tmp[MAILTMPLEN];
964 + /* First check directly if it exists, if not there, look for it */
965 + snprintf(tmp, sizeof(tmp), "%s/%s", LOCAL->path[Cur], name);
966 + if ((stat(tmp, &sbuf) == 0) && ((sbuf.st_mode & S_IFMT) == S_IFREG))
969 + if (!(dir = opendir (LOCAL->path[Cur])))
972 + while ((d = readdir(dir)) && gotit == NIL){
973 + if (d->d_name[0] == '.')
975 + if (same_maildir_file(d->d_name, name)){
977 + strcpy(newfile, d->d_name);
986 + MAILSTREAM *maildir_open (MAILSTREAM *stream)
988 + char tmp[MAILTMPLEN];
991 + if (!stream) return &maildirproto;
992 + if (stream->local) fatal ("maildir recycle stream");
993 + md_domain_name(); /* get domain name for maildir files in mdlocaldomain */
994 + if(mypid == (pid_t) 0)
996 + if (!stream->rdonly){
997 + stream->perm_seen = stream->perm_deleted = stream->perm_flagged =
998 + stream->perm_answered = stream->perm_draft = T;
1000 + stream->local = (MAILDIRLOCAL *) fs_get (sizeof (MAILDIRLOCAL));
1001 + memset(LOCAL, 0, sizeof(MAILDIRLOCAL));
1004 + LOCAL->courier = IS_COURIER(stream->mailbox);
1005 + strcpy(tmp, stream->mailbox);
1006 + if (maildir_file_path (stream->mailbox, tmp, sizeof(tmp)))
1007 + LOCAL->dir = cpystr (tmp);
1008 + LOCAL->candouid = maildir_can_assign_uid(stream);
1009 + maildir_read_uid(stream, &stream->uid_last, &stream->uid_validity);
1011 + LOCAL->path = (char **) fs_get(EndDir*sizeof(char *));
1012 + MDFLD(tmp, LOCAL->dir, Cur); LOCAL->path[Cur] = cpystr (tmp);
1013 + MDFLD(tmp, LOCAL->dir, New); LOCAL->path[New] = cpystr (tmp);
1014 + MDFLD(tmp, LOCAL->dir, Tmp); LOCAL->path[Tmp] = cpystr (tmp);
1015 + if (stat (LOCAL->path[Cur],&sbuf) < 0) {
1016 + snprintf (tmp, sizeof(tmp), "Can't open folder %s: %s",
1017 + stream->mailbox,strerror (errno));
1018 + mm_log (tmp,ERROR);
1019 + maildir_close(stream, 0);
1024 + if(maildir_file_path (stream->mailbox, tmp, sizeof(tmp))){
1025 + fs_give ((void **) &stream->mailbox);
1026 + stream->mailbox = cpystr(tmp);
1029 + LOCAL->buf = (char *) fs_get (CHUNKSIZE);
1030 + LOCAL->buflen = CHUNKSIZE - 1;
1031 + stream->sequence++;
1032 + stream->nmsgs = stream->recent = 0L;
1034 + maildir_parse_folder(stream, 1);
1039 + /* Maildir initial parsing of the folder */
1041 + maildir_parse_folder (MAILSTREAM *stream, int full)
1043 + char tmp[MAILTMPLEN];
1044 + struct direct **namescur = NIL, **namesnew = NIL;
1045 + unsigned long i, nfilescur = 0L, nfilesnew = 0L, oldpos, newpos, total;
1046 + int scan_err, rescan, loop = 0;
1048 + if (!stream) /* what??? */
1051 + MM_CRITICAL(stream);
1053 + maildir_scandir (LOCAL->path[New], &namesnew, &nfilesnew, &scan_err, CCLIENT);
1055 + maildir_abort(stream);
1057 + /* Scan old messages first, escoba! */
1058 + if(stream->rdonly ||
1059 + (LOCAL && ((maildir_initial_check(stream, Cur) == 0)
1060 + || nfilesnew > 0L))){
1061 + LOCAL->scantime = maildir_scandir (LOCAL->path[Cur], &namescur, &nfilescur,
1062 + &scan_err, CCLIENT);
1063 + if (scan_err < 0){
1065 + for(i = 0L; i < nfilesnew; i++)
1066 + fs_give((void **)&namesnew[i]);
1067 + fs_give((void **) &namesnew);
1069 + maildir_abort(stream);
1072 + if(LOCAL && (maildir_initial_check(stream, New) == 0)
1073 + && (nfilescur > 0L)){
1074 + while(LOCAL && loop < 10){
1075 + if(nfilesnew == 0L)
1076 + maildir_scandir (LOCAL->path[New], &namesnew, &nfilesnew, &scan_err, CCLIENT);
1077 + if (scan_err < 0){
1079 + for(i = 0L; i < nfilesnew; i++)
1080 + fs_give((void **)&namesnew[i]);
1081 + fs_give((void **) &namesnew);
1083 + maildir_abort(stream);
1086 + for(i = 0L, rescan = 0, newpos = oldpos = 0L;
1087 + newpos < nfilescur && i < nfilesnew; i++){
1088 + if(maildir_message_in_list(namesnew[i]->d_name, namescur, oldpos,
1089 + nfilescur - 1L, &newpos)){
1091 + snprintf(tmp, sizeof(tmp), "%s/%s", LOCAL->path[New], namesnew[i]->d_name);
1092 + if(unlink(tmp) < 0)
1100 + maildir_abort(stream);
1103 + else{ /* restart */
1105 + for(i = 0L; i < nfilesnew; i++)
1106 + fs_give((void **)&namesnew[i]);
1107 + fs_give((void **) &namesnew);
1115 + maildir_abort(stream);
1117 + if(stream->rdonly)
1118 + stream->recent = 0L;
1119 + total = namescur || stream->rdonly
1120 + ? maildir_parse_dir(stream, 0L, Cur, namescur,
1121 + nfilescur, full) : stream->nmsgs;
1122 + stream->nmsgs = maildir_parse_dir(stream, total, New, namesnew,
1126 + for(i = 0L; i < nfilesnew; i++)
1127 + fs_give((void **)&namesnew[i]);
1128 + fs_give((void **) &namesnew);
1131 + for(i = 0L; i < nfilescur; i++)
1132 + fs_give((void **)&namescur[i]);
1133 + fs_give((void **) &namescur);
1135 + MM_NOCRITICAL(stream);
1139 + maildir_initial_check (MAILSTREAM *stream, DirNamesType dirtype)
1144 + if (access (LOCAL->path[dirtype], R_OK|W_OK|X_OK) != 0){
1145 + maildir_abort(stream);
1149 + if (dirtype != New &&
1150 + (stat(LOCAL->path[Cur], &sbuf) < 0 || sbuf.st_ctime == LOCAL->scantime))
1156 + /* Return the number of messages in the directory, while filling the
1161 + maildir_parse_dir(MAILSTREAM *stream, unsigned long nmsgs,
1162 + DirNamesType dirtype, struct direct **names,
1163 + unsigned long nfiles, int full)
1165 + char tmp[MAILTMPLEN], file[MAILTMPLEN], newfile[MAILTMPLEN], *mdstr;
1167 + unsigned long i, new = 0L, l, uid_last;
1168 + unsigned long recent = stream ? stream->recent : 0L;
1169 + int d = 0, f = 0, r = 0, s = 0, t = 0;
1170 + int we_compute, in_list;
1171 + int silent = stream ? stream->silent : NIL;
1172 + MESSAGECACHE *elt;
1174 + if (dirtype == Cur && !stream->rdonly)
1175 + for (i = 1L; i <= stream->nmsgs;){
1176 + elt = mail_elt(stream, i);
1177 + in_list = elt && elt->private.spare.ptr && nfiles > 0L
1178 + ? (MDPOS(elt) < nfiles
1179 + ? same_maildir_file(MDFILE(elt), names[MDPOS(elt)]->d_name)
1181 + || maildir_message_in_list(MDFILE(elt), names, 0L,
1182 + nfiles - 1L, &MDPOS(elt))
1185 + if (elt->private.spare.ptr)
1186 + maildir_free_file ((void **) &elt->private.spare.ptr);
1188 + if (elt->recent) --recent;
1189 + mail_expunged(stream,i);
1194 + stream->silent = T;
1196 + for (we_compute = 0, i = l = 1L; l <= nfiles; l++){
1197 + unsigned long pos, uid;
1198 + if (dirtype == New && !stream->rdonly){ /* move new messages to cur */
1200 + snprintf (file, sizeof(file), "%s/%s", LOCAL->path[New], names[pos]->d_name);
1201 + if(lstat(file,&sbuf) == 0)
1202 + switch(sbuf.st_mode & S_IFMT){
1204 + strcpy(tmp, names[pos]->d_name);
1205 + if((mdstr = strstr(tmp,MDSEP(3)))
1206 + || (mdstr = strstr(tmp,MDSEP(2))))
1209 + strcat(tmp, MDSEP(2));
1210 + snprintf(newfile, sizeof(newfile), "%s/%s", LOCAL->path[Cur], tmp);
1211 + if(rename (file, newfile) != 0){
1212 + mm_log("Unable to read new mail!", WARN);
1218 + case S_IFLNK: /* clean up, clean up, everybody, everywhere */
1219 + if(unlink(file) < 0){
1220 + if(LOCAL->link == NIL){
1221 + mm_log("Unable to remove symbolic link", WARN);
1228 + if(LOCAL && LOCAL->link == NIL){
1229 + mm_log("Unrecognized file or link in folder", WARN);
1236 + mail_exists(stream, i + nmsgs);
1237 + elt = mail_elt(stream, i + nmsgs);
1238 + pos = (elt && elt->private.spare.ptr) ? MDPOS(elt) : l - 1L;
1239 + if (dirtype == New) elt->recent = T;
1240 + maildir_getflag(names[pos]->d_name, &d, &f, &r ,&s, &t);
1241 + if (elt->private.spare.ptr)
1242 + maildir_free_file_only ((void **)&elt->private.spare.ptr);
1244 + maildir_get_file((MAILDIRFILE **)&elt->private.spare.ptr);
1247 + MDFILE(elt) = cpystr(names[pos]->d_name);
1249 + MDLOC(elt) = dirtype;
1250 + if (dirtype == Cur){ /* deal with UIDs */
1251 + if(elt->private.uid == 0L)
1252 + elt->private.uid = maildir_get_uid(MDFILE(elt));
1253 + if(elt->private.uid <= uid_last){
1254 + uid = (we_compute ? uid_last : stream->uid_last) + 1L;
1255 + if(LOCAL->candouid)
1256 + maildir_assign_uid(stream, i + nmsgs, uid);
1258 + elt->private.uid = uid;
1261 + uid = elt->private.uid;
1263 + if(uid_last > stream->uid_last)
1264 + stream->uid_last = uid_last;
1266 + if(dirtype == New && !stream->rdonly){
1267 + maildir_free_file_only((void **)&elt->private.spare.ptr);
1268 + MDFILE(elt) = cpystr(tmp);
1269 + MDSIZE(elt) = sbuf.st_size;
1270 + MDMTIME(elt) = sbuf.st_mtime;
1273 + if (elt->draft != d || elt->flagged != f ||
1274 + elt->answered != r || elt->seen != s || elt->deleted != t){
1275 + elt->draft = d; elt->flagged = f; elt->answered = r;
1276 + elt->seen = s; elt->deleted = t;
1277 + if (!we_compute && !stream->rdonly)
1278 + MM_FLAGS(stream, i+nmsgs);
1280 + maildir_get_date(stream, i+nmsgs);
1284 + stream->silent = silent;
1285 + if(LOCAL->candouid && dirtype == Cur)
1286 + maildir_read_uid(stream, NULL, &stream->uid_validity);
1287 + if (dirtype == New && stream->rdonly)
1289 + mail_exists(stream, nmsgs + ((dirtype == New) ? new : nfiles));
1290 + mail_recent(stream, recent + ((dirtype == New) ? new : 0L));
1292 + return (nmsgs + (dirtype == New ? new : nfiles));
1295 + long maildir_ping (MAILSTREAM *stream)
1297 + maildir_parse_folder(stream, 0);
1298 + if(stream && LOCAL){
1299 + if(LOCAL->candouid < 0)
1300 + LOCAL->candouid++;
1301 + else if(LOCAL->candouid)
1302 + maildir_uid_renew_tempfile(stream);
1303 + else /* try again to get uids */
1304 + LOCAL->candouid = maildir_can_assign_uid(stream);
1306 + return stream && LOCAL ? LONGT : NIL;
1309 + int maildir_select (const struct direct *name)
1311 + return (name->d_name[0] != '.');
1315 + * Unfortunately, there is no way to sort by arrival in this driver, this
1316 + * means that opening a folder in this driver using the scandir function
1317 + * will always make this driver slower than any driver that has a natural
1318 + * way of sorting by arrival (like a flat file format, "mbox", "mbx", etc).
1320 + int maildir_namesort (const struct direct **d1, const struct direct **d2)
1322 + const struct direct *e1 = *(const struct direct **) d1;
1323 + const struct direct *e2 = *(const struct direct **) d2;
1325 + return comp_maildir_file((char *) e1->d_name, (char *) e2->d_name);
1328 + /* Maildir close */
1330 + void maildir_close (MAILSTREAM *stream, long options)
1332 + MESSAGECACHE *elt;
1334 + int silent = stream ? stream->silent : 0;
1335 + mailcache_t mc = (mailcache_t) mail_parameters (NIL,GET_CACHE,NIL);
1337 + if (!stream) return;
1339 + for (i = 1L; i <= stream->nmsgs; i++)
1340 + if((elt = (MESSAGECACHE *) (*mc)(stream,i,CH_ELT)) && elt->private.spare.ptr)
1341 + maildir_free_file ((void **) &elt->private.spare.ptr);
1342 + stream->silent = T;
1343 + if (options & CL_EXPUNGE) maildir_expunge (stream, NIL, NIL);
1344 + maildir_abort(stream);
1345 + if (mdfpath) fs_give((void **)&mdfpath);
1346 + if (mypid) mypid = (pid_t) 0;
1347 + stream->silent = silent;
1350 + void maildir_check (MAILSTREAM *stream)
1352 + if (maildir_ping (stream)) mm_log ("Check completed",(long) NIL);
1355 + long maildir_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs, long flags)
1357 + char tmp[MAILTMPLEN];
1359 + MESSAGECACHE *elt;
1361 + /* UID call "impossible" */
1362 + if (flags & FT_UID || !LOCAL) return NIL;
1363 + elt = mail_elt (stream, msgno);
1365 + if (!(flags & FT_PEEK) && !elt->seen){
1367 + maildir_flagmsg (stream, elt);
1368 + MM_FLAGS(stream, elt->msgno);
1371 + MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
1372 + if (LOCAL->fd < 0) /* if file closed ? */
1373 + LOCAL->fd = open(tmp,O_RDONLY,NIL);
1375 + if (LOCAL->fd < 0 && (errno == EACCES || errno == ENOENT)){
1376 + INIT (bs, mail_string, "", 0);
1377 + elt->rfc822_size = 0L;
1381 + s = maildir_text_work(stream, elt, &i, flags);
1382 + INIT (bs, mail_string, s, i);
1386 + char *maildir_text_work (MAILSTREAM *stream,MESSAGECACHE *elt,
1387 + unsigned long *length,long flags)
1391 + char *s,tmp[CHUNK];
1392 + unsigned long msgno = elt->msgno;
1393 + static int try = 0;
1397 + LOCAL->buf[0] = '\0';
1399 + MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
1400 + if (LOCAL->fd < 0) /* if file closed ? */
1401 + LOCAL->fd = open(tmp,O_RDONLY,NIL);
1403 + if (LOCAL->fd < 0){ /* flag change? */
1406 + if (maildir_update_elt_maildirp(stream, msgno) > 0)
1408 + return maildir_text_work(stream, mail_elt(stream, msgno),length, flags);
1414 + lseek (LOCAL->fd, elt->private.msg.text.offset,L_SET);
1416 + if (flags & FT_INTERNAL) { /* initial data OK? */
1417 + if (elt->private.msg.text.text.size > LOCAL->buflen) {
1418 + fs_give ((void **) &LOCAL->buf);
1419 + LOCAL->buf = (char *) fs_get ((LOCAL->buflen =
1420 + elt->private.msg.text.text.size) + 1);
1422 + read (LOCAL->fd,LOCAL->buf,elt->private.msg.text.text.size);
1423 + LOCAL->buf[*length = elt->private.msg.text.text.size] = '\0';
1426 + if (elt->rfc822_size > LOCAL->buflen) {
1427 + fs_give ((void **) &LOCAL->buf);
1428 + LOCAL->buf = (char *) fs_get ((LOCAL->buflen = elt->rfc822_size) + 1);
1430 + d.fd = LOCAL->fd; /* yes, set up file descriptor */
1431 + d.pos = elt->private.msg.text.offset;
1432 + d.chunk = tmp; /* initial buffer chunk */
1433 + d.chunksize = CHUNK;
1434 + INIT (&bs,fd_string,&d,elt->private.msg.text.text.size);
1435 + for (s = LOCAL->buf; SIZE (&bs);) switch (CHR (&bs)) {
1436 + case '\r': /* carriage return seen */
1437 + *s++ = SNX (&bs); /* copy it and any succeeding LF */
1438 + if (SIZE (&bs) && (CHR (&bs) == '\n')) *s++ = SNX (&bs);
1441 + *s++ = '\r'; /* insert a CR */
1443 + *s++ = SNX (&bs); /* copy characters */
1445 + *s = '\0'; /* tie off buffer */
1446 + *length = s - (char *) LOCAL->buf; /* calculate length */
1448 + close(LOCAL->fd); LOCAL->fd = -1;
1449 + return LOCAL->buf;
1452 + /* maildir parse, fill the elt structure... well not all of it... */
1453 + unsigned long maildir_parse_message(MAILSTREAM *stream, unsigned long msgno,
1454 + DirNamesType dirtype)
1456 + char *b, *s, *t, c;
1457 + char tmp[MAILTMPLEN];
1459 + unsigned long i, len;
1460 + int d, f, r, se, dt;
1461 + MESSAGECACHE *elt;
1463 + elt = mail_elt (stream,msgno);
1464 + MSGPATH(tmp, LOCAL->dir, MDFILE(elt), dirtype);
1465 + if(stat(tmp, &sbuf) == 0)
1466 + MDSIZE(elt) = sbuf.st_size;
1468 + maildir_get_date(stream, msgno);
1469 + maildir_getflag(MDFILE(elt), &d, &f, &r ,&se, &dt);
1470 + elt->draft = d; elt->flagged = f; elt->answered = r; elt->seen = se;
1471 + elt->deleted = dt; elt->valid = T;
1472 + if (LOCAL->fd < 0) /* if file closed ? */
1473 + LOCAL->fd = open(tmp,O_RDONLY,NIL);
1475 + if (LOCAL->fd >= 0){
1476 + s = (char *) fs_get (MDSIZE(elt) + 1);
1477 + read (LOCAL->fd,s,MDSIZE(elt));
1478 + s[MDSIZE(elt)] = '\0';
1479 + t = s + strlen(s); /* make t point to the end of s */
1480 + for (i = 0L, b = s; b < t && !(i && (*b == '\n')); i = (*b++ == '\n'));
1481 + len = (*b ? ++b : b) - s;
1482 + elt->private.msg.header.text.size =
1483 + elt->private.msg.text.offset = len;
1484 + elt->private.msg.text.text.size = MDSIZE(elt) - len;
1485 + for (i = 0L, b = s, c = *b; b &&
1486 + ((c < '\016' && ((c == '\012' && ++i)
1487 + ||(c == '\015' && *(b+1) == '\012' && ++b && (i +=2))))
1488 + || b < t); i++, c= *++b);
1489 + elt->rfc822_size = i;
1490 + fs_give ((void **) &s);
1491 + close(LOCAL->fd); LOCAL->fd = -1;
1493 + return elt->rfc822_size;
1497 + maildir_update_elt_maildirp(MAILSTREAM *stream, unsigned long msgno)
1499 + struct direct **names = NIL;
1500 + unsigned long i, nfiles, pos;
1501 + int d = 0, f = 0 , r = 0, s = 0, t = 0, in_list, scan_err;
1502 + MESSAGECACHE *elt;
1504 + maildir_scandir (LOCAL->path[Cur], &names, &nfiles, &scan_err, CCLIENT);
1506 + elt = mail_elt (stream,msgno);
1508 + in_list = nfiles > 0L
1509 + ? maildir_message_in_list(MDFILE(elt), names, 0L, nfiles - 1L, &pos)
1512 + if (in_list && pos >= 0L && pos < nfiles
1513 + && !strcmp(MDFILE(elt), names[pos]->d_name)){
1515 + maildir_abort(stream);
1518 + if (in_list && pos >= 0L && pos < nfiles){
1519 + maildir_free_file_only((void **)&elt->private.spare.ptr);
1520 + MDFILE(elt) = cpystr(names[pos]->d_name);
1521 + maildir_getflag(MDFILE(elt), &d, &f, &r ,&s, &t);
1522 + if (elt->draft != d || elt->flagged != f ||
1523 + elt->answered != r || elt->seen != s || elt->deleted != t){
1524 + elt->draft = d; elt->flagged = f; elt->answered = r;
1525 + elt->seen = s; elt->deleted = t;
1526 + MM_FLAGS(stream, msgno);
1529 + for (i = 0L; i < nfiles; i++)
1530 + fs_give((void **) &names[i]);
1532 + fs_give((void **) &names);
1533 + return in_list ? 1 : -1;
1536 + /* Maildir fetch message header */
1538 + char *maildir_header (MAILSTREAM *stream,unsigned long msgno,
1539 + unsigned long *length, long flags)
1541 + char tmp[MAILTMPLEN], *s;
1542 + MESSAGECACHE *elt;
1543 + static int try = 0;
1545 + if (length) *length = 0;
1546 + if (flags & FT_UID || !LOCAL) return ""; /* UID call "impossible" */
1547 + elt = mail_elt (stream,msgno);
1548 + if(elt->private.msg.header.text.size == 0)
1549 + maildir_parse_message(stream, msgno, MDLOC(elt));
1551 + MSGPATH(tmp, LOCAL->dir, MDFILE(elt), MDLOC(elt));
1552 + if (LOCAL->fd < 0)
1553 + LOCAL->fd = open (tmp,O_RDONLY,NIL);
1555 + if (LOCAL->fd < 0 && errno == EACCES){
1556 + mm_log ("Message exists but can not be read. Envelope and body lost!",ERROR);
1560 + if (LOCAL->fd < 0){ /* flag change? */
1563 + if (maildir_update_elt_maildirp(stream, msgno) > 0)
1565 + return maildir_header(stream, msgno, length, flags);
1571 + if (flags & FT_INTERNAL){
1572 + if(elt->private.msg.header.text.size > LOCAL->buflen){
1573 + fs_give ((void **) &LOCAL->buf);
1574 + LOCAL->buf = (char *) fs_get ((LOCAL->buflen =
1575 + elt->private.msg.header.text.size) + 1);
1577 + read (LOCAL->fd, (void *)LOCAL->buf, elt->private.msg.header.text.size);
1578 + LOCAL->buf[*length = elt->private.msg.header.text.size] = '\0';
1581 + s = (char *) fs_get(elt->private.msg.header.text.size+1);
1582 + read (LOCAL->fd, (void *)s, elt->private.msg.header.text.size);
1583 + s[elt->private.msg.header.text.size] = '\0';
1584 + *length = strcrlfcpy (&LOCAL->buf,&LOCAL->buflen,s,
1585 + elt->private.msg.header.text.size);
1586 + fs_give ((void **) &s);
1588 + elt->private.msg.text.offset = elt->private.msg.header.text.size;
1589 + elt->private.msg.text.text.size = MDSIZE(elt) - elt->private.msg.text.offset;
1590 + close(LOCAL->fd); LOCAL->fd = -1;
1591 + return LOCAL->buf;
1594 + /* Maildir find list of subscribed mailboxes
1595 + * Accepts: mail stream
1596 + * pattern to search
1599 + void maildir_list (MAILSTREAM *stream,char *ref, char *pat)
1601 + char *s,test[MAILTMPLEN],file[MAILTMPLEN];
1604 + if((!pat || !*pat) && maildir_canonicalize (test,ref,"*")
1605 + && maildir_valid_name(test)){ /* there is a #md/ leading here */
1606 + for (i = 3L; test[i] && test[i] != '/'; i++);
1607 + if ((s = strchr (test+i+1,'/')) != NULL) *++s = '\0';
1608 + else test[0] = '\0';
1609 + mm_list (stream,'/',test, LATT_NOSELECT);
1611 + else if (maildir_canonicalize (test,ref,pat)) {
1612 + if (test[3] == '/') { /* looking down levels? */
1613 + /* yes, found any wildcards? */
1614 + if ((s = strpbrk (test,"%*")) != NULL){
1615 + /* yes, copy name up to that point */
1616 + strncpy (file,test+4,i = s - (test+4));
1617 + file[i] = '\0'; /* tie off */
1619 + else strcpy (file,test+4);/* use just that name then */
1620 + /* find directory name */
1621 + if ((s = strrchr (file, '/')) != NULL){
1622 + *s = '\0'; /* found, tie off at that point */
1626 + if(IS_COURIER(test))
1627 + courier_list_work (stream,s,test,0);
1629 + maildir_list_work (stream,s,test,0);
1631 + /* always an INBOX */
1632 + if (!compare_cstring (test,"#MD/INBOX"))
1633 + mm_list (stream,NIL,"#MD/INBOX",LATT_NOINFERIORS);
1634 + if (!compare_cstring (test,"#MC/INBOX"))
1635 + mm_list (stream,NIL,"#MC/INBOX",LATT_NOINFERIORS);
1639 + void courier_list (MAILSTREAM *stream,char *ref, char *pat)
1641 + /* I am too lazy to do anything. Do you care to ask maildir list, please?
1642 + The real reason why this is a dummy function is because we do not want to
1643 + see the same folder listed twice.
1647 + /* For those that want to hide things, we give them a chance to do so */
1648 + void *maildir_parameters (long function, void *value)
1651 + switch ((int) function) {
1652 + case SET_MDINBOXPATH:
1653 + if(strlen((char *) value ) > 49)
1654 + strcpy(myMdInboxDir, "Maildir");
1656 + strcpy(myMdInboxDir, (char *) value);
1657 + case GET_MDINBOXPATH:
1658 + if (myMdInboxDir[0] == '\0') strcpy(myMdInboxDir,"Maildir");
1659 + ret = (void *) myMdInboxDir;
1661 + case SET_COURIERSTYLE:
1662 + CourierStyle = (long) value;
1663 + case GET_COURIERSTYLE:
1664 + ret = (void *) CourierStyle;
1666 + case GET_DIRFMTTEST:
1667 + ret = (void *) maildir_dirfmttest;
1675 + int maildir_create_folder(char *mailbox)
1677 + char tmp[MAILTMPLEN], err[MAILTMPLEN];
1680 + for (i = Cur; i != EndDir; i++){
1681 + MDFLD(tmp, mailbox, i);
1682 + if (mkdir(tmp, 0700) && errno != EEXIST){ /* try to make new dir */
1683 + snprintf (err, sizeof(err), "Can't create %s: %s", tmp, strerror(errno));
1684 + mm_log (err,ERROR);
1691 + int maildir_create_work(char *mailbox, int loop)
1693 + char *s, c, err[MAILTMPLEN], tmp[MAILTMPLEN], tmp2[MAILTMPLEN], mbx[MAILTMPLEN];
1694 + int fnlen, create_dir = 0, courier, mv;
1696 + long style = *(long *) maildir_parameters(GET_COURIERSTYLE, NIL);
1698 + courier = IS_COURIER(mailbox);
1699 + strcpy(mbx, mailbox);
1700 + mv = maildir_valid(mbx) ? 1 : 0;
1701 + maildir_file_path(mailbox, tmp, sizeof(tmp));
1702 + if (mailbox[strlen(mailbox) - 1] == MDSEPARATOR(courier)){
1704 + mailbox[strlen(mailbox) - 1] = '\0';
1707 + if(!loop && courier){
1710 + if(style == CCLIENT)
1711 + strcpy (err,"Can not create directory: folder exists. Create subfolder");
1713 + strcpy(err,"Folder and Directory already exist");
1716 + strcpy (err, "Can't create mailbox: mailbox already exists");
1720 + strcpy(err, "Can not create directory. Cread folder instead");
1725 + mm_log (err,ERROR);
1730 + fnlen = strlen(tmp);
1731 + if ((s = strrchr(mailbox,MDSEPARATOR(courier))) != NULL){
1734 + if ((stat(tmp,&sbuf) || ((sbuf.st_mode & S_IFMT) != S_IFDIR)) &&
1735 + !maildir_create_work (mailbox, ++loop))
1739 + tmp[fnlen] = '\0';
1741 + if (mkdir(tmp,0700) && errno != EEXIST)
1745 + mailbox[fnlen] = '/';
1748 + if(style == CCLIENT){
1751 + snprintf(tmp2, sizeof(tmp2), "%s%s", tmp, MDDIR);
1752 + if ((fp = fopen(tmp2,"w")) == NULL){
1753 + snprintf (err, sizeof(err), "Problem creating %s: %s", tmp2, strerror(errno));
1754 + mm_log (err,ERROR);
1763 + return maildir_create_folder(tmp);
1766 + long maildir_create (MAILSTREAM *stream,char *mailbox)
1768 + char tmp[MAILTMPLEN], err[MAILTMPLEN];
1769 + int rv, create_dir;
1771 + create_dir = mailbox ?
1772 + (mailbox[strlen(mailbox) - 1] ==
1773 + MDSEPARATOR(IS_COURIER(mailbox))) : 0;
1774 + maildir_file_path(mailbox, tmp, sizeof(tmp));
1775 + strcpy(tmp, mailbox);
1776 + rv = maildir_create_work(mailbox, 0);
1777 + strcpy(mailbox, tmp);
1779 + snprintf (err, sizeof(err), "Can't create %s %s",
1780 + (create_dir ? "directory" : "mailbox"), mailbox);
1781 + mm_log (err,ERROR);
1783 + return rv ? LONGT : NIL;
1786 + #define MAXTRY 10000
1787 + void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt)
1789 + char oldfile[MAILTMPLEN],newfile[MAILTMPLEN],fn[MAILTMPLEN];
1794 + for (try = 1; try > 0 && try < MAXTRY; try++){
1795 + /* build the new filename */
1796 + snprintf (oldfile, sizeof(oldfile), "%s/%s",LOCAL->path[Cur], MDFILE(elt));
1798 + if ((ren = maildir_message_exists(stream, MDFILE(elt), fn)) == 0){
1802 + if (*fn) /* new oldfile! */
1803 + snprintf (oldfile,sizeof(oldfile),"%s/%s", LOCAL->path[Cur], fn);
1804 + if ((s = strrchr (MDFILE(elt), FLAGSEP))) *s = '\0';
1805 + snprintf (fn, sizeof(fn), "%s%s%s%s%s%s%s", MDFILE(elt), MDSEP(2),
1806 + MDFLAG(Draft, elt->draft), MDFLAG(Flagged, elt->flagged),
1807 + MDFLAG(Replied, elt->answered), MDFLAG(Seen, elt->seen),
1808 + MDFLAG(Trashed, elt->deleted));
1809 + snprintf (newfile, sizeof(newfile), "%s/%s",LOCAL->path[Cur],fn);
1810 + if (ren != 0 && rename (oldfile,newfile) >= 0)
1815 + snprintf(oldfile, sizeof(oldfile), "Unable to write flags to disk: %s",
1816 + (errno == ENOENT) ? "message is gone!" : strerror (errno));
1817 + mm_log(oldfile,ERROR);
1821 + utime(LOCAL->path[Cur], NIL); /* make sure next scan will catch the change */
1823 + maildir_free_file_only ((void **) &elt->private.spare.ptr);
1824 + MDFILE(elt) = cpystr (fn);
1828 + long maildir_expunge (MAILSTREAM *stream, char *sequence, long options)
1831 + MESSAGECACHE *elt;
1832 + unsigned long i, n = 0L;
1833 + unsigned long recent = stream->recent;
1834 + char tmp[MAILTMPLEN];
1836 + mm_critical (stream); /* go critical */
1837 + ret = sequence ? ((options & EX_UID) ?
1838 + mail_uid_sequence (stream,sequence) :
1839 + mail_sequence (stream,sequence)) : LONGT;
1842 + for (i = 1L; i <= stream->nmsgs;){
1843 + elt = mail_elt (stream,i);
1844 + if (elt->deleted && (sequence ? elt->sequence : T)){
1845 + snprintf (tmp, sizeof(tmp), "%s/%s", LOCAL->path[Cur], MDFILE(elt));
1846 + if (unlink (tmp) < 0) {/* try to delete the message */
1847 + snprintf (tmp, sizeof(tmp), "Expunge of message %ld failed, aborted: %s",i,
1848 + strerror (errno));
1849 + if (!stream->silent)
1850 + mm_log (tmp,WARN);
1853 + if (elt->private.spare.ptr)
1854 + maildir_free_file ((void **) &elt->private.spare.ptr);
1855 + if (elt->recent) --recent;/* if recent, note one less recent message */
1856 + mail_expunged (stream,i); /* notify upper levels */
1857 + n++; /* count up one more expunged message */
1861 + if(n){ /* output the news if any expunged */
1862 + snprintf (tmp, sizeof(tmp), "Expunged %ld messages", n);
1863 + if (!stream->silent)
1864 + mm_log (tmp,(long) NIL);
1867 + if (!stream->silent)
1868 + mm_log ("No messages deleted, so no update needed",(long) NIL);
1869 + mm_nocritical (stream); /* release critical */
1870 + /* notify upper level of new mailbox size */
1871 + mail_exists (stream, stream->nmsgs);
1872 + mail_recent (stream, recent);
1876 + long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options)
1879 + MESSAGECACHE *elt;
1880 + unsigned long len;
1884 + char tmp[MAILTMPLEN], flags[MAILTMPLEN], path[MAILTMPLEN], *s;
1885 + /* copy the messages */
1886 + if ((options & CP_UID) ? mail_uid_sequence (stream, sequence) :
1887 + mail_sequence (stream,sequence))
1888 + for (i = 1L; i <= stream->nmsgs; i++)
1889 + if ((elt = mail_elt (stream,i))->sequence){
1890 + MSGPATH(path, LOCAL->dir, MDFILE(elt), MDLOC(elt));
1891 + if (((fd = open (path,O_RDONLY,NIL)) < 0)
1892 + ||((!elt->rfc822_size &&
1893 + ((stat(path, &sbuf) < 0) || !S_ISREG (sbuf.st_mode)))))
1895 + if(!elt->rfc822_size)
1896 + MDSIZE(elt) = sbuf.st_size;
1897 + s = (char *) fs_get(MDSIZE(elt) + 1);
1898 + read (fd,s,MDSIZE(elt));
1899 + s[MDSIZE(elt)] = '\0';
1901 + len = strcrlfcpy (&LOCAL->buf,&LOCAL->buflen, s, MDSIZE(elt));
1902 + INIT (&st,mail_string, LOCAL->buf, len);
1903 + elt->rfc822_size = len;
1904 + fs_give ((void **)&s);
1906 + flags[0] = flags[1] = '\0';
1907 + if (elt->seen) strcat (flags," \\Seen");
1908 + if (elt->draft) strcat (flags," \\Draft");
1909 + if (elt->deleted) strcat (flags," \\Deleted");
1910 + if (elt->flagged) strcat (flags," \\Flagged");
1911 + if (elt->answered) strcat (flags," \\Answered");
1912 + flags[0] = '('; /* open list */
1913 + strcat (flags,")"); /* close list */
1914 + mail_date (tmp,elt); /* generate internal date */
1915 + if (!mail_append_full (NIL, mailbox, flags, tmp, &st))
1917 + if (options & CP_MOVE) elt->deleted = T;
1919 + return LONGT; /* return success */
1922 + long maildir_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data)
1924 + int fd, k, done, fail;
1926 + char c,*s, *flags, *date;
1927 + char tmp[MAILTMPLEN],file[MAILTMPLEN],path1[MAILTMPLEN],path2[MAILTMPLEN];
1929 + long i, size = 0L, ret = LONGT, f;
1930 + unsigned long uf, ti;
1931 + static unsigned int transact = 0;
1934 + if (!maildir_valid(mailbox)) {
1935 + snprintf (tmp, sizeof(tmp), "Not a valid Maildir mailbox: %s", mailbox);
1936 + mm_log (tmp,ERROR);
1940 + if (!*mdlocaldomain)
1941 + md_domain_name(); /* get domain name for maildir files in mdlocaldomain now! */
1943 + if (mypid == (pid_t) 0)
1947 + stream = &maildirproto;
1949 + for (k = 0; k < NUSERFLAGS && stream->user_flags[k]; ++k)
1950 + fs_give ((void **) &stream->user_flags[k]);
1953 + if (!(*af)(stream, data, &flags, &date, &message)) return NIL;
1955 + mm_critical (stream); /* go critical */
1957 + fail = done = 0; /* we have not determined name of message file yet */
1958 + if (!SIZE (message)) { /* guard against zero-length */
1959 + mm_log ("Append of zero-length message", ERROR);
1964 + if (date && !mail_parse_date(&elt,date)){
1965 + snprintf (tmp, sizeof(tmp), "Bad date in append: %.80s", date);
1966 + mm_log (tmp, ERROR);
1974 + tm.tm_sec = elt.seconds;
1975 + tm.tm_min = elt.minutes;
1976 + tm.tm_hour = elt.hours;
1977 + tm.tm_mday = elt.day;
1978 + tm.tm_mon = elt.month - 1;
1979 + tm.tm_year = BASEYEAR + elt.year - 1900;
1982 + } else ti = time(0);
1984 + f = mail_parse_flags (stream,flags,&uf);
1986 + /* build file name we will use */
1987 + snprintf (file, sizeof(file), "%lu.%d_%09u.%s%s%s%s%s%s",
1988 + ti, mypid, transact++, mdlocaldomain, (f ? MDSEP(2) : ""),
1989 + MDFLAG(Draft, f&fDRAFT), MDFLAG(Flagged, f&fFLAGGED),
1990 + MDFLAG(Replied, f&fANSWERED), MDFLAG(Seen, f&fSEEN));
1991 + /* build tmp file name */
1992 + if (maildir_file_path(mailbox, tmp, sizeof(tmp))) /* copy in TMP */
1993 + MSGPATH(path1, tmp, file, Tmp);
1994 + /* build final filename to use */
1995 + if (maildir_file_path(mailbox, tmp, sizeof(tmp)))
1996 + MSGPATH(path2, tmp, file, New); /* copy in NEW */
1997 + if(stat(path1, &sbuf) < 0 && errno == ENOENT
1998 + && stat(path2, &sbuf) < 0 && errno == ENOENT)
2003 + snprintf (tmp, sizeof(tmp), "Failure to create append message name");
2004 + mm_log (tmp, ERROR);
2007 + } while (done == 0);
2009 + if ((fd = open (path1,O_WRONLY|O_CREAT|O_EXCL,S_IREAD|S_IWRITE)) < 0) {
2010 + snprintf (tmp, sizeof(tmp), "Can't open append mailbox: %s", strerror (errno));
2011 + mm_log (tmp, ERROR);
2014 + for (size = 0,i = SIZE (message),s = (char *) fs_get (i + 1); i; --i)
2015 + if ((c = SNX (message)) != '\015') s[size++] = c;
2016 + if ((write (fd, s, size) < 0) || fsync (fd)) {
2017 + unlink (path1); /* delete message */
2018 + snprintf (tmp, sizeof(tmp), "Message append failed: %s", strerror (errno));
2019 + mm_log (tmp, ERROR);
2022 + fs_give ((void **) &s); /* flush the buffer */
2023 + close (fd); /* close the file */
2025 + if (rename (path1,path2) < 0) {
2026 + snprintf (tmp, sizeof(tmp), "Message append failed: %s", strerror (errno));
2027 + mm_log (tmp, ERROR);
2033 + tp[0] = tp[1] = ti;
2038 + if (!(*af) (stream,data,&flags,&date,&message)) ret = NIL;
2040 + } while (ret && message); /* write the data */
2041 + mm_nocritical (stream); /* release critical */
2045 + long maildir_delete (MAILSTREAM *stream,char *mailbox)
2049 + int i, remove_dir = 0, mddir = 0, rv, error = 0;
2050 + char tmp[MAILTMPLEN],tmp2[MAILTMPLEN], realname[MAILTMPLEN];
2052 + int courier = IS_COURIER(mailbox);
2054 + if (mailbox[strlen(mailbox) - 1] == MDSEPARATOR(courier)){
2056 + mailbox[strlen(mailbox) -1] = '\0';
2059 + if (!maildir_valid(mailbox)){
2060 + maildir_file_path(mailbox, tmp, sizeof(tmp));
2061 + if (stat(tmp, &sbuf) < 0 || !S_ISDIR(sbuf.st_mode)){
2062 + snprintf(tmp, sizeof(tmp), "Can not remove %s", mailbox);
2067 + if (!error && remove_dir && !maildir_dir_is_empty(mailbox)){
2068 + snprintf(tmp, sizeof(tmp), "Can not remove directory %s/: directory not empty", mailbox);
2073 + mm_log (tmp,ERROR);
2077 + maildir_close(stream,0); /* even if stream was NULL */
2079 + maildir_file_path(mailbox, realname, sizeof(realname));
2082 + snprintf(tmp, sizeof(tmp), "%s/%s", realname, MDDIR);
2083 + if ((rv = stat (tmp,&sbuf)) == 0 && S_ISREG(sbuf.st_mode))
2085 + else if (errno == ENOENT)
2088 + snprintf(tmp, sizeof(tmp), "Can not remove %s/%s: %s", tmp2, MDDIR, strerror(errno));
2089 + mm_log (tmp,ERROR);
2092 + if (!maildir_valid(realname) && rmdir(realname) != 0){
2093 + snprintf(tmp, sizeof(tmp), "Can not remove %s/: %s", mailbox, strerror(errno));
2094 + mm_log (tmp, ERROR);
2099 + /* else remove just the folder. Remove all hidden files, except MDDIR */
2100 + for (i = Cur; i != EndDir; i++){
2101 + MDFLD(tmp, realname, i);
2103 + if (!(dirp = opendir (tmp))){
2104 + snprintf(tmp, sizeof(tmp), "Can not read %s/: %s", mailbox, strerror(errno));
2105 + mm_log (tmp, ERROR);
2109 + while ((d = readdir(dirp)) != NULL){
2110 + if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")){
2111 + snprintf(tmp2, sizeof(tmp2), "%s/%s", tmp, d->d_name);
2112 + if (unlink(tmp2) != 0){
2113 + snprintf(tmp2, sizeof(tmp2), "Can not remove %s: %s", mailbox, strerror(errno));
2114 + mm_log (tmp2, ERROR);
2120 + if (rmdir(tmp) != 0){
2121 + snprintf(tmp, sizeof(tmp), "Can not remove %s: %s", mailbox, strerror(errno));
2122 + mm_log (tmp, ERROR);
2127 + * ok we have removed all subdirectories of the folder mailbox, Remove the
2131 + if(!(dirp = opendir (realname))){
2132 + snprintf(tmp, sizeof(tmp), "Can not read %s/: %s", realname, strerror(errno));
2133 + mm_log (tmp, ERROR);
2137 + while ((d = readdir(dirp)) != NULL){
2138 + if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
2139 + && (!strcmp(d->d_name, MDDIR)
2140 + || !strncmp(d->d_name, MDUIDLAST, strlen(MDUIDLAST))
2141 + || !strncmp(d->d_name, MDUIDTEMP, strlen(MDUIDTEMP))
2142 + || !strcmp(d->d_name, "courierimapacl")
2143 + || !strcmp(d->d_name, "courierimapuiddb")
2144 + || !strcmp(d->d_name, "dovecot.index")
2145 + || !strcmp(d->d_name, "dovecot.index.cache")
2146 + || !strcmp(d->d_name, "dovecot-keywords")
2147 + || !strcmp(d->d_name, "dovecot-uidlist")
2148 + || !strcmp(d->d_name, "subscriptions")
2149 + || !strcmp(d->d_name, "maildirfolder")
2150 + || !strncmp(d->d_name, "dovecot.index.log", 17)
2151 + || !strncmp(d->d_name, "dovecot.mailbox.log", 19)
2152 + || !strncmp(d->d_name, "dovecot-uidvalidity", 19))){
2153 + if(strcmp(d->d_name, MDDIR) == 0)
2155 + snprintf(tmp, sizeof(tmp), "%s/%s", realname, d->d_name);
2156 + if (unlink(tmp) != 0)
2162 + (maildir_dir_is_empty(mailbox) && mddir == 0 && rmdir(realname) < 0)){
2163 + snprintf(tmp, sizeof(tmp), "Can not remove folder %s: %s", mailbox, strerror(errno));
2164 + mm_log (tmp, ERROR);
2170 + long maildir_rename (MAILSTREAM *stream, char *old, char *new)
2172 + char tmp[MAILTMPLEN], tmpnew[MAILTMPLEN], realold[MAILTMPLEN];
2173 + char realnew[MAILTMPLEN];
2174 + int courier = IS_COURIER(old) && IS_COURIER(new);
2179 + if((IS_COURIER(old) || IS_COURIER(new)) && !courier){
2180 + snprintf (tmp, sizeof(tmp), "Can't rename mailbox %s to %s", old, new);
2181 + mm_log (tmp, ERROR);
2185 + if (!maildir_valid(old)){
2186 + snprintf (tmp, sizeof(tmp), "Can't rename mailbox %s: folder not in maildir format",old);
2187 + mm_log (tmp, ERROR);
2190 + maildir_file_path(old, realold, sizeof(realold));
2191 + if (!maildir_valid_name(new) && new[0] == '#'){
2192 + snprintf (tmp, sizeof(tmp), "Cannot rename mailbox %s: folder not in maildir format", new);
2193 + mm_log (tmp, ERROR);
2196 + maildir_file_path(new, realnew, sizeof(realnew));
2197 + if (access(tmpnew,F_OK) == 0){ /* new mailbox name must not exist */
2198 + snprintf (tmp, sizeof(tmp), "Cannot rename to mailbox %s: destination already exists", new);
2199 + mm_log (tmp, ERROR);
2204 + if (rename(realold, realnew)){ /* try to rename the directory */
2205 + snprintf(tmp, sizeof(tmp), "Can't rename mailbox %s to %s: %s", old, new,
2207 + mm_log(tmp,ERROR);
2210 + return LONGT; /* return success */
2213 + cdir = courier_list_dir(old);
2214 + for (i = 0; cdir && i < cdir->total; i++){
2215 + if(strstr(cdir->data[i]->name, old)){
2216 + snprintf(tmp, sizeof(tmp), "%s%s", new, cdir->data[i]->name+strlen(old));
2217 + maildir_file_path(cdir->data[i]->name, realold, sizeof(realold));
2218 + maildir_file_path(tmp, realnew, sizeof(realnew));
2219 + if (rename(realold, realnew)){
2220 + snprintf (tmp, sizeof(tmp), "Can't rename mailbox %s to %s: %s", old, new,
2222 + mm_log(tmp,ERROR);
2227 + courier_free_cdir(&cdir);
2231 + long maildir_sub(MAILSTREAM *stream,char *mailbox)
2233 + return sm_subscribe(mailbox);
2236 + long maildir_unsub(MAILSTREAM *stream,char *mailbox)
2238 + return sm_unsubscribe(mailbox);
2241 + void maildir_lsub (MAILSTREAM *stream,char *ref,char *pat)
2244 + char *s, test[MAILTMPLEN], tmp[MAILTMPLEN];
2245 + /* get canonical form of name */
2246 + if (maildir_canonicalize (test, ref, pat) && (s = sm_read (tmp, &sdb))) {
2247 + do if (pmatch_full (s, test, '/')) mm_lsub (stream, '/', s, NIL);
2248 + while ((s = sm_read (tmp, &sdb)) != NULL); /* until no more subscriptions */
2252 + long maildir_canonicalize (char *pattern,char *ref,char *pat)
2254 + if (ref && *ref) { /* have a reference */
2255 + strcpy (pattern,ref); /* copy reference to pattern */
2256 + /* # overrides mailbox field in reference */
2257 + if (*pat == '#') strcpy (pattern,pat);
2258 + /* pattern starts, reference ends, with / */
2259 + else if ((*pat == '/') && (pattern[strlen (pattern) - 1] == '/'))
2260 + strcat (pattern,pat + 1); /* append, omitting one of the period */
2262 + else strcat (pattern,pat); /* anything else is just appended */
2264 + else strcpy (pattern,pat); /* just have basic name */
2265 + return maildir_valid_name(pattern) ? LONGT : NIL;
2268 + void maildir_list_work (MAILSTREAM *stream,char *dir,char *pat,long level)
2273 + char curdir[MAILTMPLEN],name[MAILTMPLEN], tmp[MAILTMPLEN];
2274 + char realpat[MAILTMPLEN];
2276 + char *maildirpath = mdirpath();
2278 + snprintf(curdir, sizeof(curdir), "%s/%s/", myrootdir(pat), dir ? dir : maildirpath);
2279 + if ((dp = opendir (curdir)) != NULL){
2280 + if (dir) snprintf (name, sizeof(name), "%s%s/",MDPREFIX(CCLIENT),dir);
2281 + else strcpy (name, pat);
2283 + if (level == 0 && !strpbrk(pat,"%*")){
2284 + if(maildir_valid(pat)){
2285 + i = maildir_contains_folder(pat, NULL)
2286 + ? LATT_HASCHILDREN
2287 + : (maildir_is_dir(pat, NULL)
2288 + ? LATT_HASNOCHILDREN : LATT_NOINFERIORS);
2289 + maildir_file_path(pat, realpat, sizeof(realpat));
2290 + i += maildir_any_new_msgs(realpat)
2291 + ? LATT_MARKED : LATT_UNMARKED;
2292 + mm_list (stream,'/', pat, i);
2295 + if(pat[strlen(pat) - 1] == '/')
2296 + mm_list (stream,'/', pat, LATT_NOSELECT);
2299 + while ((d = readdir (dp)) != NULL)
2300 + if(strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
2301 + && strcmp(d->d_name, MDNAME(Cur))
2302 + && strcmp(d->d_name, MDNAME(Tmp))
2303 + && strcmp(d->d_name, MDNAME(New))){
2305 + if (dir) snprintf (tmp, sizeof(tmp), "%s%s", name,d->d_name);
2306 + else strcpy(tmp, d->d_name);
2308 + if(pmatch_full (tmp, pat,'/')){
2309 + snprintf(tmp, sizeof(tmp), "%s/%s/%s", myrootdir(d->d_name),
2310 + (dir ? dir : maildirpath), d->d_name);
2311 + if(stat (tmp,&sbuf) == 0
2312 + && ((sbuf.st_mode & S_IFMT) == S_IFDIR)){
2313 + if (dir) snprintf (tmp, sizeof(tmp), "%s%s", name,d->d_name);
2314 + else strcpy(tmp, d->d_name);
2315 + i = maildir_valid(tmp)
2316 + ? (maildir_contains_folder(dir, d->d_name)
2317 + ? LATT_HASCHILDREN
2318 + : (maildir_is_dir(dir, d->d_name)
2319 + ? LATT_HASNOCHILDREN : LATT_NOINFERIORS))
2321 + i += maildir_any_new_msgs(tmp)
2322 + ? LATT_MARKED : LATT_UNMARKED;
2323 + mm_list (stream,'/',tmp, i);
2324 + strcat (tmp, "/");
2325 + if(dmatch (tmp, pat,'/') &&
2326 + (level < (long) mail_parameters (NIL,GET_LISTMAXLEVEL,NIL))){
2327 + snprintf(tmp, sizeof(tmp), "%s/%s",dir,d->d_name);
2328 + maildir_list_work (stream,tmp,pat,level+1);
2337 + void courier_list_work (MAILSTREAM *stream, char *dir, char *pat, long level)
2339 + char c, curdir[MAILTMPLEN], tmp[MAILTMPLEN];
2340 + char realname[MAILTMPLEN], realpat[MAILTMPLEN] = {'\0'};
2342 + long style = *(long *) maildir_parameters(GET_COURIERSTYLE, NIL), j;
2343 + char *maildirpath = mdirpath();
2346 + if(!strpbrk(pat,"%*")){ /* a mailbox */
2347 + maildir_file_path(pat, curdir, sizeof(curdir));
2348 + i = strlen(curdir) - 1;
2349 + if(curdir[i] == '/')
2351 + cdir = courier_list_dir(curdir);
2353 + found = 0; j = 0L;
2354 + if(maildir_valid_name(pat)){
2355 + for(i = 0; !found && i < cdir->total; i++)
2356 + if(strstr(curdir, cdir->data[i]->name)){
2357 + if(strlen(curdir) < strlen(cdir->data[i]->name))
2359 + else if(strlen(curdir) == strlen(cdir->data[i]->name))
2363 + j = LATT_HASCHILDREN;
2364 + else if(found == 0)
2365 + j = (style == COURIER) ? LATT_HASNOCHILDREN : LATT_NOINFERIORS;
2368 + j = LATT_NOSELECT;
2369 + j += maildir_any_new_msgs(curdir) ? LATT_MARKED : LATT_UNMARKED;
2371 + mm_list (stream, '.', pat, j);
2372 + courier_free_cdir(&cdir);
2377 + strcpy(tmp,pat + 4); /* a directory */
2378 + j = strlen(pat) - 1;
2379 + maildir_file_path(pat, realpat, sizeof(realpat));
2382 + realname[0] = '\0';
2384 + maildir_file_path(dir, realname, sizeof(realname));
2385 + snprintf(curdir, sizeof(curdir), "%s%s%s/%s", (dir ? "" : myrootdir(pat)), (dir ? "" : "/"),
2386 + (dir ? realname : maildirpath), (dir ? "" : "."));
2387 + snprintf(tmp, sizeof(tmp), "%s%s/.", MDPREFIX(COURIER), dir ? dir : maildirpath);
2388 + if (level == 0 && tmp && pmatch_full (tmp, realpat, '.'))
2389 + mm_list (stream,'.', tmp, LATT_NOSELECT);
2391 + cdir = courier_list_dir(pat);
2393 + for (i = 0; cdir && i < cdir->total; i++)
2394 + if(pmatch_full (cdir->data[i]->name, pat, '.')){
2395 + snprintf(tmp, sizeof(tmp), "%s.", cdir->data[i]->name);
2396 + courier_list_info(&cdir, tmp, i);
2397 + mm_list (stream,'.',cdir->data[i]->name, cdir->data[i]->attribute);
2399 + courier_free_cdir(&cdir);
2403 + same_maildir_file(char *name1, char *name2)
2405 + char tmp1[MAILTMPLEN], tmp2[MAILTMPLEN];
2408 + strcpy(tmp1, name1 ? name1 : "");
2409 + strcpy(tmp2, name2 ? name2 : "");
2410 + if ((s = strrchr(tmp1, FLAGSEP)) != NULL)
2412 + if (((s = strrchr(tmp1, SIZESEP)) != NULL) && (strchr(s,'.') == NULL))
2414 + if ((s = strrchr(tmp2, FLAGSEP)) != NULL)
2416 + if (((s = strrchr(tmp2, SIZESEP)) != NULL) && (strchr(s,'.') == NULL))
2419 + return !strcmp(tmp1, tmp2);
2422 + unsigned long antoul(char *seed)
2425 + unsigned long val = 0L, rv1 = 0L, t;
2429 + t = strtoul(seed, &p, 10);
2430 + if(p && (*p == '.' || *p == '_'))
2433 + if((p = strchr(seed,'.')) != NULL)
2435 + error = (strlen(seed) > 6); /* too long */
2436 + for(i= strlen(seed)-1; error == 0 && i >= 0; i--){
2438 + if (c >= 'A' && c <= 'Z') val = c - 'A';
2439 + else if (c >= 'a' && c <= 'z') val = c - 'a' + 26;
2440 + else if (c >= '0' && c <= '9') val = c - '0' + 26 + 26;
2441 + else if (c == '-') val = c - '-' + 26 + 26 + 10;
2442 + else if (c == '_') val = c - '_' + 26 + 26 + 10 + 1;
2444 + rv1 = val + (rv1 << 6);
2448 + return error ? 0L : rv1;
2451 + unsigned long mdfntoul (char *name)
2456 + if((*name == '_') && ((r = strpbrk(name,".,%+")) != NULL)){ /* Grrr!!! */
2467 + int comp_maildir_file(char *name1, char *name2)
2469 + int uset1 = 1, uset2 = 1, i, j, cmp;
2470 + unsigned long t1, t2;
2473 + if (!(name1 && *name1))
2474 + return (name2 && *name2) ? (*name2 == FLAGSEP ? 0 : -1) : 0;
2476 + if (!(name2 && *name2))
2477 + return (name1 && *name1) ? (*name1 == FLAGSEP ? 0 : 1) : 0;
2479 + if((cmp = strcmp(name1,name2)) == 0)
2482 + t1 = strtoul(name1, &s1, 10);
2483 + t2 = strtoul(name2, &s2, 10);
2485 + if(!s1 || *s1 != '.')
2488 + if(!s2 || *s2 != '.')
2491 + if(uset1 && uset2) /* normal sort order */
2492 + return (t1 < t2) ? -1 : (t1 > t2 ? 1 : (cmp < 0 ? -1 : 1));
2494 + /* If we make it here we say Grrrr.... first, then we try to figure out
2495 + * how to sort this mess.
2496 + * These are the rules.
2497 + * If there is a number at the beginning it is bigger than anything else.
2498 + * If there are digits, then the number of digits decides which one is bigger.
2501 + for(i = 0; isdigit(name1[i]); i++);
2502 + for(j = 0; isdigit(name2[j]); j++);
2506 + : (i < j ? -1 : (i > j ? 1 : (cmp < 0 ? -1 : 1)))));
2510 + maildir_getflag(char *name, int *d, int *f, int *r ,int *s, int *t)
2512 + char tmp[MAILTMPLEN], *b;
2514 + int tmpd, tmpf, tmpr, tmps, tmpt;
2522 + tmpd = tmpf = tmpr = tmps = tmpt = NIL; /* no flags set by default */
2524 + while ((b = strrchr(tmp+offset, FLAGSEP)) != NULL){
2531 + case '3': flag = *b; b += 2;
2532 + for (k = 0; b[k] && b[k] != FLAGSEP && b[k] != ','; k++);
2535 + if (flag == '2' || flag == '3'){
2536 + tmpd = strchr (b, MDFLAGC(Draft)) ? T : NIL;
2537 + tmpf = strchr (b, MDFLAGC(Flagged)) ? T : NIL;
2538 + tmpr = strchr (b, MDFLAGC(Replied)) ? T : NIL;
2539 + tmps = strchr (b, MDFLAGC(Seen)) ? T : NIL;
2540 + tmpt = strchr (b, MDFLAGC(Trashed)) ? T : NIL;
2544 + for (; tmp[offset] && tmp[offset] != FLAGSEP; offset++);
2547 + default: break; /* Should we crash?... Nahhh */
2558 + maildir_message_in_list(char *msgname, struct direct **names,
2559 + unsigned long bottom, unsigned long top, unsigned long *pos)
2561 + unsigned long middle = (bottom + top)/2;
2567 + if (pos) *pos = middle;
2569 + if (same_maildir_file(msgname, names[middle]->d_name))
2572 + if (middle == bottom){ /* 0 <= 0 < 1 */
2574 + if (same_maildir_file(msgname, names[middle]->d_name)){
2576 + if (pos) *pos = middle;
2579 + if (same_maildir_file(msgname, names[top]->d_name)){
2581 + if (pos) *pos = top;
2586 + test = comp_maildir_file(msgname, names[middle]->d_name);
2588 + if (top <= bottom)
2589 + return test ? NIL : T;
2591 + if (test < 0 ) /* bottom < msgname < middle */
2592 + return maildir_message_in_list(msgname, names, bottom, middle, pos);
2593 + else if (test > 0) /* middle < msgname < top */
2594 + return maildir_message_in_list(msgname, names, middle, top, pos);
2599 + maildir_abort(MAILSTREAM *stream)
2604 + if(LOCAL->candouid)
2605 + maildir_read_uid(stream, NULL, &stream->uid_validity);
2606 + if (LOCAL->dir) fs_give ((void **) &LOCAL->dir);
2607 + for (i = Cur; i < EndDir; i++)
2608 + if(LOCAL->path[i]) fs_give ((void **) &LOCAL->path[i]);
2609 + fs_give ((void **) &LOCAL->path);
2610 + if (LOCAL->buf) fs_give ((void **) &LOCAL->buf);
2611 + if(LOCAL->uidtempfile){
2612 + unlink(LOCAL->uidtempfile);
2613 + fs_give ((void **) &LOCAL->uidtempfile);
2615 + fs_give ((void **) &stream->local);
2617 + if (mdfpath) fs_give((void **)&mdfpath);
2618 + stream->dtb = NIL;
2622 + maildir_contains_folder(char *dirname, char *name)
2624 + char tmp[MAILTMPLEN], tmp2[MAILTMPLEN];
2629 + maildir_file_path(dirname, tmp2, sizeof(tmp2));
2632 + strcat(tmp2, name);
2635 + if (!(dir = opendir (tmp2)))
2638 + while ((d = readdir(dir)) != NULL){
2639 + if (strcmp(d->d_name, ".") && strcmp(d->d_name,"..")
2640 + && strcmp(d->d_name, MDNAME(Cur))
2641 + && strcmp(d->d_name, MDNAME(Tmp))
2642 + && strcmp(d->d_name, MDNAME(New))){
2644 + snprintf(tmp, sizeof(tmp), "%s/%s", tmp2, d->d_name);
2645 + if(maildir_valid(tmp)){
2656 + maildir_is_dir(char *dirname, char *name)
2658 + char tmp[MAILTMPLEN];
2661 + maildir_file_path(dirname, tmp, sizeof(tmp));
2664 + strcat(tmp, name);
2667 + strcat(tmp, MDDIR);
2669 + return ((stat(tmp, &sbuf) == 0) && S_ISREG (sbuf.st_mode)) ? 1 : 0;
2673 + maildir_dir_is_empty(char *mailbox)
2675 + char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], tmp3[MAILTMPLEN],*s;
2676 + int rv = 1, courier = IS_COURIER(mailbox);
2681 + maildir_file_path(mailbox, tmp2, sizeof(tmp2));
2684 + strcpy(tmp3, tmp2);
2685 + if(s = strrchr(tmp2, '/'))
2689 + if (!(dir = opendir (tmp2)))
2693 + while((d = readdir(dir)) != NULL){
2694 + snprintf(tmp, sizeof(tmp), "%s/%s", tmp2, d->d_name);
2695 + if(!strncmp(tmp, tmp3, strlen(tmp3))
2696 + && tmp[strlen(tmp3)] == '.'){
2703 + while ((d = readdir(dir)) != NULL){
2704 + snprintf(tmp, sizeof(tmp), "%s/%s", tmp2, d->d_name);
2705 + if (strcmp(d->d_name, ".")
2706 + && strcmp(d->d_name,"..")
2707 + && strcmp(d->d_name, MDNAME(Cur))
2708 + && strcmp(d->d_name, MDNAME(Tmp))
2709 + && strcmp(d->d_name, MDNAME(New))
2710 + && strcmp(d->d_name, MDDIR)
2711 + && strcmp(d->d_name, MDUIDVALIDITY)
2712 + && !(d->d_name[0] == '.'
2713 + && stat (tmp,&sbuf) == 0
2714 + && S_ISREG(sbuf.st_mode))){
2724 + maildir_get_file (MAILDIRFILE **mdfile)
2728 + md = (MAILDIRFILE *) fs_get(sizeof(MAILDIRFILE));
2729 + memset(md, 0, sizeof(MAILDIRFILE));
2734 + maildir_free_file (void **mdfile)
2736 + MAILDIRFILE *md = (mdfile && *mdfile) ? (MAILDIRFILE *) *mdfile : NULL;
2739 + if (md->name) fs_give((void **)&md->name);
2740 + fs_give((void **)&md);
2745 + maildir_free_file_only (void **mdfile)
2747 + MAILDIRFILE *md = (mdfile && *mdfile) ? (MAILDIRFILE *) *mdfile : NULL;
2749 + if (md && md->name)
2750 + fs_give((void **)&md->name);
2754 + maildir_any_new_msgs(char *mailbox)
2756 + char tmp[MAILTMPLEN];
2761 + MDFLD(tmp, mailbox, New);
2763 + if (!(dir = opendir (tmp)))
2766 + while ((d = readdir(dir)) != NULL){
2767 + if (d->d_name[0] == '.')
2778 + maildir_get_date(MAILSTREAM *stream, unsigned long msgno)
2780 + MESSAGECACHE *elt;
2785 + elt = mail_elt (stream,msgno);
2786 + if(elt && elt->year != 0)
2788 + if ((ti = mdfntoul(MDFILE(elt))) > 0L && (t = gmtime(&ti))){
2789 + i = t->tm_hour * 60 + t->tm_min;
2791 + t = localtime(&ti);
2792 + i = t->tm_hour * 60 + t->tm_min - i;
2793 + if((k = t->tm_yday - k) != 0)
2794 + i += ((k < 0) == (abs (k) == 1)) ? -24*60 : 24*60;
2796 + elt->hours = t->tm_hour;
2797 + elt->minutes = t->tm_min;
2798 + elt->seconds = t->tm_sec;
2799 + elt->day = t->tm_mday; elt->month = t->tm_mon + 1;
2800 + elt->year = t->tm_year - (BASEYEAR - 1900);
2801 + elt->zoccident = (k == i) ? 0 : 1;
2802 + elt->zhours = k/60;
2803 + elt->zminutes = k % 60;
2807 + /* Support for Courier Style directories
2808 + When this code is complete there will be two types of support, which
2809 + will be configurable. The problem is the following: In Courier style
2810 + folder structure, a "folder" may have a subfolder called
2811 + "folder.subfolder", which is not natural in the file system in the
2812 + sense that I can not stat for "folder.subfolder" wihtout knowing what
2813 + "subfolder" is. It needs to be guessed. Because of this I need to look
2814 + in the list of folders if there is a folder with a name
2815 + "folder.subfolder", before I can say if the folder is dual or not. One
2816 + can avoid this annoyance if one ignores the problem by declaring that
2817 + every folder is dual. I will however code as the default the more
2818 + complicated idea of scaning the containing directory each time it is
2819 + modified and search for subfolders, and list the entries it found.
2822 + int courier_dir_select (const struct direct *name)
2824 + return name->d_name[0] == '.' && (strlen(name->d_name) > 2
2825 + || (strlen(name->d_name) == 2 && name->d_name[1] != '.'));
2828 + int courier_dir_sort (const struct direct **d1, const struct direct **d2)
2830 + const struct direct *e1 = *(const struct direct **) d1;
2831 + const struct direct *e2 = *(const struct direct **) d2;
2833 + return strcmp((char *) e1->d_name, (char *) e2->d_name);
2836 + void courier_free_cdir (COURIER_S **cdir)
2843 + if ((*cdir)->path) fs_give((void **)&((*cdir)->path));
2844 + for (i = 0; i < (*cdir)->total; i++)
2845 + if((*cdir)->data[i]->name) fs_give((void **)&((*cdir)->data[i]->name));
2846 + fs_give((void **)&((*cdir)->data));
2847 + fs_give((void **)&(*cdir));
2850 + COURIER_S *courier_get_cdir (int total)
2854 + cdir = (COURIER_S *)fs_get(sizeof(COURIER_S));
2855 + memset(cdir, 0, sizeof(COURIER_S));
2856 + cdir->data = (COURIERLOCAL **) fs_get(total*sizeof(COURIERLOCAL *));
2857 + memset(cdir->data, 0, sizeof(COURIERLOCAL *));
2858 + cdir->total = total;
2862 + int courier_search_list(COURIERLOCAL **data, char *name, int first, int last)
2864 + int try = (first + last)/2;
2866 + if(!strstr(data[try]->name, name)){
2867 + if(first == try) /* first == last || first + 1 == last */
2868 + return strstr(data[last]->name, name) ? 1 : 0;
2869 + if(strcmp(data[try]->name, name) < 0) /*data[try] < name < data[end] */
2870 + return courier_search_list(data, name, try, last);
2871 + else /* data[begin] < name < data[try] */
2872 + return courier_search_list(data, name, first, try);
2877 + /* Lists all directories that are subdirectories of a given directory */
2879 + COURIER_S *courier_list_dir(char *curdir)
2881 + struct direct **names = NIL;
2883 + unsigned long ndir;
2884 + COURIER_S *cdir = NULL;
2885 + char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], pathname[MAILTMPLEN],
2886 + realname[MAILTMPLEN];
2887 + int i, j, scand, td;
2889 + /* There are two cases, either curdir is
2890 + #mc/INBOX. #mc/INBOX.foo
2892 + #mc/Maildir/. #mc/Maildir/.foo
2894 + strcpy(tmp,curdir + 4);
2895 + if(!strncmp(ucase(tmp), "INBOX", 5))
2896 + strcpy(tmp, "#mc/INBOX.");
2898 + strcpy(tmp, curdir);
2899 + for (i = strlen(tmp) - 1; tmp[i] && tmp[i] != '/'; i--);
2900 + tmp[i+2] = '\0'; /* keep the last "." intact */
2902 + maildir_file_path(tmp, realname, sizeof(realname));
2903 + maildir_scandir (realname, &names, &ndir, &scand, COURIER);
2906 + cdir = courier_get_cdir(ndir);
2907 + cdir->path = cpystr(realname);
2908 + for(i = 0, j = 0; i < ndir; i++){
2909 + td = realname[strlen(realname) - 1] == '.'
2910 + && *names[i]->d_name == '.';
2911 + snprintf(tmp2, sizeof(tmp2), "%s%s", tmp, names[i]->d_name+1);
2912 + snprintf(pathname, sizeof(pathname), "%s%s", realname, names[i]->d_name + td);
2913 + if(stat(pathname, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)){
2914 + cdir->data[j] = (COURIERLOCAL *) fs_get(sizeof(COURIERLOCAL));
2915 + cdir->data[j++]->name = cpystr(tmp2);
2917 + fs_give((void **)&names[i]);
2920 + if(cdir->total == 0)
2921 + courier_free_cdir(&cdir);
2924 + fs_give((void **) &names);
2929 + courier_list_info(COURIER_S **cdirp, char *data, int i)
2931 + long style = *(long *) maildir_parameters(GET_COURIERSTYLE, NIL);
2932 + COURIER_S *cdir = *cdirp;
2934 + if(maildir_valid(cdir->data[i]->name)){
2935 + if(courier_search_list(cdir->data, data, 0, cdir->total - 1))
2936 + cdir->data[i]->attribute = LATT_HASCHILDREN;
2938 + cdir->data[i]->attribute = (style == COURIER)
2939 + ? LATT_HASNOCHILDREN : LATT_NOINFERIORS;
2942 + cdir->data[i]->attribute = LATT_NOSELECT;
2943 + cdir->data[i]->attribute += maildir_any_new_msgs(cdir->data[i]->name)
2944 + ? LATT_MARKED : LATT_UNMARKED;
2948 + /* Yes, I know I procastinated a lot about this, but here it is finally */
2951 + bigger than zero: this session can assign uids
2952 + zero: this session will not assign uid
2953 + smaller than zero: this session temporarily suspends assigning uids
2956 + maildir_can_assign_uid (MAILSTREAM *stream)
2958 + unsigned int rv = 0;
2959 + int ownuid, existuid;
2961 + char tmp[MAILTMPLEN], tmp2[MAILTMPLEN], *p, *s;
2965 + if(!stream || stream->rdonly
2966 + || !LOCAL || !LOCAL->dir || !(dir = opendir(LOCAL->dir)))
2969 + if(mypid == (pid_t) 0)
2972 + snprintf(tmp, sizeof(tmp), "%s.%d", MDUIDTEMP, mypid);
2974 + ownuid = existuid = 0;
2976 + while ((d = readdir(dir)) != NULL){
2977 + if(strncmp(d->d_name, tmp, strlen(tmp)) == 0){
2978 + existuid++; ownuid++;
2980 + snprintf(tmp2, sizeof(tmp), "%s/%s", LOCAL->dir, d->d_name);
2983 + snprintf(tmp2, sizeof(tmp2), "%s/%s", LOCAL->dir, s);
2985 + fs_give((void **)&s);
2989 + s = cpystr(d->d_name);
2991 + else if(strncmp(d->d_name, MDUIDTEMP, strlen(MDUIDTEMP)) == 0)
2997 + fs_give((void **)&s);
2999 + if(ownuid == 1 && existuid == 1)
3002 + if(ownuid == 0 && existuid == 0){ /* nobody owns the uid? */
3004 + snprintf(tmp, sizeof(tmp), "%s/%s.%d.%lu", LOCAL->dir, MDUIDTEMP, mypid, time(0));
3005 + if(fp = fopen(tmp, "w")){
3007 + if(LOCAL->uidtempfile)
3008 + fs_give((void **)&LOCAL->uidtempfile);
3009 + LOCAL->uidtempfile = cpystr(tmp);
3014 + if(ownuid == 0 && existuid > 0) /* someone else owns uid assignment */
3017 + /* if we own the uid, check that we do not own it more than once
3018 + * or that we share ownership. If any of these situations happens,
3019 + * give up the ownership until we can recover it
3023 + if(ownuid > 1) /* impossible, two lock files for the same session */
3024 + return (-1)*ownuid;
3026 + if(ownuid != existuid){ /* lock files for different sessions */
3027 + if(LOCAL->uidtempfile){
3028 + unlink(LOCAL->uidtempfile);
3029 + fs_give((void **)&LOCAL->uidtempfile);
3031 + return (-1)*ownuid;
3039 + maildir_read_uid(MAILSTREAM *stream, unsigned long *uid_last,
3040 + unsigned long *uid_validity)
3042 + int createuid, deleteuid = 0;
3043 + char tmp[MAILTMPLEN], *s = NULL;
3047 + if(uid_last) *uid_last = 0L;
3048 + if(uid_last && uid_validity) *uid_validity = time(0);
3049 + if(!stream || !LOCAL || !LOCAL->dir || !(dir = opendir(LOCAL->dir)))
3052 + while ((d = readdir(dir)) != NULL){
3053 + if(!strncmp(d->d_name, MDUIDLAST, strlen(MDUIDLAST)))
3056 + createuid = d == NULL ? 1 : 0;
3057 + if(uid_last == NULL)
3061 + s = d->d_name + strlen(MDUIDLAST) + 1;
3062 + *uid_last = strtoul(s, &s, 10);
3063 + if(!s || *s != '.'){
3069 + if(s && *s == '.'){
3072 + *uid_validity = strtoul(s, &s, 10);
3073 + if(s && *s != '\0'){
3074 + *uid_validity = time(0);
3086 + snprintf(tmp, sizeof(tmp), "%s/%s", LOCAL->dir, d->d_name);
3090 + maildir_write_uid(stream, (uid_last ? *uid_last : stream->uid_last),
3091 + uid_validity ? *uid_validity : time(0));
3096 + maildir_write_uid(MAILSTREAM *stream, unsigned long uid_last,
3097 + unsigned long uid_validity)
3099 + char tmp[MAILTMPLEN];
3102 + if(!stream || stream->rdonly || !LOCAL || !LOCAL->dir)
3105 + snprintf(tmp, sizeof(tmp), "%s/%s.%010lu.%010lu", LOCAL->dir, MDUIDLAST,
3106 + uid_last, uid_validity);
3107 + if(fp = fopen(tmp, "w"))
3112 + maildir_get_uid(char *name)
3115 + unsigned long rv = 0L;
3117 + if(!name || (s = strstr(name,MDUIDSEP)) == NULL)
3120 + s += strlen(MDUIDSEP);
3121 + rv = strtoul(s, NULL, 10);
3127 + maildir_delete_uid(MAILSTREAM *stream, unsigned long msgno)
3129 + char old[MAILTMPLEN], new[MAILTMPLEN], *s, *t;
3130 + MESSAGECACHE *elt;
3132 + elt = mail_elt(stream, msgno);
3133 + if(!stream || !elt || !elt->private.spare.ptr || !LOCAL || !LOCAL->dir)
3136 + snprintf(old, sizeof(old), "%s/%s/%s", LOCAL->dir, MDNAME(Cur), MDFILE(elt));
3138 + if(s = strstr(MDFILE(elt), MDUIDSEP)){
3140 + s += strlen(MDUIDSEP);
3141 + strtoul(s, &s, 10);
3142 + snprintf(new, sizeof(new), "%s/%s/%s%s", LOCAL->dir, MDNAME(Cur), t, s);
3143 + if(rename(old, new) == 0){
3144 + maildir_free_file_only ((void **)&elt->private.spare.ptr);
3145 + s = strrchr(new, '/');
3146 + MDFILE(elt) = cpystr(s+1);
3148 + elt->private.uid = 0L;
3153 + maildir_assign_uid(MAILSTREAM *stream, unsigned long msgno, unsigned long uid)
3155 + int createuid, deleteuid = 0;
3156 + char old[MAILTMPLEN], new[MAILTMPLEN], *s, *t;
3157 + MESSAGECACHE *elt;
3159 + elt = mail_elt(stream, msgno);
3160 + if(!stream || !elt || !elt->private.spare.ptr || !LOCAL || !LOCAL->dir)
3163 + maildir_delete_uid(stream, msgno);
3164 + snprintf(old, sizeof(old), "%s/%s/%s", LOCAL->dir, MDNAME(Cur), MDFILE(elt));
3166 + if((s = strrchr(MDFILE(elt),FLAGSEP)) != NULL){
3168 + snprintf(new, sizeof(new), "%s/%s/%s%s%lu%c%s",
3169 + LOCAL->dir, MDNAME(Cur), t, MDUIDSEP, uid, FLAGSEP, s);
3170 + if(rename(old, new) == 0){
3171 + maildir_free_file_only ((void **)&elt->private.spare.ptr);
3172 + s = strrchr(new, '/');
3173 + MDFILE(elt) = cpystr(s+1);
3174 + stream->uid_validity = time(0);
3176 + elt->private.uid = uid;
3181 + maildir_uid_renew_tempfile(MAILSTREAM *stream)
3183 + char tmp[MAILTMPLEN];
3185 + if(!stream || stream->rdonly
3186 + || !LOCAL || !LOCAL->candouid || !LOCAL->dir || !LOCAL->uidtempfile)
3189 + if(mypid == (pid_t) 0)
3192 + snprintf(tmp, sizeof(tmp), "%s/%s.%d.%lu", LOCAL->dir, MDUIDTEMP, mypid, time(0));
3193 + if(rename(LOCAL->uidtempfile, tmp) == 0){
3194 + fs_give((void **)&LOCAL->uidtempfile);
3195 + LOCAL->uidtempfile = cpystr(tmp);
3198 diff -rc alpine-2.20/imap/src/osdep/unix/maildir.h alpine-2.20.maildir/imap/src/osdep/unix/maildir.h
3199 *** alpine-2.20/imap/src/osdep/unix/maildir.h 2015-02-03 22:28:22.633016235 -0700
3200 --- alpine-2.20.maildir/imap/src/osdep/unix/maildir.h 2015-01-20 20:37:55.836011678 -0700
3205 + * A few definitions that try to make this module portable to other
3206 + * platforms (e.g. Cygwin). This module is based on the information from
3207 + * http://cr.yp.to/proto/maildir.html
3210 + /* First we deal with the separator character */
3212 + #define FLAGSEP ':'
3214 + #define SIZESEP ','
3216 + const char sep1[] = {FLAGSEP, '1', ',', '\0'}; /* experimental semantics*/
3217 + const char sep2[] = {FLAGSEP, '2', ',', '\0'}; /* Flags Information */
3218 + const char sep3[] = {FLAGSEP, '3', ',', '\0'}; /* Grrrr.... */
3220 + const char *sep[] = { sep1, sep2, sep3, NULL};
3222 + #define MDSEP(i) sep[((i) - 1)]
3224 + /* Now we deal with flags. Woohoo! */
3225 + typedef enum {Draft, Flagged, Passed, Replied, Seen, Trashed,
3226 + EmptyFlag, EndFlags} MdFlagNamesType;
3227 + const int mdimapflags[] = {Draft, Flagged, Replied, Seen, Trashed, EmptyFlag, EndFlags};
3228 + const int mdkwdflags[] = {Passed, EmptyFlag, EndFlags};
3230 + /* this array lists the codes for mdflgnms (maildir flag names) above */
3231 + const char *mdflags[] = { "D", "F", "P", "R", "S", "T", "", NULL};
3232 + /* and as characters too */
3233 + const char cmdflags[] = { 'D', 'F', 'P', 'R', 'S', 'T', '0', '\0'};
3235 + /* MDFLAG(Seen, elt->seen) */
3236 + #define MDFLAG(i,j) mdflags[j ? (i) : EmptyFlag]
3237 + /* MDFLAGC(Seen) */
3238 + #define MDFLAGC(i) cmdflags[(i)]
3240 + /* Now we deal with the directory structure */
3241 + typedef enum {Cur, Tmp, New, EndDir} DirNamesType;
3242 + char *mdstruct[] = {"cur", "tmp", "new", NULL};
3243 + #define MDNAME(i) mdstruct[(i)]
3244 + #define MDFLD(tmp, dir, i) sprintf((tmp),"%s/%s", (dir), mdstruct[(i)])
3245 + #define MSGPATH(tmp, dir, msg,i) sprintf((tmp),"%s/%s/%s", (dir), mdstruct[(i)],(msg))
3247 + /* Files associated to a maildir directory */
3249 + #define MDUIDVALIDITY ".uidvalidity" /* support for old maildirs */
3250 + #define MDDIR ".mdir" /* this folder is a directory */
3251 + #define MDUIDLAST ".uidlast" /* last assigned uid */
3252 + #define MDUIDTEMP ".uidtemp" /* We assign uid's no one else */
3256 + /* Support of Courier Structure */
3259 + #define IS_CCLIENT(t) \
3260 + (((t) && (t)[0] == '#' && ((t)[1] == 'm' || (t)[1] == 'M')\
3261 + && ((t)[2] == 'd' || (t)[2] == 'D')\
3262 + && (t)[3] == '/' && (t)[4] != '\0') ? 1 : 0)
3264 + #define IS_COURIER(t) \
3265 + (((t) && (t)[0] == '#' && ((t)[1] == 'm' || (t)[1] == 'M')\
3266 + && ((t)[2] == 'c' || (t)[2] == 'C')\
3267 + && (t)[3] == '/' && (t)[4] != '\0') ? 1 : 0)
3268 + #define MDPREFIX(s) ((s) ? "#mc/" : "#md/")
3269 + #define MDSEPARATOR(s) ((s) ? '.' : '/')
3273 + #define MAXTEMPUID (unsigned long) 180L
3274 + const char mduid[] = {',','u','=','\0'};
3275 + #define MDUIDSEP mduid
3278 + /* Now we deal with messages filenames */
3279 + char mdlocaldomain[MAILTMPLEN+1] = {'\0'};
3280 + pid_t mypid = (pid_t) 0;
3281 + static char *mdfpath = NULL;
3282 + static char myMdInboxDir[50] = { '\0' };/* Location of the Maildir INBOX */
3283 + static long CourierStyle = CCLIENT;
3285 + #define CHUNK 16384 /* from unix.h */
3287 + typedef struct courier_local {
3288 + char *name; /* name of directory/folder */
3289 + int attribute; /* attributes (children/marked/etc) */
3292 + typedef struct courier {
3293 + char *path; /* Path to collection */
3294 + time_t scantime; /* time at which information was generated */
3295 + int total; /* total number of elements in data */
3296 + COURIERLOCAL **data;
3299 + /* In gdb this is the *(struct maildir_local *)stream->local structure */
3300 + typedef struct maildir_local {
3301 + unsigned int dirty : 1; /* diskcopy needs updating */
3302 + unsigned int courier : 1; /* It is Courier style file system */
3303 + unsigned int link : 1; /* There is a symbolic link */
3304 + int candouid; /* we can assign uids and no one else */
3305 + char *uidtempfile; /* path to uid temp file */
3306 + int fd; /* fd of open message */
3307 + char *dir; /* mail directory name */
3308 + char **path; /* path to directories cur, new and tmp */
3309 + unsigned char *buf; /* temporary buffer */
3310 + unsigned long buflen; /* current size of temporary buffer */
3311 + time_t scantime; /* last time directory scanned */
3314 + /* Convenient access to local data */
3315 + #define LOCAL ((MAILDIRLOCAL *) stream->local)
3317 + typedef struct maildir_file_info {
3318 + char *name; /* name of the file */
3319 + DirNamesType loc; /* location of this file */
3320 + unsigned long pos; /* place in list where this file is listed */
3321 + off_t size; /* size in bytes, on disk */
3322 + time_t atime; /* last access time */
3323 + time_t mtime; /* last modified time */
3324 + time_t ctime; /* last changed time */
3327 + #define MDFILE(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->name)
3328 + #define MDLOC(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->loc)
3329 + #define MDPOS(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->pos)
3330 + #define MDSIZE(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->size)
3331 + #define MDATIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->atime)
3332 + #define MDMTIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->mtime)
3333 + #define MDCTIME(F) (((MAILDIRFILE *)((F)->private.spare.ptr))->ctime)
3335 + /* Function prototypes */
3337 + DRIVER *maildir_valid (char *name);
3338 + MAILSTREAM *maildir_open (MAILSTREAM *stream);
3339 + void maildir_close (MAILSTREAM *stream, long options);
3340 + long maildir_ping (MAILSTREAM *stream);
3341 + void maildir_check (MAILSTREAM *stream);
3342 + long maildir_text (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags);
3343 + char *maildir_header (MAILSTREAM *stream,unsigned long msgno,
3344 + unsigned long *length, long flags);
3345 + void maildir_list (MAILSTREAM *stream,char *ref,char *pat);
3346 + void *maildir_parameters (long function,void *value);
3347 + int maildir_create_folder (char *mailbox);
3348 + long maildir_create (MAILSTREAM *stream,char *mailbox);
3349 + void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt); /*check */
3350 + long maildir_expunge (MAILSTREAM *stream, char *sequence, long options);
3351 + long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
3352 + long maildir_append (MAILSTREAM *stream,char *mailbox, append_t af, void *data);
3353 + long maildir_delete (MAILSTREAM *stream,char *mailbox);
3354 + long maildir_rename (MAILSTREAM *stream,char *old,char *new);
3355 + long maildir_sub (MAILSTREAM *stream,char *mailbox);
3356 + long maildir_unsub (MAILSTREAM *stream,char *mailbox);
3357 + void maildir_lsub (MAILSTREAM *stream,char *ref,char *pat);
3358 + void courier_list (MAILSTREAM *stream,char *ref, char *pat);
3360 + /* utility functions */
3361 + void courier_realname (char *name, char *realname);
3362 + long maildir_dirfmttest (char *name);
3363 + char *maildir_file (char *dst,char *name);
3364 + int maildir_select (const struct direct *name);
3365 + int maildir_namesort (const struct direct **d1, const struct direct **d2);
3366 + unsigned long antoul (char *seed);
3367 + unsigned long mdfntoul (char *name);
3368 + int courier_dir_select (const struct direct *name);
3369 + int courier_dir_sort (const struct direct **d1, const struct direct **d2);
3370 + long maildir_canonicalize (char *pattern,char *ref,char *pat);
3371 + void maildir_list_work (MAILSTREAM *stream,char *subdir,char *pat,long level);
3372 + void courier_list_work (MAILSTREAM *stream,char *subdir,char *pat,long level);
3373 + int maildir_file_path(char *name, char *tmp, size_t sizeoftmp);
3374 + int maildir_valid_name (char *name);
3375 + int maildir_valid_dir (char *name);
3376 + int is_valid_maildir (char **name);
3377 + int maildir_message_exists(MAILSTREAM *stream,char *name, char *tmp);
3378 + char *maildir_remove_root(char *name);
3379 + char *maildir_text_work (MAILSTREAM *stream,MESSAGECACHE *elt, unsigned long *length,long flags);
3380 + unsigned long maildir_parse_message(MAILSTREAM *stream, unsigned long msgno,
3381 + DirNamesType dirtype);
3382 + int maildir_eliminate_duplicate (char *name, struct direct ***flist,
3383 + unsigned long *nfiles);
3384 + int maildir_doscandir (char *name, struct direct ***flist, int flag);
3385 + unsigned long maildir_scandir (char *name, struct direct ***flist,
3386 + unsigned long *nfiles, int *scand, int flag);
3387 + void maildir_parse_folder (MAILSTREAM *stream, int full);
3388 + void md_domain_name (void);
3389 + char *myrootdir (char *name);
3390 + char *mdirpath (void);
3391 + int maildir_initial_check (MAILSTREAM *stream, DirNamesType dirtype);
3392 + unsigned long maildir_parse_dir(MAILSTREAM *stream, unsigned long nmsgs,
3393 + DirNamesType dirtype, struct direct **names, unsigned long nfiles, int full);
3394 + int same_maildir_file(char *name1, char *name2);
3395 + int comp_maildir_file(char *name1, char *name2);
3396 + int maildir_message_in_list(char *msgname, struct direct **names,
3397 + unsigned long bottom, unsigned long top, unsigned long *pos);
3398 + void maildir_getflag(char *name, int *d, int *f, int *r ,int *s, int *t);
3399 + int maildir_update_elt_maildirp(MAILSTREAM *stream, unsigned long msgno);
3400 + void maildir_abort (MAILSTREAM *stream);
3401 + int maildir_contains_folder(char *dirname, char *name);
3402 + int maildir_is_dir(char *dirname, char *name);
3403 + int maildir_dir_is_empty(char *mailbox);
3404 + int maildir_create_work (char *mailbox, int loop);
3405 + void maildir_get_file (MAILDIRFILE **mdfile);
3406 + void maildir_free_file (void **mdfile);
3407 + void maildir_free_file_only (void **mdfile);
3408 + int maildir_any_new_msgs(char *mailbox);
3409 + void maildir_get_date(MAILSTREAM *stream, unsigned long msgno);
3410 + void maildir_fast (MAILSTREAM *stream,char *sequence,long flags);
3412 + /* Courier server support */
3413 + void courier_free_cdir (COURIER_S **cdir);
3414 + COURIER_S *courier_get_cdir (int total);
3415 + int courier_search_list(COURIERLOCAL **data, char *name, int first, int last);
3416 + COURIER_S *courier_list_dir(char *curdir);
3417 + void courier_list_info(COURIER_S **cdirp, char *data, int i);
3420 + int maildir_can_assign_uid (MAILSTREAM *stream);
3421 + void maildir_read_uid(MAILSTREAM *stream, unsigned long *uid_last,
3422 + unsigned long *uid_validity);
3423 + void maildir_write_uid(MAILSTREAM *stream, unsigned long uid_last,
3424 + unsigned long uid_validity);
3425 + unsigned long maildir_get_uid(char *name);
3426 + void maildir_delete_uid(MAILSTREAM *stream, unsigned long msgno);
3427 + void maildir_assign_uid(MAILSTREAM *stream, unsigned long msgno, unsigned long uid);
3428 + void maildir_uid_renew_tempfile(MAILSTREAM *stream);
3430 diff -rc alpine-2.20/imap/src/osdep/unix/Makefile alpine-2.20.maildir/imap/src/osdep/unix/Makefile
3431 *** alpine-2.20/imap/src/osdep/unix/Makefile 2015-01-11 22:12:25.505178442 -0700
3432 --- alpine-2.20.maildir/imap/src/osdep/unix/Makefile 2015-01-20 20:37:55.849011678 -0700
3435 # However, mh needs to be before any sysinbox formats (such as mmdf or unix)
3436 # since otherwise INBOX won't work correctly when mh_allow_inbox is set.
3438 ! DEFAULTDRIVERS=imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
3441 # Normally no need to change any of these
3443 # However, mh needs to be before any sysinbox formats (such as mmdf or unix)
3444 # since otherwise INBOX won't work correctly when mh_allow_inbox is set.
3446 ! DEFAULTDRIVERS=maildir courier imap nntp pop3 mix mx mbx tenex mtx mh mmdf unix news phile
3449 # Normally no need to change any of these
3452 BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \
3453 dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
3454 rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
3455 ! unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o
3460 BINARIES=osdep.o mail.o misc.o newsrc.o smanager.o utf8.o utf8aux.o siglocal.o \
3461 dummy.o pseudo.o netmsg.o flstring.o fdstring.o \
3462 rfc822.o nntp.o smtp.o imap4r1.o pop3.o \
3463 ! unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o maildir.o
3470 cyg: # Cygwin - note that most local file drivers don't work!!
3471 $(BUILD) `$(CAT) SPECIALS` OS=$@ \
3472 ! DEFAULTDRIVERS="imap nntp pop3 mbx unix phile" \
3473 SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
3475 ACTIVEFILE=/usr/local/news/lib/active \
3478 cyg: # Cygwin - note that most local file drivers don't work!!
3479 $(BUILD) `$(CAT) SPECIALS` OS=$@ \
3480 ! DEFAULTDRIVERS="imap nntp pop3 mbx unix maildir phile" \
3481 SIGTYPE=psx CHECKPW=cyg LOGINPW=cyg CRXTYPE=std \
3483 ACTIVEFILE=/usr/local/news/lib/active \
3486 unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
3487 utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
3488 utf8aux.o: mail.h misc.h osdep.h utf8.h
3494 unix.o: mail.h misc.h osdep.h unix.h pseudo.h dummy.h
3495 utf8.o: mail.h misc.h osdep.h utf8.h tmap.c widths.c
3496 utf8aux.o: mail.h misc.h osdep.h utf8.h
3497 ! maildir.o: mail.h misc.h osdep.h maildir.h dummy.h
3501 diff -rc alpine-2.20/imap/src/osdep/unix/os_cyg.h alpine-2.20.maildir/imap/src/osdep/unix/os_cyg.h
3502 *** alpine-2.20/imap/src/osdep/unix/os_cyg.h 2015-01-11 22:12:25.506178446 -0700
3503 --- alpine-2.20.maildir/imap/src/osdep/unix/os_cyg.h 2015-01-20 20:37:55.850011678 -0700
3507 #define setpgrp setpgid
3509 #define SYSTEMUID 18 /* Cygwin returns this for SYSTEM */
3510 + #define FLAGSEP ';'
3511 #define geteuid Geteuid
3512 uid_t Geteuid (void);
3514 diff -rc alpine-2.20/include/config.h alpine-2.20.maildir/include/config.h
3515 *** alpine-2.20/include/config.h 2015-01-18 00:00:55.367703433 -0700
3516 --- alpine-2.20.maildir/include/config.h 2015-01-20 20:38:26.764015680 -0700
3519 /* #undef ENABLE_DMALLOC */
3521 /* Enable LDAP query support */
3522 ! /* #undef ENABLE_LDAP */
3524 /* Define to 1 if translation of program messages to the user's native
3525 language is requested. */
3527 /* #undef ENABLE_DMALLOC */
3529 /* Enable LDAP query support */
3530 ! #define ENABLE_LDAP /**/
3532 /* Define to 1 if translation of program messages to the user's native
3533 language is requested. */
3536 #define KEYBOARD_LOCK /**/
3538 /* Define if you use OpenLDAP 2.3.x deprecated functions */
3539 ! /* #undef LDAP_DEPRECATED */
3541 /* Define to the sub-directory in which libtool stores uninstalled libraries.
3544 #define KEYBOARD_LOCK /**/
3546 /* Define if you use OpenLDAP 2.3.x deprecated functions */
3547 ! #define LDAP_DEPRECATED 1
3549 /* Define to the sub-directory in which libtool stores uninstalled libraries.
3551 diff -rc alpine-2.20/pico/Makefile alpine-2.20.maildir/pico/Makefile
3552 *** alpine-2.20/pico/Makefile 2015-01-18 00:00:55.257702949 -0700
3553 --- alpine-2.20.maildir/pico/Makefile 2015-01-20 20:38:26.513015622 -0700
3556 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
3559 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
3561 AM_CFLAGS = -g -pthread
3562 AM_DEFAULT_VERBOSITY = 1
3565 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
3566 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
3567 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
3570 CCDEPMODE = depmode=gcc3
3572 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
3575 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
3577 AM_CFLAGS = -g -pthread
3578 AM_DEFAULT_VERBOSITY = 1
3581 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
3582 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
3583 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
3586 CCDEPMODE = depmode=gcc3
3590 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3591 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3592 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
3593 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3594 C_CLIENT_TARGET = lsu
3595 C_CLIENT_WITH_IPV6 = touch imap/ip6
3598 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3599 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3600 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
3601 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3602 C_CLIENT_TARGET = lsu
3603 C_CLIENT_WITH_IPV6 = touch imap/ip6
3609 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
3610 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3611 LIBTOOL_DEPS = ./ltmain.sh
3617 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
3618 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3619 LIBTOOL_DEPS = ./ltmain.sh
3625 MAKE = /usr/bin/make
3626 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
3628 MKDIR_P = /usr/bin/mkdir -p
3629 MSGFMT = /usr/bin/msgfmt
3633 MAKE = /usr/bin/make
3634 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
3636 MKDIR_P = /usr/bin/mkdir -p
3637 MSGFMT = /usr/bin/msgfmt
3640 WEB_PUBCOOKIE_LINK =
3641 XGETTEXT = /usr/bin/xgettext
3642 XGETTEXT_015 = /usr/bin/xgettext
3643 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pico
3644 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pico
3645 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3646 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3651 WEB_PUBCOOKIE_LINK =
3652 XGETTEXT = /usr/bin/xgettext
3653 XGETTEXT_015 = /usr/bin/xgettext
3654 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pico
3655 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pico
3656 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3657 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3664 includedir = ${prefix}/include
3665 infodir = ${datarootdir}/info
3666 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
3667 libdir = ${exec_prefix}/lib
3668 libexecdir = ${exec_prefix}/libexec
3669 localedir = ${datadir}/locale
3672 includedir = ${prefix}/include
3673 infodir = ${datarootdir}/info
3674 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
3675 libdir = ${exec_prefix}/lib
3676 libexecdir = ${exec_prefix}/libexec
3677 localedir = ${datadir}/locale
3678 diff -rc alpine-2.20/pico/osdep/Makefile alpine-2.20.maildir/pico/osdep/Makefile
3679 *** alpine-2.20/pico/osdep/Makefile 2015-01-18 00:00:55.235702852 -0700
3680 --- alpine-2.20.maildir/pico/osdep/Makefile 2015-01-20 20:38:26.454015609 -0700
3685 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
3686 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
3688 AM_CFLAGS = -g -pthread
3689 AM_DEFAULT_VERBOSITY = 1
3692 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
3693 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
3694 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
3697 CCDEPMODE = depmode=gcc3
3701 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
3702 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
3704 AM_CFLAGS = -g -pthread
3705 AM_DEFAULT_VERBOSITY = 1
3708 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
3709 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
3710 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
3713 CCDEPMODE = depmode=gcc3
3717 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3718 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3719 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
3720 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3721 C_CLIENT_TARGET = lsu
3722 C_CLIENT_WITH_IPV6 = touch imap/ip6
3725 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3726 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3727 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
3728 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3729 C_CLIENT_TARGET = lsu
3730 C_CLIENT_WITH_IPV6 = touch imap/ip6
3736 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
3737 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3738 LIBTOOL_DEPS = ./ltmain.sh
3744 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
3745 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3746 LIBTOOL_DEPS = ./ltmain.sh
3752 MAKE = /usr/bin/make
3753 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
3755 MKDIR_P = /usr/bin/mkdir -p
3756 MSGFMT = /usr/bin/msgfmt
3760 MAKE = /usr/bin/make
3761 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
3763 MKDIR_P = /usr/bin/mkdir -p
3764 MSGFMT = /usr/bin/msgfmt
3767 WEB_PUBCOOKIE_LINK =
3768 XGETTEXT = /usr/bin/xgettext
3769 XGETTEXT_015 = /usr/bin/xgettext
3770 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pico/osdep
3771 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pico/osdep
3772 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3773 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3778 WEB_PUBCOOKIE_LINK =
3779 XGETTEXT = /usr/bin/xgettext
3780 XGETTEXT_015 = /usr/bin/xgettext
3781 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pico/osdep
3782 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pico/osdep
3783 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3784 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3791 includedir = ${prefix}/include
3792 infodir = ${datarootdir}/info
3793 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
3794 libdir = ${exec_prefix}/lib
3795 libexecdir = ${exec_prefix}/libexec
3796 localedir = ${datadir}/locale
3799 includedir = ${prefix}/include
3800 infodir = ${datarootdir}/info
3801 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
3802 libdir = ${exec_prefix}/lib
3803 libexecdir = ${exec_prefix}/libexec
3804 localedir = ${datadir}/locale
3805 diff -rc alpine-2.20/pith/charconv/Makefile alpine-2.20.maildir/pith/charconv/Makefile
3806 *** alpine-2.20/pith/charconv/Makefile 2015-01-18 00:00:55.204702716 -0700
3807 --- alpine-2.20.maildir/pith/charconv/Makefile 2015-01-20 20:38:26.367015589 -0700
3812 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
3813 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
3815 AM_CFLAGS = -g -pthread
3816 AM_DEFAULT_VERBOSITY = 1
3819 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
3820 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
3821 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
3824 CCDEPMODE = depmode=gcc3
3828 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
3829 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
3831 AM_CFLAGS = -g -pthread
3832 AM_DEFAULT_VERBOSITY = 1
3835 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
3836 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
3837 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
3840 CCDEPMODE = depmode=gcc3
3844 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3845 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3846 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
3847 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3848 C_CLIENT_TARGET = lsu
3849 C_CLIENT_WITH_IPV6 = touch imap/ip6
3852 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
3853 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
3854 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
3855 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
3856 C_CLIENT_TARGET = lsu
3857 C_CLIENT_WITH_IPV6 = touch imap/ip6
3863 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
3864 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3865 LIBTOOL_DEPS = ./ltmain.sh
3871 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
3872 LIBTOOL = $(SHELL) $(top_builddir)/libtool
3873 LIBTOOL_DEPS = ./ltmain.sh
3879 MAKE = /usr/bin/make
3880 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
3882 MKDIR_P = /usr/bin/mkdir -p
3883 MSGFMT = /usr/bin/msgfmt
3887 MAKE = /usr/bin/make
3888 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
3890 MKDIR_P = /usr/bin/mkdir -p
3891 MSGFMT = /usr/bin/msgfmt
3894 WEB_PUBCOOKIE_LINK =
3895 XGETTEXT = /usr/bin/xgettext
3896 XGETTEXT_015 = /usr/bin/xgettext
3897 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith/charconv
3898 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith/charconv
3899 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3900 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
3905 WEB_PUBCOOKIE_LINK =
3906 XGETTEXT = /usr/bin/xgettext
3907 XGETTEXT_015 = /usr/bin/xgettext
3908 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith/charconv
3909 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith/charconv
3910 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3911 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
3918 includedir = ${prefix}/include
3919 infodir = ${datarootdir}/info
3920 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
3921 libdir = ${exec_prefix}/lib
3922 libexecdir = ${exec_prefix}/libexec
3923 localedir = ${datadir}/locale
3926 includedir = ${prefix}/include
3927 infodir = ${datarootdir}/info
3928 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
3929 libdir = ${exec_prefix}/lib
3930 libexecdir = ${exec_prefix}/libexec
3931 localedir = ${datadir}/locale
3932 diff -rc alpine-2.20/pith/conf.c alpine-2.20.maildir/pith/conf.c
3933 *** alpine-2.20/pith/conf.c 2015-01-11 22:12:25.578178790 -0700
3934 --- alpine-2.20.maildir/pith/conf.c 2015-01-20 20:37:55.862011679 -0700
3939 CONF_TXT_T cf_text_newsrc_path[] = "Full path and name of NEWSRC file";
3942 + CONF_TXT_T cf_text_maildir_location[] = "Location relative to your HOME directory of the directory where your INBOX\n# for the maildir format is located. Default value is \"Maildir\". If your\n# inbox is located at \"~/Maildir\" you do not need to change this value.\n# A common value is also \".maildir\"";
3945 /*----------------------------------------------------------------------
3946 These are the variables that control a number of pine functions. They
3950 NULL, cf_text_news_active},
3951 {"news-spool-directory", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
3952 NULL, cf_text_news_spooldir},
3954 + {"maildir-location", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
3955 + "Maildir Location", cf_text_maildir_location},
3957 {"upload-command", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
3958 NULL, cf_text_upload_cmd},
3959 {"upload-command-prefix", 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0,
3963 mail_parameters(NULL, SET_NEWSSPOOL,
3964 (void *)VAR_NEWS_SPOOL_DIR);
3967 + set_current_val(&vars[V_MAILDIR_LOCATION], TRUE, TRUE);
3968 + if(VAR_MAILDIR_LOCATION && VAR_MAILDIR_LOCATION[0])
3969 + mail_parameters(NULL, SET_MDINBOXPATH, (void *)VAR_MAILDIR_LOCATION);
3972 /* guarantee a save default */
3973 set_current_val(&vars[V_DEFAULT_SAVE_FOLDER], TRUE, TRUE);
3974 if(!VAR_DEFAULT_SAVE_FOLDER || !VAR_DEFAULT_SAVE_FOLDER[0])
3978 F_SORT_DEFAULT_SAVE_ALPHA, h_config_sort_save_alpha, PREF_FLDR, 0},
3979 {"vertical-folder-list", "Use Vertical Folder List",
3980 F_VERTICAL_FOLDER_LIST, h_config_vertical_list, PREF_FLDR, 0},
3982 + {"use-courier-folder-list", "Courier Style Folder List",
3983 + F_COURIER_FOLDER_LIST, h_config_courier_list, PREF_FLDR, 0},
3987 {"combined-addrbook-display", "Combined Address Book Display",
3990 int just_flip_value, EditWhich ew)
3992 char **vp, *p, **lval, ***alval;
3993 ! int og, on_before, was_set;
3998 int just_flip_value, EditWhich ew)
4000 char **vp, *p, **lval, ***alval;
4001 ! int og, on_before, was_set, i;
4012 + case F_COURIER_FOLDER_LIST:
4013 + i = F_ON(f->id ,ps) ? 1 : 0;
4014 + mail_parameters(NULL,SET_COURIERSTYLE, (void *) &i);
4015 + break; /* COURIER == 1, CCLIENT == 0, see maildir.h */
4018 case F_COLOR_LINE_IMPORTANT :
4019 case F_DATES_TO_LOCAL :
4020 clear_index_cache(ps->mail_stream, 0);
4024 return(h_config_newmailwidth);
4025 case V_NEWSRC_PATH :
4026 return(h_config_newsrc_path);
4028 + case V_MAILDIR_LOCATION :
4029 + return(h_config_maildir_location);
4032 return(h_config_browser);
4033 #if defined(DOS) || defined(OS2)
4034 diff -rc alpine-2.20/pith/conf.h alpine-2.20.maildir/pith/conf.h
4035 *** alpine-2.20/pith/conf.h 2015-01-11 22:12:25.578178790 -0700
4036 --- alpine-2.20.maildir/pith/conf.h 2015-01-20 20:37:55.873011679 -0700
4040 #define GLO_NEWS_ACTIVE_PATH vars[V_NEWS_ACTIVE_PATH].global_val.p
4041 #define VAR_NEWS_SPOOL_DIR vars[V_NEWS_SPOOL_DIR].current_val.p
4042 #define GLO_NEWS_SPOOL_DIR vars[V_NEWS_SPOOL_DIR].global_val.p
4044 + #define VAR_MAILDIR_LOCATION vars[V_MAILDIR_LOCATION].current_val.p
4045 + #define GLO_MAILDIR_LOCATION vars[V_MAILDIR_LOCATION].global_val.p
4047 #define VAR_DISABLE_DRIVERS vars[V_DISABLE_DRIVERS].current_val.l
4048 #define VAR_DISABLE_AUTHS vars[V_DISABLE_AUTHS].current_val.l
4049 #define VAR_REMOTE_ABOOK_METADATA vars[V_REMOTE_ABOOK_METADATA].current_val.p
4050 diff -rc alpine-2.20/pith/conftype.h alpine-2.20.maildir/pith/conftype.h
4051 *** alpine-2.20/pith/conftype.h 2015-01-11 22:12:25.579178794 -0700
4052 --- alpine-2.20.maildir/pith/conftype.h 2015-01-20 20:37:55.879011679 -0700
4057 , V_NEWS_ACTIVE_PATH
4060 + , V_MAILDIR_LOCATION
4063 , V_UPLOAD_CMD_PREFIX
4068 F_PASS_C1_CONTROL_CHARS,
4069 F_SINGLE_FOLDER_LIST,
4070 F_VERTICAL_FOLDER_LIST,
4072 + F_COURIER_FOLDER_LIST,
4077 diff -rc alpine-2.20/pith/init.c alpine-2.20.maildir/pith/init.c
4078 *** alpine-2.20/pith/init.c 2015-01-11 22:12:25.583178813 -0700
4079 --- alpine-2.20.maildir/pith/init.c 2015-01-20 20:37:55.880011679 -0700
4083 && stricmp(filename, folder_base)){
4085 if(strncmp(filename, folder_base, folder_base_len) == 0
4087 + && filename[folder_base_len] != list_cntxt->dir->delim
4089 && strcmp(filename, folder_base)){
4092 diff -rc alpine-2.20/pith/Makefile alpine-2.20.maildir/pith/Makefile
4093 *** alpine-2.20/pith/Makefile 2015-01-18 00:00:55.223702799 -0700
4094 --- alpine-2.20.maildir/pith/Makefile 2015-01-20 20:38:26.399015596 -0700
4097 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
4100 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
4102 AM_CFLAGS = -g -pthread
4103 AM_DEFAULT_VERBOSITY = 1
4106 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
4107 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
4108 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
4111 CCDEPMODE = depmode=gcc3
4113 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
4116 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
4118 AM_CFLAGS = -g -pthread
4119 AM_DEFAULT_VERBOSITY = 1
4122 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
4123 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
4124 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
4127 CCDEPMODE = depmode=gcc3
4131 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4132 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4133 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
4134 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4135 C_CLIENT_TARGET = lsu
4136 C_CLIENT_WITH_IPV6 = touch imap/ip6
4139 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4140 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4141 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
4142 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4143 C_CLIENT_TARGET = lsu
4144 C_CLIENT_WITH_IPV6 = touch imap/ip6
4150 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
4151 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4152 LIBTOOL_DEPS = ./ltmain.sh
4158 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
4159 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4160 LIBTOOL_DEPS = ./ltmain.sh
4166 MAKE = /usr/bin/make
4167 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
4169 MKDIR_P = /usr/bin/mkdir -p
4170 MSGFMT = /usr/bin/msgfmt
4174 MAKE = /usr/bin/make
4175 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
4177 MKDIR_P = /usr/bin/mkdir -p
4178 MSGFMT = /usr/bin/msgfmt
4181 WEB_PUBCOOKIE_LINK =
4182 XGETTEXT = /usr/bin/xgettext
4183 XGETTEXT_015 = /usr/bin/xgettext
4184 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith
4185 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith
4186 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4187 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4192 WEB_PUBCOOKIE_LINK =
4193 XGETTEXT = /usr/bin/xgettext
4194 XGETTEXT_015 = /usr/bin/xgettext
4195 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith
4196 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith
4197 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4198 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4205 includedir = ${prefix}/include
4206 infodir = ${datarootdir}/info
4207 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
4208 libdir = ${exec_prefix}/lib
4209 libexecdir = ${exec_prefix}/libexec
4210 localedir = ${datadir}/locale
4213 includedir = ${prefix}/include
4214 infodir = ${datarootdir}/info
4215 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
4216 libdir = ${exec_prefix}/lib
4217 libexecdir = ${exec_prefix}/libexec
4218 localedir = ${datadir}/locale
4219 diff -rc alpine-2.20/pith/osdep/Makefile alpine-2.20.maildir/pith/osdep/Makefile
4220 *** alpine-2.20/pith/osdep/Makefile 2015-01-18 00:00:55.190702654 -0700
4221 --- alpine-2.20.maildir/pith/osdep/Makefile 2015-01-20 20:38:26.350015585 -0700
4226 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
4227 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
4229 AM_CFLAGS = -g -pthread
4230 AM_DEFAULT_VERBOSITY = 1
4233 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
4234 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
4235 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
4238 CCDEPMODE = depmode=gcc3
4242 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
4243 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
4245 AM_CFLAGS = -g -pthread
4246 AM_DEFAULT_VERBOSITY = 1
4249 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
4250 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
4251 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
4254 CCDEPMODE = depmode=gcc3
4258 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4259 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4260 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
4261 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4262 C_CLIENT_TARGET = lsu
4263 C_CLIENT_WITH_IPV6 = touch imap/ip6
4266 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4267 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4268 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
4269 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4270 C_CLIENT_TARGET = lsu
4271 C_CLIENT_WITH_IPV6 = touch imap/ip6
4277 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
4278 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4279 LIBTOOL_DEPS = ./ltmain.sh
4285 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
4286 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4287 LIBTOOL_DEPS = ./ltmain.sh
4293 MAKE = /usr/bin/make
4294 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
4296 MKDIR_P = /usr/bin/mkdir -p
4297 MSGFMT = /usr/bin/msgfmt
4301 MAKE = /usr/bin/make
4302 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
4304 MKDIR_P = /usr/bin/mkdir -p
4305 MSGFMT = /usr/bin/msgfmt
4308 WEB_PUBCOOKIE_LINK =
4309 XGETTEXT = /usr/bin/xgettext
4310 XGETTEXT_015 = /usr/bin/xgettext
4311 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith/osdep
4312 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/pith/osdep
4313 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4314 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4319 WEB_PUBCOOKIE_LINK =
4320 XGETTEXT = /usr/bin/xgettext
4321 XGETTEXT_015 = /usr/bin/xgettext
4322 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith/osdep
4323 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/pith/osdep
4324 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4325 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4332 includedir = ${prefix}/include
4333 infodir = ${datarootdir}/info
4334 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
4335 libdir = ${exec_prefix}/lib
4336 libexecdir = ${exec_prefix}/libexec
4337 localedir = ${datadir}/locale
4340 includedir = ${prefix}/include
4341 infodir = ${datarootdir}/info
4342 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
4343 libdir = ${exec_prefix}/lib
4344 libexecdir = ${exec_prefix}/libexec
4345 localedir = ${datadir}/locale
4346 diff -rc alpine-2.20/pith/pattern.c alpine-2.20.maildir/pith/pattern.c
4347 *** alpine-2.20/pith/pattern.c 2015-01-11 22:12:25.579178794 -0700
4348 --- alpine-2.20.maildir/pith/pattern.c 2015-01-20 20:37:55.897011679 -0700
4351 #include "../pith/icache.h"
4352 #include "../pith/ablookup.h"
4353 #include "../pith/keyword.h"
4357 * Internal prototypes
4359 #include "../pith/icache.h"
4360 #include "../pith/ablookup.h"
4361 #include "../pith/keyword.h"
4363 ! int maildir_file_path(char *name, char *tmp, size_t sizeoftmp);
4364 ! #endif /* _WINDOWS */
4367 * Internal prototypes
4375 + if(!struncmp(patfolder, "#md/", 4)
4376 + || !struncmp(patfolder, "#mc/", 4)){
4377 + maildir_file_path(patfolder, tmp1, sizeof(tmp1));
4378 + if(!strcmp(tmp1, stream->mailbox))
4383 if(!strcmp(patfolder, stream->mailbox))
4388 int we_cancel = 0, width;
4389 CONTEXT_S *save_context = NULL;
4390 char buf[MAX_SCREEN_COLS+1], sbuf[MAX_SCREEN_COLS+1];
4391 ! char *save_ref = NULL;
4392 #define FILTMSG_MAX 30
4396 int we_cancel = 0, width;
4397 CONTEXT_S *save_context = NULL;
4398 char buf[MAX_SCREEN_COLS+1], sbuf[MAX_SCREEN_COLS+1];
4399 ! char *save_ref = NULL, *save_dstfldr = NULL, *save_dstfldr2 = NULL;
4400 #define FILTMSG_MAX 30
4406 if(F_OFF(F_QUELL_FILTER_MSGS, ps_global))
4407 we_cancel = busy_cue(buf, NULL, 0);
4410 + if(!struncmp(dstfldr, "#md/", 4) || !struncmp(dstfldr, "#mc/", 4)){
4411 + char tmp1[MAILTMPLEN];
4412 + maildir_file_path(dstfldr, tmp1, sizeof(tmp1));
4413 + save_dstfldr2 = dstfldr;
4414 + save_dstfldr = cpystr(tmp1);
4415 + dstfldr = save_dstfldr;
4419 if(!is_absolute_path(dstfldr)
4420 && !(save_context = default_save_context(ps_global->context_list)))
4421 save_context = ps_global->context_list;
4426 cancel_busy_cue(buf[0] ? 0 : -1);
4429 + fs_give((void **)&save_dstfldr);
4430 + dstfldr = save_dstfldr2;
4433 return(buf[0] != '\0');
4436 diff -rc alpine-2.20/pith/pine.hlp alpine-2.20.maildir/pith/pine.hlp
4437 *** alpine-2.20/pith/pine.hlp 2015-01-11 22:12:25.584178818 -0700
4438 --- alpine-2.20.maildir/pith/pine.hlp 2015-01-20 20:37:55.946011680 -0700
4440 *** 21891,21896 ****
4441 --- 21891,21992 ----
4442 <End of help on this topic>
4445 + ====== h_config_maildir_location ======
4448 + <TITLE>OPTION: <!--#echo var="VAR_maildir-location"--></TITLE>
4451 + <H1>OPTION: <!--#echo var="VAR_maildir-location"--></H1>
4454 + This option should be used only if you have a Maildir folder which you
4455 + want to use as your INBOX. If this is not your case (or don't know what
4456 + this is), you can safely ignore this option.
4459 + This option overrides the default directory Pine uses to find the location of
4460 + your INBOX, in case this is in Maildir format. The default value of this
4461 + option is "Maildir", but in some systems, this directory could have been
4462 + renamed (e.g. to ".maildir"). If this is your case use this option to change
4466 + The value of this option is prefixed with the "~/" string to determine the
4467 + full path to your INBOX.
4470 + You should probably <A HREF="h_config_maildir">read</A> a few tips that
4471 + teach you how to configure your maildir for optimal performance. This
4472 + version also has <A HREF="h_config_courier_list">support</A> for the
4473 + Courier style file system when a maildir collection is accessed locally.
4476 + <LI><A HREF="h_finding_help">Finding more information and requesting help</A>
4479 + <End of help on this topic>
4482 + ====== h_config_maildir =====
4485 + <TITLE>Maildir Support</TITLE>
4488 + <H1>Maildir Support</H1>
4490 + This version of Alpine has been enhanced with Maildir support. This text is
4491 + intended to be a reference on its support.
4494 + A Maildir folder is a directory that contains three directories called
4495 + cur, tmp and new. A program that delivers mail (e.g. postfix) will put new
4496 + mail in the new directory. A program that reads mail will look for for old
4497 + messages in the cur directory, while it will look for new mail in the new
4501 + In order to use maildir support it is better to set your inbox-path to the
4502 + value "#md/inbox" (without quotes). This assumes that your mail
4503 + delivery agent is delivering new mail to ~/Maildir/new. If the directory
4504 + where new mail is being delivered is not called "Maildir", you can set the
4505 + name of the subdirectory of home where it is being delivered in the <A
4506 + HREF="h_config_maildir_location"><!--#echo var="VAR_maildir-location"--></A> configuration
4507 + variable. Most of the time you will not have to worry about the
4508 + <!--#echo var="VAR_maildirlocation"--> variable, because it will probably be set by your
4509 + administrator in the pine.conf configuration file.
4512 + One of the advantages of the Maildir support of this version of Alpine is
4513 + that you do not have to stop using folders in another styles (mbox, mbx,
4514 + etc.). This is desirable since the usage of a specific mail storage system
4515 + is a personal decision. Folders in the maildir format that are part of the
4516 + Mail collection will be recognized without any extra configuration of your
4517 + part. If your mail/ collection is located under the mail/ directory, then
4518 + creating a new maildir folder in this collection is done by pressing "A"
4519 + and entering the string "#driver.md/mail/newfolder". Observe that adding a
4520 + new folder as "newfolder" may not create such folder in maildir format.
4523 + If you would like to have all folders created in the maildir format by
4524 + default, you do so by adding a Maildir Collection. In order to convert
4525 + your current mail/ collection into a maildir collection, edit the
4526 + collection and change the path variable from "mail/" to
4527 + "#md/mail". In a maildir collection folders of any other format
4530 + <P> Finally, This version also has
4531 + <A HREF="h_config_courier_list">support</A> for the Courier style file system
4532 + when a maildir collection is accessed locally.
4536 + <LI><A HREF="h_finding_help">Finding more information and requesting help</A>
4538 + <End of help on this topic>
4541 ====== h_config_literal_sig =====
4545 *** 29841,29846 ****
4546 --- 29937,29985 ----
4548 <End of help on this topic>
4551 + ====== h_config_courier_list =====
4554 + <TITLE>FEATURE: <!--#echo var="FEAT_courier-folder-list"--></TITLE>
4557 + <H1>FEATURE: <!--#echo var="FEAT_courier-folder-list"--></H1>
4559 + In a maildir collection, a folder could be used as a directory to store
4560 + folders. In the Courier server if you create a folder, then a directory
4561 + with the same name is created. If you use this patch to access a
4562 + collection created by the Courier server, then the display of such
4563 + collection will look confusing. The best way to access a maildir
4564 + collection created by the Courier server is by using the "#mc/"
4565 + prefix instead of the "#md/" prefix. If you use this alternate
4566 + prefix, then this feature applies to you, otherwise you can safely ignore
4567 + the text that follows.
4569 + Depending on if you have enabled the option
4570 + <a href="h_config_separate_fold_dir_view"><!--#echo var="FEAT_separate-folder-and-directory-entries"--></a>
4571 + a folder may be listed as "folder[.]", or as two entries in the
4572 + list by "folder" and "folder.".
4574 + If this option is disabled, Pine will list local folders that are in Courier
4575 + style format, as "folder", and those that are also directories as
4576 + "folder[.]". This makes the default display cleaner.
4578 + If this feature is enabled then creating folders in a maildir collection
4579 + will create a directory with the same name. If this feature is disabled, then
4580 + a folder is considered a directory only if it contains subfolders, so you can
4581 + not create a directory with the same name as an exisiting folder unless
4582 + you create a subfolder of that folder first (e.g. if you have a folder
4583 + called "foo" simply add "foo.bar" directly. This will
4584 + create the directory "foo" and the subfolder "bar" of it).
4586 + Observe that this feature works only for maildir collections that are accessed
4587 + locally. If a collection is accessed remotely then this feature has no value,
4588 + as the report is created in a server, and Pine only reports what received
4589 + from the server in this case.
4591 + <End of help on this topic>
4594 ====== h_config_verbose_post =====
4596 diff -rc alpine-2.20/pith/send.c alpine-2.20.maildir/pith/send.c
4597 *** alpine-2.20/pith/send.c 2015-01-11 22:12:25.577178785 -0700
4598 --- alpine-2.20.maildir/pith/send.c 2015-01-20 20:37:55.963011681 -0700
4603 #include "../c-client/smtp.h"
4604 #include "../c-client/nntp.h"
4606 + int maildir_file_path(char *name, char *tmp, size_t sizeoftmp);
4607 + #endif /* _WINDOWS */
4610 /* this is used in pine_send and pine_simple_send */
4615 if(exists & FEX_ISFILE){
4616 context_apply(tmp, p_cntxt, mbox, sizeof(tmp));
4618 + if (!struncmp(tmp, "#md/",4) || !struncmp(tmp, "#mc/", 4)){
4619 + char tmp2[MAILTMPLEN];
4620 + maildir_file_path(tmp, tmp2, sizeof(tmp2));
4621 + strcpy(tmp, tmp2);
4624 if(!(IS_REMOTE(tmp) || is_absolute_path(tmp))){
4626 * The mbox is relative to the home directory.
4627 diff -rc alpine-2.20/README.maildir alpine-2.20.maildir/README.maildir
4628 *** alpine-2.20/README.maildir 2015-02-03 22:28:22.634016237 -0700
4629 --- alpine-2.20.maildir/README.maildir 2015-01-20 20:37:55.963011681 -0700
4633 + ---------------------------------------
4635 + Maildir Driver for Alpine 2.0
4639 + ---------------------------------------
4640 + 1. General Information About This Patch
4641 + ---------------------------------------
4643 + This patch adds support for the maildir format to Alpine. We take the
4644 + approach that this patch is one more driver among the number of formats
4645 + supported by Alpine (more generally c-client). This approach differs from
4646 + older versions of similar patches, in that once a maildir patch was
4647 + applied, it was assumed that all your folders would be created in the
4650 + This patch does not assume that maildir is a preferred format, instead
4651 + puts maildir in equal footing with other formats (mbox, mbx, mix, etc),
4652 + and so a maildir folder in the mail/ collection is treated in the same way
4653 + as any other folder in any other format. In other words, just by reading
4654 + the name of a folder, or opening it, or doing any operation with it, you
4655 + can not know in which format the folder is.
4657 + This implies that if you want to add a folder in the maildir format to the
4658 + mail/ collection, then you must add by pressing "A" in the folder list
4659 + collection and enter "#driver.md/mail/name_maildir_folder".
4661 + If you only want to use maildir, however, you can do so too. In this case,
4662 + you must create a maildir collection. In that collection, only maildir
4663 + folders will be listed. If there is any folder in any other format, that
4664 + folder will be ignored. In another words, any folder listed there is in
4665 + maildir format and can be accessed through that collection, conversely,
4666 + any folder not listed there is not in maildir format and there is no way
4667 + to access it using this collection.
4669 + In order to create a maildir collection, you could press M S L, and "A" to
4670 + add a collection. Fill in the required fields as follows:
4672 + Nickname : Anything
4674 + Path : #md/relative/path/to/maildir/collection/
4677 + For example, if "path" is set to "#md/mail/", then Alpine will look for your
4678 + maildir folders that are in ~/mail/.
4680 + The code in this patch is mostly based in code for the unix driver plus
4681 + some combinations of the mh, mbx and nntp drivers for the c-client
4682 + library. Those drivers were designed by Mark Crispin, and bugs in this
4683 + code are not his bugs, but my own.
4685 + I got all the specification for this patch from
4686 + http://cr.yp.to/proto/maildir.html. If you know of a place with a better
4687 + specification for maildir format please let me know. The method this patch
4688 + uses to create a unique filename for a message is one of the "old
4689 + fashioned" methods. I realize that this is old fashioned, but it is
4690 + portable, and portability is the main reason why I decided to use an old
4691 + fashioned method (most methods are not portable. See the word
4692 + "Unfortunately" in that document).
4698 + It is intended that this code will work well with any application
4699 + written using the c-client library. Of paramount importance is to make the
4700 + associated imap server work well when the server accesses a folder in
4701 + Maildir format. The program mailutil should also work flawlessly with this
4702 + implemetation of the driver.
4704 + It is intended that this driver be fast and stable. We intend not to
4705 + patch Alpine to make this driver do its work, unless such patching is for
4706 + fixing bugs in Alpine or to pass parameters to the driver.
4708 + ------------------------------------------------------------------------
4709 + 3. What are the known bugs of this implementation of the Maildir driver?
4710 + ------------------------------------------------------------------------
4712 + I don't know any at this time. There have been bugs before, though, but
4713 + I try to fix bugs as soon as they are reported.
4719 + This patch keeps uids in the name of the file that contains the message,
4720 + by adding a ",u=" string to the file name to save the uid of a message. A
4721 + file is kept between sessions to save information on the last uid assigned
4722 + and its time of validity. Only one session with writing access can write
4723 + uids, all others must wait for the other session to assign them. The
4724 + session assigning uids creates a ".uidtemp" file which other sessions must
4727 + Uid support appeared in Alpine 1.00 (snapshot 925), and is experimental,
4728 + please report any problems.
4730 + ----------------------------------------------
4731 + 5. Configuring Alpine and Setting up a Maildir
4732 + ----------------------------------------------
4734 + Once this approach was chosen, it implied the following:
4736 + * This patch assumes that your INBOX is located at "$HOME/Maildir".
4737 + This is a directory which should have three subdirectories "cur",
4738 + "tmp" and "new". Mail is delivered to 'new' and read from 'cur'. I
4739 + have added a configuration option "maildir-location" which can be
4740 + used to tell Alpine where your Maildir inbox is, in case your system
4741 + does not use the above directory (e.g. your system may use
4742 + "~/.maildir"). In this case define that variable to be the name of
4743 + the directory where your e-mail is being delivered (e.g.
4746 + * If you want to use the above configuration as your inbox, you must
4747 + define your inbox-path as "#md/inbox" (no quotes). You can define
4748 + the inbox-path like above even if you have changed the
4749 + maildir-location variable. That's the whole point of that variable.
4751 + -------------------------------------------
4752 + 6. What about Courier/Dovecot file systems?
4753 + -------------------------------------------
4755 + In a courier file system all folders are subfolders of a root folder
4756 + called INBOX. Normally INBOX is located at ~/Maildir and subfolders are
4757 + "dot" directories in ~/Maildir. For example ~/Maildir/.Trash is a
4758 + subfolder of INBOX and is accessed with the nickname "INBOX.Trash".
4760 + You can not access folders in this way unless you preceed them with the
4761 + string "#mc/". The purpose of the string "#mc/" is to warn Alpine that a
4762 + collection in the Courier format is going to be accessed. Therefore, you
4763 + can SELECT a folder like "#mc/INBOX.Trash", but not "INBOX.Trash"
4765 + You can access a collection through a server, but if you want to access a
4766 + collection of folders created using the Courier server, you MUST edit your
4767 + ".pinerc" file and enter the definition of the collection as follows:
4769 + folder-collections="Anything you want" #mc/INBOX.[]
4771 + You can replace the string "#mc/INBOX." by something different, for example
4772 + "#mc/Courier/." will make Alpine search for your collection in ~/Courier.
4774 + You can not add this setting directly into Alpine because Alpine fails to
4775 + accept this value from its input, but it takes it correctly when it is
4776 + added through the ".pinerc" file.
4778 + You can access your inbox as "#mc/INBOX" or "#md/INBOX". Both definitions
4779 + point to the same place.
4781 + Last Updated May 28, 2011
4782 diff -rc alpine-2.20/web/src/alpined.d/Makefile alpine-2.20.maildir/web/src/alpined.d/Makefile
4783 *** alpine-2.20/web/src/alpined.d/Makefile 2015-01-18 00:00:55.339703310 -0700
4784 --- alpine-2.20.maildir/web/src/alpined.d/Makefile 2015-01-20 20:38:26.693015664 -0700
4789 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
4790 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing aclocal-1.13
4792 AM_CFLAGS = -g -pthread
4793 AM_DEFAULT_VERBOSITY = 1
4794 AM_LDFLAGS = `cat ../../../c-client/LDFLAGS`
4796 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoconf
4797 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing autoheader
4798 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing automake-1.13
4801 CCDEPMODE = depmode=gcc3
4805 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
4806 ! ACLOCAL = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing aclocal-1.13
4808 AM_CFLAGS = -g -pthread
4809 AM_DEFAULT_VERBOSITY = 1
4810 AM_LDFLAGS = `cat ../../../c-client/LDFLAGS`
4812 ! AUTOCONF = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoconf
4813 ! AUTOHEADER = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing autoheader
4814 ! AUTOMAKE = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing automake-1.13
4817 CCDEPMODE = depmode=gcc3
4821 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4822 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4823 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5"
4824 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4825 C_CLIENT_TARGET = lsu
4826 C_CLIENT_WITH_IPV6 = touch imap/ip6
4829 C_CLIENT_CFLAGS = EXTRACFLAGS=" -DTLSV1_2 -I/usr/include/openssl -g"
4830 C_CLIENT_GCCOPTLEVEL = GCCOPTLEVEL="-O0"
4831 ! C_CLIENT_LDFLAGS = EXTRALDFLAGS=" -L/usr/lib -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5"
4832 C_CLIENT_SPECIALS = SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib SSLDIR=/etc/ssl SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private EXTRAAUTHENTICATORS=gss
4833 C_CLIENT_TARGET = lsu
4834 C_CLIENT_WITH_IPV6 = touch imap/ip6
4840 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lcrypto -lssl -ldl -ltinfo -lpam -lkrb5
4841 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4842 LIBTOOL_DEPS = ./ltmain.sh
4848 ! LIBS = -ltcl8.6 -lgssapi_krb5 -lpam -lldap -lcrypto -lssl -ldl -ltinfo -llber -lpam -lkrb5
4849 LIBTOOL = $(SHELL) $(top_builddir)/libtool
4850 LIBTOOL_DEPS = ./ltmain.sh
4856 MAKE = /usr/bin/make
4857 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/missing makeinfo
4859 MKDIR_P = /usr/bin/mkdir -p
4860 MSGFMT = /usr/bin/msgfmt
4864 MAKE = /usr/bin/make
4865 ! MAKEINFO = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/missing makeinfo
4867 MKDIR_P = /usr/bin/mkdir -p
4868 MSGFMT = /usr/bin/msgfmt
4871 WEB_PUBCOOKIE_LINK =
4872 XGETTEXT = /usr/bin/xgettext
4873 XGETTEXT_015 = /usr/bin/xgettext
4874 ! abs_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/web/src/alpined.d
4875 ! abs_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/web/src/alpined.d
4876 ! abs_top_builddir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4877 ! abs_top_srcdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20
4882 WEB_PUBCOOKIE_LINK =
4883 XGETTEXT = /usr/bin/xgettext
4884 XGETTEXT_015 = /usr/bin/xgettext
4885 ! abs_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/web/src/alpined.d
4886 ! abs_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/web/src/alpined.d
4887 ! abs_top_builddir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4888 ! abs_top_srcdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir
4895 includedir = ${prefix}/include
4896 infodir = ${datarootdir}/info
4897 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/install-sh
4898 libdir = ${exec_prefix}/lib
4899 libexecdir = ${exec_prefix}/libexec
4900 localedir = ${datadir}/locale
4903 includedir = ${prefix}/include
4904 infodir = ${datarootdir}/info
4905 ! install_sh = ${SHELL} /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/install-sh
4906 libdir = ${exec_prefix}/lib
4907 libexecdir = ${exec_prefix}/libexec
4908 localedir = ${datadir}/locale
4912 # This is because alpined, libwpcomm and friends are
4913 # not intended for system-wide consumption
4914 ! locbindir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/web/src/alpined.d/../../bin
4915 ! loclibdir = /home/echappa/backup/011115.0/public_html/alpine/release/src/alpine-2.20/web/src/alpined.d/../../lib
4916 alpined_SOURCES = alpined.c busy.c color.c imap.c ldap.c remote.c \
4917 signal.c debug.c status.c stubs.c \
4918 alpined.h color.h ldap.h
4921 # This is because alpined, libwpcomm and friends are
4922 # not intended for system-wide consumption
4923 ! locbindir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/web/src/alpined.d/../../bin
4924 ! loclibdir = /home/echappa/backup/011115.0/alpine/alpine-2.20.maildir/web/src/alpined.d/../../lib
4925 alpined_SOURCES = alpined.c busy.c color.c imap.c ldap.c remote.c \
4926 signal.c debug.c status.c stubs.c \
4927 alpined.h color.h ldap.h