Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

commited Alpine snapshot

  • Loading branch information...
commit cb043aee61d14cd38cea98bcedd8adf783e11e68 1 parent f72dc44
University of Washington - Alpine team authored Andraž Levstik committed

Showing 930 changed files with 5,322 additions and 881 deletions. Show diff stats Hide diff stats

  1. +1 1  Makefile.am
  2. +2 2 README
  3. +1 1  VERSION
  4. +3 3 alpine/Makefile.am
  5. +5 3 alpine/addrbook.c
  6. +1 1  alpine/addrbook.h
  7. +1 1  alpine/adrbkcmd.c
  8. +1 1  alpine/adrbkcmd.h
  9. +3 1 alpine/alpine.c
  10. +1 1  alpine/alpine.h
  11. +1 1  alpine/arg.c
  12. +1 1  alpine/arg.h
  13. +1 1  alpine/brk2pine.sh
  14. +1 1  alpine/colorconf.c
  15. +1 1  alpine/colorconf.h
  16. +1 1  alpine/confscroll.c
  17. +1 1  alpine/confscroll.h
  18. +1 1  alpine/conftype.h
  19. +1 1  alpine/context.c
  20. +1 1  alpine/context.h
  21. +1 1  alpine/dispfilt.c
  22. +1 1  alpine/dispfilt.h
  23. +1 1  alpine/flagmaint.c
  24. +1 1  alpine/flagmaint.h
  25. +1 1  alpine/folder.c
  26. +1 1  alpine/folder.h
  27. +1 1  alpine/headers.h
  28. +1 1  alpine/help.c
  29. +1 1  alpine/help.h
  30. +31 10 alpine/imap.c
  31. +1 1  alpine/imap.h
  32. +1 1  alpine/kblock.c
  33. +1 1  alpine/kblock.h
  34. +1 1  alpine/keymenu.c
  35. +1 1  alpine/keymenu.h
  36. BIN  alpine/ldap32.dll
  37. +1 1  alpine/ldapconf.c
  38. +1 1  alpine/ldapconf.h
  39. +1 1  alpine/listsel.c
  40. +1 1  alpine/listsel.h
  41. +24 18 alpine/mailcmd.c
  42. +1 1  alpine/mailcmd.h
  43. +1 1  alpine/mailindx.c
  44. +1 1  alpine/mailindx.h
  45. +1 1  alpine/mailpart.c
  46. +1 1  alpine/mailpart.h
  47. +1 1  alpine/mailtrfc.sh
  48. +9 1 alpine/mailview.c
  49. +1 1  alpine/mailview.h
  50. +4 2 alpine/makefile.wnt
  51. +333 0 alpine/newmail.c
  52. +22 0 alpine/newmail.h
  53. +2 2 alpine/newuser.c
  54. +1 1  alpine/newuser.h
  55. +1 1  alpine/osdep/Makefile.am
  56. BIN  alpine/osdep/alpine-splash.bmp
  57. +1 1  alpine/osdep/chnge_pw.c
  58. +1 1  alpine/osdep/chnge_pw.h
  59. +1 1  alpine/osdep/debuging.c
  60. +1 1  alpine/osdep/debuging.h
  61. +1 1  alpine/osdep/diskquot.non.c
  62. +1 1  alpine/osdep/execview.c
  63. +1 1  alpine/osdep/execview.h
  64. +1 1  alpine/osdep/fltrname.c
  65. +1 1  alpine/osdep/fltrname.h
  66. +1 1  alpine/osdep/jobcntrl.c
  67. +1 1  alpine/osdep/jobcntrl.h
  68. +6 6 alpine/osdep/mswin.rc
  69. +2 2 alpine/osdep/mswinver.c
  70. +1 1  alpine/osdep/print.c
  71. +1 1  alpine/osdep/print.h
  72. +1 1  alpine/osdep/termin.gen.c
  73. +1 1  alpine/osdep/termin.gen.h
  74. +1 1  alpine/osdep/termin.unx.c
  75. +1 1  alpine/osdep/termin.unx.h
  76. +1 1  alpine/osdep/termout.gen.c
  77. +1 1  alpine/osdep/termout.gen.h
  78. +1 1  alpine/osdep/termout.unx.c
  79. +1 1  alpine/osdep/termout.unx.h
  80. +1 1  alpine/pine-use.c
  81. +1 1  alpine/print.c
  82. +1 1  alpine/print.h
  83. +1 1  alpine/radio.c
  84. +1 1  alpine/radio.h
  85. +1 1  alpine/remote.c
  86. +1 1  alpine/remote.h
  87. +1 1  alpine/reply.c
  88. +1 1  alpine/reply.h
  89. +3 4 alpine/roleconf.c
  90. +1 1  alpine/roleconf.h
  91. +1 1  alpine/rpdump.c
  92. +1 1  alpine/rpload.c
  93. +1 1  alpine/send.c
  94. +1 1  alpine/send.h
  95. +1 1  alpine/setup.c
  96. +1 1  alpine/setup.h
  97. +1 1  alpine/signal.c
  98. +1 1  alpine/signal.h
  99. +1 1  alpine/smime.c
  100. +1 1  alpine/smime.h
  101. +1 1  alpine/status.c
  102. +1 1  alpine/status.h
  103. +1 1  alpine/takeaddr.c
  104. +1 1  alpine/takeaddr.h
  105. +1 1  alpine/talk.h
  106. +4 2 alpine/titlebar.c
  107. +1 1  alpine/titlebar.h
  108. +126 58 configure.ac
  109. +2 2 doc/alpine.1
  110. +2 2 doc/pico.1
  111. +7 3 doc/tech-notes.txt
  112. +1 1  doc/tech-notes/index.html
  113. +8 3 doc/tech-notes/low-level.html
  114. +2 1  imap/Makefile
  115. +3 7 imap/src/c-client/imap4r1.c
  116. 0  imap/src/osdep/dos/drivers.bat
  117. 0  imap/src/osdep/dos/mkauths.bat
  118. +0 118 imap/src/osdep/nt/makefile.old
  119. +8 0 imap/src/osdep/unix/Makefile
  120. +2 2 imap/src/osdep/unix/env_unix.c
  121. +63 0 imap/src/osdep/unix/os_a52.c
  122. +53 0 imap/src/osdep/unix/os_a52.h
  123. 0  imap/src/osdep/wce/drivers.bat
  124. 0  imap/src/osdep/wce/drivraux.bat
  125. 0  imap/src/osdep/wce/mkautaux.bat
  126. 0  imap/src/osdep/wce/mkauths.bat
  127. 0  imap/src/osdep/wce/setproto.bat
  128. +12 4 include/config.h.in
  129. +3 3 include/config.wnt.h
  130. +1 1  include/general.h
  131. +1 1  include/system.h
  132. BIN  ldap/binaries/debug/ldap32.dll
  133. BIN  ldap/binaries/debug/ldap32.lib
  134. BIN  ldap/binaries/debug/libldap.dll
  135. BIN  ldap/binaries/debug/libldap.lib
  136. BIN  ldap/binaries/debug/ltest.exe
  137. BIN  ldap/binaries/debug/ltest32.exe
  138. BIN  ldap/binaries/release/ldap32.dll
  139. BIN  ldap/binaries/release/ldap32.lib
  140. BIN  ldap/binaries/release/libldap.dll
  141. BIN  ldap/binaries/release/libldap.lib
  142. +677 0 ldap/disptmpl.cfg
  143. +330 0 ldap/inckit/disptmpl.h
  144. +184 0 ldap/inckit/lber.h
  145. +592 0 ldap/inckit/ldap.h
  146. +133 0 ldap/inckit/msdos.h
  147. +102 0 ldap/inckit/proto-lb.h
  148. +276 0 ldap/inckit/proto-ld.h
  149. +106 0 ldap/inckit/srchpref.h
  150. +368 0 ldap/kbind.c
  151. BIN  ldap/ldap32.gid
  152. BIN  ldap/ldap32.hlp
  153. +105 0 ldap/ldfilter.cfg
  154. +242 0 ldap/ldfriend.cfg
  155. +1 0  ldap/lib
  156. BIN  ldap/libldap.hlp
  157. +667 0 ldap/libldap.mak
  158. +218 0 ldap/readme.txt
  159. +153 0 ldap/srchpref.cfg
  160. +2 2 mapi/ReadmeMapi32.txt
  161. +2 2 mapi/pmapi.c
  162. +5 5 mapi/pmapi.rc
  163. +1 1  packages/alpine.spec
  164. +3 3 packages/debian/changelog
  165. +1 1  pico/Makefile.am
  166. +1 1  pico/attach.c
  167. +1 1  pico/basic.c
  168. +1 1  pico/bind.c
  169. +1 1  pico/browse.c
  170. +1 1  pico/buffer.c
  171. +11 2 pico/composer.c
  172. +1 1  pico/display.c
  173. +1 1  pico/ebind.h
  174. +1 1  pico/edef.h
  175. +1 1  pico/efunc.h
  176. +1 1  pico/estruct.h
  177. +1 1  pico/file.c
  178. +1 1  pico/fileio.c
  179. +1 1  pico/headers.h
  180. +1 1  pico/keydefs.h
  181. +1 1  pico/line.c
  182. +4 4 pico/main.c
  183. +1 1  pico/mode.h
  184. +2 2 pico/mswinver.c
  185. +1 1  pico/osdep/Makefile.am
  186. +1 1  pico/osdep/altedit.c
  187. +1 1  pico/osdep/altedit.h
  188. +1 1  pico/osdep/chkpoint.c
  189. +1 1  pico/osdep/chkpoint.h
  190. +1 1  pico/osdep/color.c
  191. +1 1  pico/osdep/color.h
  192. +1 1  pico/osdep/filesys.c
  193. +1 1  pico/osdep/filesys.h
  194. +1 1  pico/osdep/fsync.h
  195. +1 1  pico/osdep/getkey.c
  196. +1 1  pico/osdep/getkey.h
  197. +1 1  pico/osdep/mouse.c
  198. +1 1  pico/osdep/mouse.h
  199. +1 1  pico/osdep/msdlg.c
  200. +6 6 pico/osdep/mswin.rc
  201. +1 1  pico/osdep/newmail.c
  202. +1 1  pico/osdep/newmail.h
  203. +1 1  pico/osdep/popen.c
  204. +1 1  pico/osdep/popen.h
  205. +1 1  pico/osdep/raw.c
  206. +1 1  pico/osdep/raw.h
  207. +1 1  pico/osdep/read.c
  208. +1 1  pico/osdep/read.h
  209. +1 1  pico/osdep/shell.c
  210. +1 1  pico/osdep/shell.h
  211. +1 1  pico/osdep/signals.c
  212. +1 1  pico/osdep/signals.h
  213. +1 1  pico/osdep/spell.c
  214. +1 1  pico/osdep/spell.h
  215. +1 1  pico/osdep/terminal.c
  216. +1 1  pico/osdep/terminal.h
  217. +1 1  pico/osdep/truncate.h
  218. +1 1  pico/osdep/tty.c
  219. +1 1  pico/osdep/tty.h
  220. +1 1  pico/pico.c
  221. +3 3 pico/pico.h
  222. +4 4 pico/pilot.c
  223. +1 1  pico/random.c
  224. +1 1  pico/region.c
  225. +1 1  pico/search.c
  226. +1 1  pico/utf8stub.c
  227. +1 1  pico/utf8stub.h
  228. +1 1  pico/window.c
  229. +1 1  pico/word.c
  230. +1 1  pith/Makefile.am
  231. +1 1  pith/abdlc.c
  232. +1 1  pith/abdlc.h
  233. +35 21 pith/ablookup.c
  234. +4 2 pith/ablookup.h
  235. +1 1  pith/addrstring.c
  236. +1 1  pith/addrstring.h
  237. +1 1  pith/adjtime.c
  238. +1 1  pith/adjtime.h
  239. +20 4 pith/adrbklib.c
  240. +1 1  pith/adrbklib.h
  241. +1 1  pith/atttype.h
  242. +1 1  pith/bitmap.h
  243. +1 1  pith/bldaddr.c
  244. +1 1  pith/bldaddr.h
  245. +1 1  pith/busy.h
  246. +1 1  pith/charconv/Makefile.am
  247. +1 1  pith/charconv/filesys.c
  248. +1 1  pith/charconv/filesys.h
  249. +2 1  pith/charconv/utf8.c
  250. +1 1  pith/charconv/utf8.h
  251. +1 1  pith/charset.c
  252. +1 1  pith/charset.h
  253. +1 1  pith/color.c
  254. +1 1  pith/color.h
  255. +45 8 pith/conf.c
  256. +1 1  pith/conf.h
  257. +1 1  pith/conftype.h
  258. +1 1  pith/context.c
  259. +1 1  pith/context.h
  260. +1 1  pith/copyaddr.c
  261. +1 1  pith/copyaddr.h
  262. +1 1  pith/debug.h
  263. +1 1  pith/detach.c
  264. +1 1  pith/detach.h
  265. +1 1  pith/detoken.c
  266. +1 1  pith/detoken.h
  267. +1 1  pith/editorial.c
  268. +1 1  pith/editorial.h
  269. +1 1  pith/escapes.c
  270. +1 1  pith/escapes.h
  271. +10 5 pith/filter.c
  272. +1 1  pith/filter.h
  273. +1 1  pith/filttype.h
  274. +1 1  pith/flag.c
  275. +1 1  pith/flag.h
  276. +1 1  pith/folder.c
  277. +1 1  pith/folder.h
  278. +1 1  pith/foldertype.h
  279. +1 1  pith/handle.c
  280. +1 1  pith/handle.h
  281. +1 1  pith/headers.h
  282. +1 1  pith/help.c
  283. +1 1  pith/help.h
  284. +1 1  pith/helpindx.c
  285. +1 1  pith/hist.c
  286. +1 1  pith/hist.h
  287. +1 1  pith/icache.c
  288. +1 1  pith/icache.h
  289. +1 1  pith/imap.c
  290. +1 1  pith/imap.h
  291. +1 1  pith/indxtype.h
  292. +1 1  pith/init.c
  293. +1 1  pith/init.h
  294. +1 1  pith/keyword.c
  295. +1 1  pith/keyword.h
  296. +7 8 pith/ldap.c
  297. +1 1  pith/ldap.h
  298. +1 1  pith/list.c
  299. +1 1  pith/list.h
  300. +1 1  pith/mailcap.c
  301. +1 1  pith/mailcap.h
  302. +1 1  pith/mailcmd.c
  303. +1 1  pith/mailcmd.h
  304. +3 2 pith/mailindx.c
  305. +1 1  pith/mailindx.h
  306. +1 1  pith/maillist.c
  307. +1 1  pith/maillist.h
  308. +1 1  pith/mailpart.h
  309. +4 3 pith/mailview.c
  310. +1 1  pith/mailview.h
  311. +1 1  pith/margin.c
  312. +1 1  pith/margin.h
  313. +1 1  pith/mimedesc.c
  314. +1 1  pith/mimedesc.h
  315. +1 1  pith/mimetype.c
  316. +1 1  pith/mimetype.h
  317. +1 1  pith/msgno.c
  318. +1 1  pith/msgno.h
  319. +16 299 pith/newmail.c
  320. +1 1  pith/newmail.h
  321. +1 1  pith/news.c
  322. +1 1  pith/news.h
Sorry, we could not display the entire diff because too many files (930) changed.
2  Makefile.am
@@ -30,7 +30,7 @@ c-client:
30 30 cd imap && $(MAKE) $(C_CLIENT_TARGET) $(C_CLIENT_CFLAGS) $(C_CLIENT_LDFLAGS) $(C_CLIENT_GCCOPTLEVEL) EXTRASPECIALS="$(C_CLIENT_SPECIALS)"
31 31
32 32 gssapi_proxy.l:
33   - if test ! -L c-client/auth_gss_proxy.c ; then $(LN_S) $(abs_top_srcdir)/web/src/pubcookie/auth_gss_proxy.c c-client/auth_gss_proxy.c ; fi
  33 + if test ! -L c-client/auth_gss_proxy.c ; then $(LN_S) @abs_top_srcdir@/web/src/pubcookie/auth_gss_proxy.c c-client/auth_gss_proxy.c ; fi
34 34
35 35 clean-local:
36 36 cd imap && $(MAKE) clean
4 README
@@ -6,7 +6,7 @@
6 6
7 7
8 8 /* ====================================================================
9   - * Copyright 2006-2008 University of Washington
  9 + * Copyright 2006-2009 University of Washington
10 10 *
11 11 * Licensed under the Apache License, Version 2.0 (the "License");
12 12 * you may not use this file except in compliance with the License.
@@ -144,4 +144,4 @@ done by hand.
144 144
145 145 --
146 146 alpine.tar.z README
147   -$Id: README 964 2008-03-14 23:53:39Z jpf@u.washington.edu $
  147 +$Id: README 1204 2009-02-02 19:54:23Z hubert@u.washington.edu $
2  VERSION
... ... @@ -1 +1 @@
1   -2.00
  1 +2.01
6 alpine/Makefile.am
@@ -20,7 +20,7 @@ alpine_SOURCES = addrbook.c adrbkcmd.c after.c alpine.c arg.c busy.c colorconf.c
20 20 confscroll.c context.c dispfilt.c flagmaint.c folder.c help.c imap.c \
21 21 init.c kblock.c keymenu.c ldapconf.c listsel.c mailcmd.c mailindx.c \
22 22 mailpart.c mailview.c newuser.c pattern.c pipe.c print.c radio.c remote.c reply.c \
23   - roleconf.c send.c setup.c signal.c status.c takeaddr.c titlebar.c smime.c
  23 + roleconf.c send.c setup.c signal.c status.c takeaddr.c titlebar.c smime.c newmail.c
24 24
25 25 alpine_LDADD = $(LDADD) $(INTLLIBS)
26 26
@@ -37,9 +37,9 @@ LDADD = ../pico/libpico.a ../pico/osdep/libpicoosd.a \
37 37 ../pith/charconv/libpithcc.a \
38 38 osdep/libpineosd.a ../c-client/c-client.a
39 39
40   -AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include -DLOCALEDIR=\"$(localedir)\"
  40 +AM_CPPFLAGS = -I@top_builddir@/include -I@top_srcdir@/include -DLOCALEDIR=\"$(localedir)\"
41 41
42   -AM_LDFLAGS = `cat $(top_srcdir)/c-client/LDFLAGS`
  42 +AM_LDFLAGS = `cat @top_srcdir@/c-client/LDFLAGS`
43 43
44 44 CLEANFILES = date.c
45 45
8 alpine/addrbook.c
... ... @@ -1,10 +1,10 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: addrbook.c 1009 2008-03-25 18:57:53Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: addrbook.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
6 6 * ========================================================================
7   - * Copyright 2006-2008 University of Washington
  7 + * Copyright 2006-2009 University of Washington
8 8 *
9 9 * Licensed under the Apache License, Version 2.0 (the "License");
10 10 * you may not use this file except in compliance with the License.
@@ -7026,6 +7026,8 @@ abook_nickname_complete(char *prefix, char **answer, int tabtab, unsigned flags)
7026 7026 char *saved_beginning = NULL;
7027 7027 char *potential_answer = NULL;
7028 7028
  7029 + wp_exit = wp_nobail = 0;
  7030 +
7029 7031 /* there shouldn't be a case where answer is NULL */
7030 7032 if(answer)
7031 7033 *answer = NULL;
@@ -7060,7 +7062,7 @@ abook_nickname_complete(char *prefix, char **answer, int tabtab, unsigned flags)
7060 7062
7061 7063 completions = adrbk_list_of_completions(prefix,
7062 7064 ps_global->cur_uid_stream, ps_global->cur_uid,
7063   - ALC_INCLUDE_ADDRS | ((strlen(prefix) >= 5) ? ALC_INCLUDE_LDAP : 0));
  7065 + ALC_INCLUDE_ADDRS | ((strlen(prefix) >= 3) ? ALC_INCLUDE_LDAP : 0));
7064 7066
7065 7067 if(!completions)
7066 7068 ambiguity = 0;
2  alpine/addrbook.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: addrbook.h 1004 2008-03-19 19:43:03Z hubert@u.washington.edu $
  2 + * $Id: addrbook.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
2  alpine/adrbkcmd.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: adrbkcmd.c 1060 2008-05-30 16:52:41Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: adrbkcmd.c 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/adrbkcmd.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: adrbkcmd.h 1006 2008-03-21 21:31:58Z hubert@u.washington.edu $
  2 + * $Id: adrbkcmd.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
4 alpine/alpine.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: alpine.c 1071 2008-06-03 22:31:05Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: alpine.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
@@ -60,6 +60,7 @@ static char rcsid[] = "$Id: alpine.c 1071 2008-06-03 22:31:05Z hubert@u.washingt
60 60 #include "print.h"
61 61 #include "after.h"
62 62 #include "smime.h"
  63 +#include "newmail.h"
63 64 #ifndef _WINDOWS
64 65 #include "../pico/osdep/raw.h" /* for STD*_FD */
65 66 #endif
@@ -165,6 +166,7 @@ main(int argc, char **argv)
165 166 pith_opt_condense_thread_cue = condensed_thread_cue;
166 167 pith_opt_truncate_sfstr = truncate_subj_and_from_strings;
167 168 pith_opt_save_and_restore = save_and_restore;
  169 + pith_opt_newmail_announce = newmail_status_message;
168 170 pith_opt_newmail_check_cue = newmail_check_cue;
169 171 pith_opt_checkpoint_cue = newmail_check_point_cue;
170 172 pith_opt_icon_text = icon_text;
2  alpine/alpine.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: alpine.h 537 2007-04-24 23:27:18Z hubert@u.washington.edu $
  2 + * $Id: alpine.h 767 2007-10-24 00:03:59Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/arg.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: arg.c 897 2008-01-04 22:49:15Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: arg.c 900 2008-01-05 01:13:26Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/arg.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: arg.h 136 2006-09-22 20:06:05Z hubert@u.washington.edu $
  2 + * $Id: arg.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/brk2pine.sh
... ... @@ -1,6 +1,6 @@
1 1 #!/bin/sh
2 2 #
3   -# $Id: brk2pine.sh 137 2006-09-22 21:34:06Z mikes@u.washington.edu $
  3 +# $Id: brk2pine.sh 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
4 4 #
5 5 # T H E P I N E M A I L S Y S T E M
6 6 #
2  alpine/colorconf.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: colorconf.c 929 2008-02-08 18:39:55Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: colorconf.c 934 2008-02-23 00:44:29Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/colorconf.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: colorconf.h 673 2007-08-16 22:25:10Z hubert@u.washington.edu $
  2 + * $Id: colorconf.h 769 2007-10-24 00:15:40Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/confscroll.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: confscroll.c 1156 2008-08-21 22:14:45Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: confscroll.c 1169 2008-08-27 06:42:06Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/confscroll.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: confscroll.h 809 2007-11-09 21:13:47Z hubert@u.washington.edu $
  2 + * $Id: confscroll.h 812 2007-11-10 01:00:15Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/conftype.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: conftype.h 1006 2008-03-21 21:31:58Z hubert@u.washington.edu $
  2 + * $Id: conftype.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
2  alpine/context.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: context.c 678 2007-08-20 23:05:24Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: context.c 769 2007-10-24 00:15:40Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/context.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: context.h 136 2006-09-22 20:06:05Z hubert@u.washington.edu $
  2 + * $Id: context.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/dispfilt.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: dispfilt.c 971 2008-03-18 17:24:31Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: dispfilt.c 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/dispfilt.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: dispfilt.h 140 2006-09-26 19:30:49Z hubert@u.washington.edu $
  2 + * $Id: dispfilt.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/flagmaint.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: flagmaint.c 787 2007-11-02 23:36:16Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: flagmaint.c 807 2007-11-09 01:21:33Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/flagmaint.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: flagmaint.h 786 2007-11-02 23:23:04Z hubert@u.washington.edu $
  2 + * $Id: flagmaint.h 807 2007-11-09 01:21:33Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/folder.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: folder.c 1143 2008-08-14 00:51:47Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: folder.c 1144 2008-08-14 16:53:34Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/folder.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: folder.h 529 2007-04-18 22:41:05Z hubert@u.washington.edu $
  2 + * $Id: folder.h 767 2007-10-24 00:03:59Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/headers.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: headers.h 202 2006-10-25 23:31:02Z jpf@u.washington.edu $
  2 + * $Id: headers.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/help.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: help.c 1028 2008-04-10 16:50:54Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: help.c 1032 2008-04-11 00:30:04Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/help.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: help.h 673 2007-08-16 22:25:10Z hubert@u.washington.edu $
  2 + * $Id: help.h 769 2007-10-24 00:15:40Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
41 alpine/imap.c
... ... @@ -1,10 +1,10 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: imap.c 1030 2008-04-10 21:26:20Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: imap.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
6 6 * ========================================================================
7   - * Copyright 2006-2008 University of Washington
  7 + * Copyright 2006-2009 University of Washington
8 8 *
9 9 * Licensed under the Apache License, Version 2.0 (the "License");
10 10 * you may not use this file except in compliance with the License.
@@ -2180,11 +2180,19 @@ read_passfile(pinerc, l)
2180 2180 strncpy(blobcopy, (char *) blob, blength);
2181 2181 blobcopy[blength] = '\0';
2182 2182
  2183 + /*
  2184 + * I'm not real clear on how this works. It seems to be
  2185 + * necessary to combine the attributes from two passes
  2186 + * (attrList->count == 2) in order to get the full set
  2187 + * of attributes we inserted into the keychain in the
  2188 + * first place. So, we reset host...orighost outside of
  2189 + * the following for loop, not inside.
  2190 + */
  2191 + host = user = sflags = passwd = orighost = NULL;
  2192 + ui[0] = ui[1] = ui[2] = ui[3] = ui[4] = NULL;
  2193 +
2183 2194 for(k = 0; k < attrList->count; k++){
2184 2195
2185   - host = user = sflags = passwd = orighost = NULL;
2186   - ui[0] = ui[1] = ui[2] = ui[3] = ui[4] = NULL;
2187   -
2188 2196 if(attrList->attr[k].length){
2189 2197 strncpy(target,
2190 2198 (char *) attrList->attr[k].data,
@@ -2201,9 +2209,14 @@ read_passfile(pinerc, l)
2201 2209 tmp[i++] = '\0'; /* tie off data */
2202 2210 }
2203 2211
2204   - host = ui[0];
2205   - user = ui[1];
2206   - sflags = ui[2];
  2212 + if(ui[0])
  2213 + host = ui[0];
  2214 +
  2215 + if(ui[1])
  2216 + user = ui[1];
  2217 +
  2218 + if(ui[2])
  2219 + sflags = ui[2];
2207 2220
2208 2221 for(i = 0, j = 3; blobcopy[i] && j < 5; j++){
2209 2222 for(ui[j] = &blobcopy[i]; blobcopy[i] && blobcopy[i] != '\t'; i++)
@@ -2213,8 +2226,13 @@ read_passfile(pinerc, l)
2213 2226 blobcopy[i++] = '\0'; /* tie off data */
2214 2227 }
2215 2228
2216   - passwd = ui[3];
2217   - orighost = ui[4];
  2229 + if(ui[3])
  2230 + passwd = ui[3];
  2231 +
  2232 + if(ui[4])
  2233 + orighost = ui[4];
  2234 +
  2235 + dprint((10, "read_passfile: host=%s user=%s sflags=%s passwd=%s orighost=%s\n", host?host:"", user?user:"", sflags?sflags:"", passwd?passwd:"", orighost?orighost:""));
2218 2236 }
2219 2237
2220 2238 if(passwd && host && user){ /* valid field? */
@@ -2395,6 +2413,9 @@ write_passfile(pinerc, l)
2395 2413 ? "\t" : "",
2396 2414 (l->hosts && l->hosts->next && l->hosts->next->name)
2397 2415 ? l->hosts->next->name : "");
  2416 +
  2417 + dprint((10, "write_passfile: SecKeychainAddGenericPassword(NULL, %d, %s, %d, %s, %d, %s, NULL)\n", strlen(target), target, strlen(TNAME), TNAME, strlen(blob), blob));
  2418 +
2398 2419 rc = SecKeychainAddGenericPassword(NULL,
2399 2420 strlen(target), target,
2400 2421 strlen(TNAME), TNAME,
2  alpine/imap.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: imap.h 1033 2008-04-24 02:00:26Z mikes@u.washington.edu $
  2 + * $Id: imap.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/kblock.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: kblock.c 1014 2008-03-26 17:27:45Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: kblock.c 1025 2008-04-08 22:59:38Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/kblock.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: kblock.h 869 2007-12-13 23:41:46Z mikes@u.washington.edu $
  2 + * $Id: kblock.h 870 2007-12-14 06:45:43Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006 University of Washington
2  alpine/keymenu.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: keymenu.c 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: keymenu.c 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/keymenu.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: keymenu.h 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $
  2 + * $Id: keymenu.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
BIN  alpine/ldap32.dll
Binary file not shown
2  alpine/ldapconf.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: ldapconf.c 1006 2008-03-21 21:31:58Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: ldapconf.c 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/ldapconf.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: ldapconf.h 1007 2008-03-24 19:35:31Z hubert@u.washington.edu $
  2 + * $Id: ldapconf.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
2  alpine/listsel.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: listsel.c 917 2008-01-23 19:15:36Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: listsel.c 918 2008-01-23 19:39:38Z hubert@u.washington.edu $";
3 3 #endif
4 4 /* ========================================================================
5 5 * Copyright 2006-2008 University of Washington
2  alpine/listsel.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: listsel.h 917 2008-01-23 19:15:36Z hubert@u.washington.edu $
  2 + * $Id: listsel.h 918 2008-01-23 19:39:38Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
42 alpine/mailcmd.c
... ... @@ -1,10 +1,10 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: mailcmd.c 1156 2008-08-21 22:14:45Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: mailcmd.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
6 6 * ========================================================================
7   - * Copyright 2006-2008 University of Washington
  7 + * Copyright 2006-2009 University of Washington
8 8 *
9 9 * Licensed under the Apache License, Version 2.0 (the "License");
10 10 * you may not use this file except in compliance with the License.
@@ -4516,23 +4516,29 @@ get_export_filename(struct pine *ps, char *filename, char *deefault,
4516 4516 else if(r == 4){
4517 4517 continue;
4518 4518 }
4519   - else if(r == 30){
4520   - char *p;
  4519 + else if(r == 30 || r == 31){
  4520 + char *p = NULL;
4521 4521
4522   - if(history && (p = get_prev_hist(*history, filename, 0, NULL)) != NULL){
4523   - strncpy(filename, p, len);
4524   - filename[len-1] = '\0';
  4522 + if(history){
  4523 + if(r == 30)
  4524 + p = get_prev_hist(*history, filename, 0, NULL);
  4525 + else
  4526 + p = get_next_hist(*history, filename, 0, NULL);
4525 4527 }
4526   - else
4527   - Writechar(BELL, 0);
4528 4528
4529   - continue;
4530   - }
4531   - else if(r == 31){
4532   - char *p;
  4529 + if(p != NULL){
  4530 + fn = last_cmpnt(p);
  4531 + strncpy(dir, p, MIN(fn - p, sizeof(dir)-1));
  4532 + dir[MIN(fn - p, sizeof(dir)-1)] = '\0';
  4533 + if(fn - p > 1)
  4534 + dir[fn - p - 1] = '\0';
  4535 +
  4536 + if(!strcmp(dir, ps->home_dir)){
  4537 + dir[0] = '~';
  4538 + dir[1] = '\0';
  4539 + }
4533 4540
4534   - if(history && (p = get_next_hist(*history, filename, 0, NULL)) != NULL){
4535   - strncpy(filename, p, len);
  4541 + strncpy(filename, fn, len-1);
4536 4542 filename[len-1] = '\0';
4537 4543 }
4538 4544 else
@@ -4557,9 +4563,6 @@ get_export_filename(struct pine *ps, char *filename, char *deefault,
4557 4563 filename[len-1] = '\0';
4558 4564 }
4559 4565
4560   - if(history)
4561   - save_hist(*history, filename, 0, NULL);
4562   -
4563 4566 #if defined(DOS) || defined(OS2)
4564 4567 if(is_absolute_path(filename)){
4565 4568 fixpath(filename, len);
@@ -4691,6 +4694,9 @@ get_export_filename(struct pine *ps, char *filename, char *deefault,
4691 4694 }
4692 4695
4693 4696 done:
  4697 + if(history && ret == 0)
  4698 + save_hist(*history, full_filename, 0, NULL);
  4699 +
4694 4700 if(opts && opts != optsarg)
4695 4701 fs_give((void **) &opts);
4696 4702
2  alpine/mailcmd.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: mailcmd.h 1004 2008-03-19 19:43:03Z hubert@u.washington.edu $
  2 + * $Id: mailcmd.h 1012 2008-03-26 00:44:22Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
2  alpine/mailindx.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: mailindx.c 1108 2008-07-10 05:01:13Z mikes@u.washington.edu $";
  2 +static char rcsid[] = "$Id: mailindx.c 1142 2008-08-13 17:22:21Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/mailindx.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: mailindx.h 749 2007-10-15 21:02:56Z hubert@u.washington.edu $
  2 + * $Id: mailindx.h 770 2007-10-24 00:23:09Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/mailpart.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: mailpart.c 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: mailpart.c 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
2  alpine/mailpart.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: mailpart.h 676 2007-08-20 19:46:37Z hubert@u.washington.edu $
  2 + * $Id: mailpart.h 769 2007-10-24 00:15:40Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2007 University of Washington
2  alpine/mailtrfc.sh
... ... @@ -1,6 +1,6 @@
1 1 #!/bin/sh
2 2 #
3   -# $Id: mailtrfc.sh 137 2006-09-22 21:34:06Z mikes@u.washington.edu $
  3 +# $Id: mailtrfc.sh 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
4 4 #
5 5 # T H E P I N E M A I L S Y S T E M
6 6 #
10 alpine/mailview.c
... ... @@ -1,5 +1,5 @@
1 1 #if !defined(lint) && !defined(DOS)
2   -static char rcsid[] = "$Id: mailview.c 1122 2008-08-02 00:32:26Z hubert@u.washington.edu $";
  2 +static char rcsid[] = "$Id: mailview.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
3 3 #endif
4 4
5 5 /*
@@ -3125,6 +3125,9 @@ scrolltool(SCROLL_S *sparms)
3125 3125 int start_index, key = 0;
3126 3126 char *report = NULL;
3127 3127
  3128 + start_row = cur_top_line;
  3129 + start_index = 0;
  3130 +
3128 3131 if(F_ON(F_SHOW_CURSOR,ps_global)){
3129 3132 if(found_on < 0
3130 3133 || found_on >= scroll_text_lines()
@@ -3165,6 +3168,11 @@ scrolltool(SCROLL_S *sparms)
3165 3168 start_row = h->loc->where.row;
3166 3169 start_index = scroll_handle_index(start_row, h->loc->where.col);
3167 3170 }
  3171 + else{
  3172 + /* last handle, start over at top */
  3173 + start_row = cur_top_line;
  3174 + start_index = 0;
  3175 + }
3168 3176 }
3169 3177 else{
3170 3178 start_row = (found_on < 0
2  alpine/mailview.h
... ... @@ -1,5 +1,5 @@
1 1 /*
2   - * $Id: mailview.h 1069 2008-06-03 15:54:15Z hubert@u.washington.edu $
  2 + * $Id: mailview.h 1074 2008-06-04 00:08:43Z hubert@u.washington.edu $
3 3 *
4 4 * ========================================================================
5 5 * Copyright 2006-2008 University of Washington
6 alpine/makefile.wnt
@@ -44,13 +44,15 @@ HFILES= ../include/system.h ../include/general.h \
44 44 addrbook.h adrbkcmd.h after.h alpine.h arg.h busy.h colorconf.h confscroll.h \
45 45 conftype.h context.h dispfilt.h flagmaint.h folder.h headers.h help.h imap.h \
46 46 init.h kblock.h keymenu.h ldapconf.h listsel.h mailcmd.h mailindx.h mailpart.h \
47   - mailview.h newuser.h pattern.h pipe.h print.h radio.h remote.h reply.h roleconf.h \
  47 + mailview.h newmail.h newuser.h pattern.h pipe.h print.h radio.h remote.h \
  48 + reply.h roleconf.h \
48 49 send.h setup.h signal.h status.h takeaddr.h talk.h titlebar.h
49 50
50 51 OFILES= addrbook.obj adrbkcmd.obj after.obj alpine.obj arg.obj busy.obj colorconf.obj \
51 52 confscroll.obj context.obj dispfilt.obj flagmaint.obj folder.obj help.obj \
52 53 imap.obj init.obj kblock.obj keymenu.obj ldapconf.obj listsel.obj mailcmd.obj \
53   - mailindx.obj mailpart.obj mailview.obj newuser.obj pattern.obj pipe.obj \
  54 + mailindx.obj mailpart.obj mailview.obj newmail.obj \
  55 + newuser.obj pattern.obj pipe.obj \
54 56 print.obj radio.obj remote.obj reply.obj roleconf.obj \
55 57 send.obj setup.obj signal.obj status.obj takeaddr.obj titlebar.obj
56 58
333 alpine/newmail.c
... ... @@ -0,0 +1,333 @@
  1 +#if !defined(lint) && !defined(DOS)
  2 +static char rcsid[] = "$Id: newmail.c 1266 2009-07-14 18:39:12Z hubert@u.washington.edu $";
  3 +#endif
  4 +
  5 +/*
  6 + * ========================================================================
  7 + * Copyright 2009 University of Washington
  8 + *
  9 + * Licensed under the Apache License, Version 2.0 (the "License");
  10 + * you may not use this file except in compliance with the License.
  11 + * You may obtain a copy of the License at
  12 + *
  13 + * http://www.apache.org/licenses/LICENSE-2.0
  14 + *
  15 + * ========================================================================
  16 + */
  17 +
  18 +#include "../pith/headers.h"
  19 +#include "../pith/newmail.h"
  20 +#include "../pith/conf.h"
  21 +#include "../pith/flag.h"
  22 +#include "../pith/mailindx.h"
  23 +#include "../pith/msgno.h"
  24 +#include "../pith/bldaddr.h"
  25 +#include "../pith/stream.h"
  26 +#include "../pith/sort.h"
  27 +#include "../pith/status.h"
  28 +#include "../pith/util.h"
  29 +#include "../pith/thread.h"
  30 +#include "../pith/options.h"
  31 +#include "../pith/folder.h"
  32 +#include "../pith/ablookup.h"
  33 +
  34 +#ifdef _WINDOWS
  35 +#include "../pico/osdep/mswin.h"
  36 +#endif
  37 +
  38 +
  39 +/*
  40 + * Internal prototypes
  41 + */
  42 +void new_mail_win_mess(MAILSTREAM *, long);
  43 +void new_mail_mess(MAILSTREAM *, long, long, int);
  44 +void newmailfifo(int, char *, char *, char *);
  45 +
  46 +
  47 +/*----------------------------------------------------------------------
  48 + pith optional function to queue a newmail announcement
  49 +
  50 +
  51 + ----*/
  52 +void
  53 +newmail_status_message(MAILSTREAM *stream, long n, long t_nm_count)
  54 +{
  55 +#ifdef _WINDOWS
  56 + if(mswin_newmailwinon())
  57 + new_mail_win_mess(stream, t_nm_count);
  58 +#elif !defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)
  59 + if(ps_global->VAR_FIFOPATH)
  60 + new_mail_win_mess(stream, t_nm_count);
  61 +#endif
  62 + if(n){
  63 + new_mail_mess(stream, sp_mail_since_cmd(stream), n, 0);
  64 + }
  65 +}
  66 +
  67 +
  68 +/*
  69 + * alert for each new message individually. new_mail_mess lumps
  70 + * messages together, we call new_mail_mess with 1 message at a time.
  71 + * This is currently for PC-Pine new mail window, but could probably
  72 + * be used more generally.
  73 + * stream - new mail stream
  74 + * number - number of new messages to alert for
  75 + */
  76 +void
  77 +new_mail_win_mess(MAILSTREAM *stream, long int number)
  78 +{
  79 + int n, i;
  80 + MESSAGECACHE *mc;
  81 +
  82 + if(!stream)
  83 + return;
  84 +
  85 + /*
  86 + * spare6, or MN_STMP, should be safe to use for now, we
  87 + * just want to set which messages to alert about before
  88 + * going to c-client.
  89 + */
  90 + for(n = stream->nmsgs, i = 0; n > 1L && i < number; n--){
  91 + if(!get_lflag(stream, NULL, n, MN_EXLD)){
  92 + mc = mail_elt(stream, n);
  93 + if(mc)
  94 + mc->spare6 = 1;
  95 +
  96 + if(++i == number)
  97 + break;
  98 + }
  99 + else{
  100 + mc = mail_elt(stream, n);
  101 + if(mc)
  102 + mc->spare6 = 0;
  103 + }
  104 + }
  105 + /*
  106 + * Here n is the first new message we want to notify about.
  107 + * spare6 will tell us which ones to use. We set spare6
  108 + * in case of new mail or expunge that could happen when
  109 + * we mail_fetchstructure in new_mail_mess.
  110 + */
  111 + for(; n <= stream->nmsgs; n++)
  112 + if(n > 0L && (mc = mail_elt(stream, n)) && mc->spare6){
  113 + mc->spare6 = 0;
  114 + new_mail_mess(stream, 1, n, 1);
  115 + }
  116 +}
  117 +
  118 +
  119 +/*----------------------------------------------------------------------
  120 + Format and queue a "new mail" message
  121 +
  122 + Args: stream -- mailstream on which a mail has arrived
  123 + number -- number of new messages since last command
  124 + max_num -- The number of messages now on stream
  125 + for_new_mail_win -- for separate new mail window (curr. PC-Pine)
  126 +
  127 + Not too much worry here about the length of the message because the
  128 +status_message code will fit what it can on the screen and truncation on
  129 +the right is about what we want which is what will happen.
  130 + ----*/
  131 +void
  132 +new_mail_mess(MAILSTREAM *stream, long int number, long int max_num, int for_new_mail_win)
  133 +{
  134 + char subject[MAILTMPLEN+1], subjtext[MAILTMPLEN+1], from[MAILTMPLEN+1],
  135 + *folder = NULL, intro[MAILTMPLEN+1];
  136 + ENVELOPE *e = NULL;
  137 +
  138 + if(stream)
  139 + e = pine_mail_fetchstructure(stream, max_num, NULL);
  140 +
  141 + if(stream){
  142 + if(sp_flagged(stream, SP_INBOX))
  143 + folder = NULL;
  144 + else{
  145 + folder = STREAMNAME(stream);
  146 + if(folder[0] == '?' && folder[1] == '\0')
  147 + folder = NULL;
  148 + }
  149 + }
  150 +
  151 + format_new_mail_msg(folder, number, e, intro, from, subject, subjtext, sizeof(subject));
  152 +
  153 + if(!for_new_mail_win)
  154 + q_status_message5(SM_ASYNC | SM_DING, 0, 60,
  155 + "%s%s%s%.80s%.80s", intro,
  156 + from ? ((number > 1L) ? " Most recent f" : " F") : "",
  157 + from ? "rom " : "",
  158 + from ? from : "",
  159 + subjtext);
  160 +#if (!defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)) || defined(_WINDOWS)
  161 + else {
  162 + int is_us = 0;
  163 + ADDRESS *tadr;
  164 +
  165 + if(e)
  166 + for(tadr = e->to; tadr; tadr = tadr->next)
  167 + if(address_is_us(tadr, ps_global)){
  168 + is_us = 1;
  169 + break;
  170 + }
  171 +#ifdef _WINDOWS
  172 + mswin_newmailwin(is_us, from, subject, folder);
  173 +#else
  174 + newmailfifo(is_us, from, subject, folder);
  175 +#endif
  176 + }
  177 +#endif
  178 +
  179 + if(pith_opt_icon_text){
  180 + if(F_ON(F_ENABLE_XTERM_NEWMAIL, ps_global)
  181 + && F_ON(F_ENABLE_NEWMAIL_SHORT_TEXT, ps_global)){
  182 + long inbox_nm;
  183 + if(!sp_flagged(stream, SP_INBOX)
  184 + && (inbox_nm = sp_mail_since_cmd(sp_inbox_stream()))){
  185 + snprintf(tmp_20k_buf, SIZEOF_20KBUF, "[%ld, %ld] %s",
  186 + inbox_nm > 1L ? inbox_nm : 1L,
  187 + number > 1L ? number: 1L,
  188 + ps_global->pine_name);
  189 + }
  190 + else
  191 + snprintf(tmp_20k_buf, SIZEOF_20KBUF, "[%ld] %s", number > 1L ? number: 1L,
  192 + ps_global->pine_name);
  193 + }
  194 + else
  195 + snprintf(tmp_20k_buf, SIZEOF_20KBUF, "%s%s%s%.80s", intro,
  196 + from ? ((number > 1L) ? " Most recent f" : " F") : "",
  197 + from ? "rom " : "",
  198 + from ? from : "");
  199 +
  200 + (*pith_opt_icon_text)(tmp_20k_buf, IT_NEWMAIL);
  201 + }
  202 +}
  203 +
  204 +
  205 +#if !defined(DOS) && !defined(OS2) && !defined(LEAVEOUTFIFO)
  206 +static char *fifoname = NULL;
  207 +static int fifoopenerrmsg = 0;
  208 +static int fifofd = -1;
  209 +static int fifoheader = 0;
  210 +
  211 +void
  212 +init_newmailfifo(char *fname)
  213 +{
  214 + if(fifoname)
  215 + close_newmailfifo();
  216 +
  217 + if(!(fname && *fname))
  218 + return;
  219 +
  220 + if(!fifoname){
  221 + if(mkfifo(fname, 0600) == -1){
  222 + q_status_message2(SM_ORDER,3,3,
  223 + "Can't create NewMail FIFO \"%s\": %s",
  224 + fname, error_description(errno));
  225 + return;
  226 + }
  227 + else
  228 + q_status_message1(SM_ORDER,0,3, "NewMail FIFO: \"%s\"", fname);
  229 +
  230 + fifoname = cpystr(fname);
  231 + }
  232 +}
  233 +
  234 +
  235 +void
  236 +close_newmailfifo(void)
  237 +{
  238 + if(fifoname){
  239 + if(fifofd >= 0)
  240 + (void) close(fifofd);
  241 +
  242 + if(*fifoname)
  243 + our_unlink(fifoname);
  244 +
  245 + fs_give((void **) &fifoname);
  246 + }
  247 +
  248 + fifoheader = 0;
  249 + fifoname = NULL;
  250 + fifofd = -1;
  251 + fifoopenerrmsg = 0;
  252 +}
  253 +
  254 +
  255 +void
  256 +newmailfifo(int is_us, char *from, char *subject, char *folder)
  257 +{
  258 + char buf[MAX_SCREEN_COLS+1], buf2[MAX_SCREEN_COLS+1];
  259 + char buf3[MAX_SCREEN_COLS+1], buf4[MAX_SCREEN_COLS+1];
  260 +
  261 + if(!(fifoname && *fifoname)){
  262 + if(fifoname)
  263 + close_newmailfifo();
  264 +
  265 + return;
  266 + }
  267 +
  268 + if(fifofd < 0){
  269 + fifofd = our_open(fifoname, O_WRONLY | O_NONBLOCK | O_BINARY, 0600);
  270 + if(fifofd < 0){
  271 + if(!fifoopenerrmsg){
  272 + if(errno == ENXIO)
  273 + q_status_message2(SM_ORDER,0,3, "Nothing reading \"%s\": %s",
  274 + fifoname, error_description(errno));
  275 + else
  276 + q_status_message2(SM_ORDER,0,3, "Can't open \"%s\": %s",
  277 + fifoname, error_description(errno));
  278 +
  279 + fifoopenerrmsg++;
  280 + }
  281 +
  282 + return;
  283 + }
  284 + }
  285 +
  286 + if(fifofd >= 0){
  287 + int width;
  288 + int fromlen, subjlen, foldlen;
  289 +
  290 + width = MIN(MAX(20, ps_global->nmw_width), MAX_SCREEN_COLS);
  291 +
  292 + foldlen = .18 * width;
  293 + foldlen = MAX(5, foldlen);
  294 + fromlen = .28 * width;
  295 + subjlen = width - 2 - foldlen - fromlen;
  296 +
  297 + if(!fifoheader){
  298 + time_t now;
  299 + char *tmtxt;
  300 +
  301 + now = time((time_t *) 0);
  302 + tmtxt = ctime(&now);
  303 + if(!tmtxt)
  304 + tmtxt = "";
  305 +
  306 + snprintf(buf, sizeof(buf), "New Mail window started at %.*s\n",
  307 + MIN(100, strlen(tmtxt)-1), tmtxt);
  308 + (void) write(fifofd, buf, strlen(buf));
  309 +
  310 + snprintf(buf, sizeof(buf), " %-*s%-*s%-*s\n",
  311 + fromlen, "From:",
  312 + subjlen, "Subject:",
  313 + foldlen, "Folder:");
  314 + (void) write(fifofd, buf, strlen(buf));
  315