1 /*@ S-nail - a mail user agent derived from Berkeley Mail.
4 * Copyright (c) 2000-2004 Gunnar Ritter, Freiburg i. Br., Germany.
5 * Copyright (c) 2012 - 2013 Steffen "Daode" Nurpmeso <sdaoden@users.sf.net>.
8 * Copyright (c) 1980, 1993
9 * The Regents of the University of California. All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * Print the current active headings.
50 * Don't change dot if invoker didn't give an argument.
55 /* Prepare and print "[Message: xy]:" intro */
56 static void _show_msg_overview(struct message
*mp
, int msg_no
, FILE *obuf
);
58 static void onpipe(int signo
);
59 static int dispc(struct message
*mp
, const char *a
);
60 static int scroll1(char *arg
, int onlynew
);
62 static void _parse_head(struct message
*mp
, char date
[FROM_DATEBUF
]);
63 static void hprf(const char *fmt
, int mesg
, FILE *f
, int threaded
,
64 const char *attrlist
);
65 static int putindent(FILE *fp
, struct message
*mp
, int maxwidth
);
66 static int type1(int *msgvec
, int doign
, int page
, int pipe
, int decode
,
67 char *cmd
, off_t
*tstats
);
68 static int pipe1(char *str
, int doign
);
71 _show_msg_overview(struct message
*mp
, int msg_no
, FILE *obuf
)
73 fprintf(obuf
, tr(17, "[-- Message %2d -- %lu lines, %lu bytes --]:\n"),
74 msg_no
, (ul_it
)mp
->m_lines
, (ul_it
)mp
->m_size
);
81 fprintf(stderr
, tr(10, "The requested feature is not compiled in\n"));
91 if (cp
== NULL
|| *cp
== '\0')
100 int g
, k
, n
, mesg
, flag
= 0, lastg
= 1;
101 struct message
*mp
, *mq
, *lastmq
= NULL
;
103 enum mflag fl
= MNEW
|MFLAGGED
;
105 time_current_update(&time_current
, FAL0
);
108 n
= msgvec
[0]; /* n == {-2, -1, 0}: called from scroll() */
116 if (mb
.mb_threaded
== 0) {
119 for (mp
= &message
[0]; mp
< &message
[msgCount
]; mp
++)
127 if ((n
> 0 && mp
== &message
[n
-1]) ||
128 (n
== 0 && g
== k
) ||
129 (n
== -2 && g
== k
+ size
&&
132 (mp
->m_flag
& fl
) != 0))
136 if (lastmq
&& (n
==-2 || (n
==-1 && mp
== &message
[msgCount
]))) {
142 mesg
= mp
- &message
[0];
143 if (dot
!= &message
[n
-1]) {
144 for (mq
= mp
; mq
< &message
[msgCount
]; mq
++)
151 if (mb
.mb_type
== MB_IMAP
)
152 imap_getheaders(mesg
+1, mesg
+ size
);
154 for (; mp
< &message
[msgCount
]; mp
++) {
160 printhead(mesg
, stdout
, 0);
162 } else { /* threaded */
165 for (mp
= threadroot
; mp
; mp
= next_in_thread(mp
))
166 if (visible(mp
) && (mp
->m_collapsed
<= 0 ||
167 mp
== &message
[n
-1])) {
174 if ((n
> 0 && mp
== &message
[n
-1]) ||
175 (n
== 0 && g
== k
) ||
176 (n
== -2 && g
== k
+ size
&&
179 (mp
->m_flag
& fl
) != 0))
183 if (lastmq
&& (n
==-2 || (n
==-1 && mp
==&message
[msgCount
]))) {
189 if (dot
!= &message
[n
-1]) {
190 for (mq
= mp
; mq
; mq
= next_in_thread(mq
))
191 if (visible(mq
) && mq
->m_collapsed
<= 0) {
197 if (visible(mp
) && (mp
->m_collapsed
<= 0 ||
198 mp
== &message
[n
-1])) {
201 printhead(mp
- &message
[0] + 1, stdout
,
204 mp
= next_in_thread(mp
);
208 printf(tr(6, "No more mail.\n"));
215 * Scroll to the next/previous screen
220 return scroll1(v
, 0);
226 return scroll1(v
, 1);
230 scroll1(char *arg
, int onlynew
)
235 cur
[0] = onlynew
? -1 : 0;
238 case '1': case '2': case '3': case '4': case '5':
239 case '6': case '7': case '8': case '9': case '0':
246 screen
= msgCount
/ size
;
252 screen
+= atoi(arg
+ 1);
254 if (screen
* size
> msgCount
) {
255 screen
= msgCount
/ size
;
256 printf(catgets(catd
, CATSET
, 7,
257 "On last screenful of messages\n"));
265 screen
-= atoi(arg
+ 1);
268 printf(catgets(catd
, CATSET
, 8,
269 "On first screenful of messages\n"));
276 printf(catgets(catd
, CATSET
, 9,
277 "Unrecognized scrolling command \"%s\"\n"), arg
);
280 return(headers(cur
));
284 * Compute screen size.
292 if ((cp
= value("screen")) != NULL
&& (s
= atoi(cp
)) > 0)
294 return scrnheight
- 4;
297 static sigjmp_buf pipejmp
;
304 siglongjmp(pipejmp
, 1);
308 * Print out the headlines for each message
309 * in the passed message list.
314 int *msgvec
= v
, *ip
, n
;
316 FILE *volatile obuf
= stdout
;
318 time_current_update(&time_current
, FAL0
);
320 /* TODO unfixable memory leaks still */
321 if (IS_TTY_SESSION() && (cp
= value("crt")) != NULL
) {
322 for (n
= 0, ip
= msgvec
; *ip
; ip
++)
324 if (n
> (*cp
== '\0' ? screensize() : atoi((char*)cp
)) + 3) {
326 if (sigsetjmp(pipejmp
, 1))
329 if ((obuf
= Popen(p
, "w", NULL
, 1)) == NULL
) {
334 safe_signal(SIGPIPE
, onpipe
);
337 for (ip
= msgvec
; *ip
!= 0; ip
++)
338 printhead(*ip
, obuf
, mb
.mb_threaded
);
340 setdot(&message
[*ip
- 1]);
342 if (obuf
!= stdout
) {
343 safe_signal(SIGPIPE
, SIG_IGN
);
345 safe_signal(SIGPIPE
, dflpipe
);
351 dispc(struct message
*mp
, const char *a
)
358 if ((mp
->m_flag
& (MREAD
|MNEW
)) == MREAD
)
360 if ((mp
->m_flag
& (MREAD
|MNEW
)) == (MREAD
|MNEW
))
362 if (mp
->m_flag
& MANSWERED
)
364 if (mp
->m_flag
& MDRAFTED
)
366 if ((mp
->m_flag
& (MREAD
|MNEW
)) == MNEW
)
368 if ((mp
->m_flag
& (MREAD
|MNEW
)) == 0)
370 if (mp
->m_flag
& MJUNK
)
372 if (mp
->m_flag
& MSAVED
)
374 if (mp
->m_flag
& MPRESERVE
)
376 if (mp
->m_flag
& (MBOX
|MBOXED
))
378 if (mp
->m_flag
& MFLAGGED
)
380 if (mp
->m_flag
& MKILL
)
382 if (mb
.mb_threaded
== 1 && mp
->m_collapsed
> 0)
384 if (mb
.mb_threaded
== 1 && mp
->m_collapsed
< 0)
390 _parse_head(struct message
*mp
, char date
[FROM_DATEBUF
])
397 if ((ibuf
= setinput(&mb
, mp
, NEED_HEADER
)) != NULL
&&
398 (hlen
= readline_restart(ibuf
, &hline
, &hsize
, 0)) > 0)
399 (void)extract_date_from_from_(hline
, hlen
, date
);
405 hprf(const char *fmt
, int mesg
, FILE *f
, int threaded
, const char *attrlist
)
407 char datebuf
[FROM_DATEBUF
], *subjline
, *cp
;
409 char const *datefmt
, *date
, *name
, *fp
;
410 int B
, c
, i
, n
, s
, fromlen
, subjlen
= scrnwidth
, isto
= 0, isaddr
= 0;
411 struct message
*mp
= &message
[mesg
- 1];
412 time_t datet
= mp
->m_time
;
415 if ((datefmt
= value("datefield")) != NULL
) {
416 fp
= hfield1("date", mp
);/* TODO use m_date field! */
422 date
= fakedate(datet
);
423 fp
= value("datefield-markout-older");
424 i
= (*datefmt
!= '\0');
426 i
|= (*fp
!= '\0') ? 2 | 4 : 2;
427 /* May we strftime(3)? */
429 memcpy(&time_current
.tc_local
, localtime(&datet
),
430 sizeof time_current
.tc_local
);
431 if ((i
& 2) && (datet
> time_current
.tc_time
||
432 #define _6M ((DATE_DAYSYEAR / 2) * DATE_SECSDAY)
433 (datet
+ _6M
< time_current
.tc_time
))) {
435 if ((datefmt
= (i
& 4) ? fp
: NULL
) == NULL
) {
436 memset(datebuf
, ' ', FROM_DATEBUF
); /* xxx ur */
437 memcpy(datebuf
+ 4, date
+ 4, 7);
438 datebuf
[4 + 7] = ' ';
439 memcpy(datebuf
+ 4 + 7 + 1, date
+ 20, 4);
440 datebuf
[4 + 7 + 1 + 4] = '\0';
443 } else if ((i
& 1) == 0)
445 } else if (datet
== (time_t)0 && (mp
->m_flag
& MNOFROM
) == 0) {
446 /* TODO eliminate this path, query the FROM_ date in setptr(),
447 * TODO all other codepaths do so by themselves ALREADY ?????
448 * TODO assert(mp->m_time != 0);, then
449 * TODO ALSO changes behaviour of markout-non-current */
450 _parse_head(mp
, datebuf
);
454 date
= fakedate(datet
);
459 if ((subjline
= hfield1("subject", mp
)) != NULL
) {
461 in
.l
= strlen(subjline
);
462 mime_fromhdr(&in
, &out
, TD_ICONV
| TD_ISPR
);
468 if (name
!= NULL
&& value("showto") && is_myname(skin(name
))) {
469 if ((cp
= hfield1("to", mp
)) != NULL
) {
479 if (value("showname"))
480 name
= realname(name
);
482 name
= prstr(skin(name
));
486 for (fp
= fmt
; *fp
; fp
++) {
490 } else if (*fp
== '+')
492 while (digitchar(*fp
))
497 #if defined (HAVE_MBTOWC) && defined (HAVE_WCWIDTH)
498 if (mb_cur_max
> 1) {
500 if ((s
= mbtowc(&wc
, fp
, mb_cur_max
)) < 0)
503 if ((n
= wcwidth(wc
)) < 0)
507 #endif /* HAVE_MBTOWC && HAVE_WCWIDTH */
517 for (fp
= fmt
; *fp
; fp
++) {
518 if ((c
= *fp
& 0xFF) == '%') {
525 } else if (*fp
== '+')
527 if (digitchar(*fp
)) {
529 n
= 10*n
+ *fp
- '0';
530 while (fp
++, digitchar(*fp
));
535 switch ((c
= *fp
& 0xFF)) {
544 c
= dispc(mp
, attrlist
);
546 n
= fprintf(f
, "%*c", n
, c
);
554 for (i
=msgCount
; i
>999; i
/=10)
557 subjlen
-= fprintf(f
, "%*d", n
, mesg
);
566 if (isto
) /* XXX tr()! */
568 subjlen
-= fprintf(f
, "%s%s", isto
? "To " : "",
569 colalign(name
, fromlen
, n
));
572 if (datefmt
!= NULL
) {
573 i
= strftime(datebuf
, sizeof datebuf
,
575 &time_current
.tc_local
);
579 fprintf(stderr
, tr(174,
580 "Ignored date format, "
584 (ul_it
)sizeof datebuf
);
589 subjlen
-= fprintf(f
, "%*.*s", n
, n
, date
);
595 subjlen
-= fprintf(f
, "%*ld", n
,
607 subjlen
-= fprintf(f
, "%*lu", n
,
612 subjlen
-= putindent(f
, mp
,
624 n
-= (n
< 0) ? -2 : 2;
625 if (subjline
!= NULL
&& n
!= 0) {
626 /* pretty pathetic */
627 fprintf(f
, B
? "\"%s\"" : "%s",
628 colalign(subjline
, ABS(n
), n
));
635 subjlen
-= fprintf(f
, "%*lu", n
, mp
->m_uid
);
644 subjlen
-= fprintf(f
, "%*u", n
, threaded
== 1 ?
651 for (i
=msgCount
; i
>999; i
/=10)
654 subjlen
-= fprintf(f
, "%*ld", n
, threaded
?
655 mp
->m_threadpos
: mesg
);
661 subjlen
-= fprintf(f
, "%*g", n
, mp
->m_score
);
678 * Print out the indenting in threaded display.
681 putindent(FILE *fp
, struct message
*mp
, int maxwidth
)
687 int important
= MNEW
|MFLAGGED
;
689 if (mp
->m_level
== 0)
691 cs
= ac_alloc(mp
->m_level
);
692 us
= ac_alloc(mp
->m_level
* sizeof *us
);
694 if (mp
->m_younger
&& (unsigned)i
+ 1 == mp
->m_younger
->m_level
) {
695 if (mp
->m_parent
&& mp
->m_parent
->m_flag
& important
)
696 us
[i
] = mp
->m_flag
& important
? 0x2523 : 0x2520;
698 us
[i
] = mp
->m_flag
& important
? 0x251D : 0x251C;
701 if (mp
->m_parent
&& mp
->m_parent
->m_flag
& important
)
702 us
[i
] = mp
->m_flag
& important
? 0x2517 : 0x2516;
704 us
[i
] = mp
->m_flag
& important
? 0x2515 : 0x2514;
708 for (i
= mp
->m_level
- 2; i
>= 0; i
--) {
710 if ((unsigned)i
> mq
->m_level
- 1) {
716 mq
->m_parent
->m_flag
&important
)
727 for (indent
= 0; (unsigned)indent
< mp
->m_level
&& indent
< maxwidth
;
729 if (indent
< maxwidth
- 1)
730 putuc(us
[indent
], cs
[indent
] & 0377, fp
);
732 putuc(0x21B8, '^', fp
);
740 printhead(int mesg
, FILE *f
, int threaded
)
742 int bsdflags
, bsdheadline
, sz
;
743 char attrlist
[30], *cp
;
746 bsdflags
= value("bsdcompat") != NULL
|| value("bsdflags") != NULL
||
747 getenv("SYSV3") != NULL
;
748 strcpy(attrlist
, bsdflags
? "NU *HMFATK+-J" : "NUROSPMFATK+-J");
749 if ((cp
= value("attrlist")) != NULL
) {
751 if (sz
> (int)sizeof attrlist
- 1)
752 sz
= (int)sizeof attrlist
- 1;
753 memcpy(attrlist
, cp
, sz
);
755 bsdheadline
= value("bsdcompat") != NULL
||
756 value("bsdheadline") != NULL
;
757 if ((fmt
= value("headline")) == NULL
)
759 "%>%a%m %-20f %16d %3l/%-5o %i%-S" :
760 "%>%a%m %-18f %16d %4l/%-5o %i%-s";
761 hprf(fmt
, mesg
, f
, threaded
, attrlist
);
765 * Print out the value of dot.
772 printf(catgets(catd
, CATSET
, 13, "%d\n"),
773 (int)(dot
- &message
[0] + 1));
778 * Print out all the possible commands.
782 _pcmd_cmp(void const *s1
, void const *s2
)
784 struct cmd
const *const*c1
= s1
, *const*c2
= s2
;
785 return (strcmp((*c1
)->c_name
, (*c2
)->c_name
));
792 extern struct cmd
const cmdtab
[];
793 struct cmd
const **cpa
, *cp
, **cursor
;
797 for (i
= 0; cmdtab
[i
].c_name
!= NULL
; ++i
)
800 cpa
= ac_alloc(sizeof(cp
) * i
);
802 for (i
= 0; (cp
= cmdtab
+ i
)->c_name
!= NULL
; ++i
)
806 qsort(cpa
, i
, sizeof(cp
), &_pcmd_cmp
);
808 printf(tr(14, "Commands are:\n"));
809 for (i
= 0, cursor
= cpa
; (cp
= *cursor
++) != NULL
;) {
811 if (cp
->c_func
== &ccmdnotsupp
)
813 j
= strlen(cp
->c_name
) + 2;
818 printf((*cursor
!= NULL
? "%s, " : "%s\n"), cp
->c_name
);
826 * Type out the messages requested.
828 static sigjmp_buf pipestop
;
835 siglongjmp(pipestop
, 1);
839 type1(int *msgvec
, int doign
, int page
, int pipe
, int decode
,
840 char *cmd
, off_t
*tstats
)
850 if (sigsetjmp(pipestop
, 1))
856 obuf
= Popen(cmd
, "w", cp
, 1);
861 safe_signal(SIGPIPE
, brokpipe
);
863 } else if ((options
& OPT_TTYOUT
) &&
864 (page
|| (cp
= value("crt")) != NULL
)) {
867 for (ip
= msgvec
; *ip
&& ip
-msgvec
< msgCount
; ip
++) {
868 if ((message
[*ip
-1].m_have
& HAVE_BODY
) == 0) {
869 if ((get_body(&message
[*ip
- 1])) !=
873 nlines
+= message
[*ip
- 1].m_lines
;
876 if (page
|| nlines
> (*cp
? atoi(cp
) : realscreenheight
)) {
877 char const *p
= get_pager();
878 obuf
= Popen(p
, "w", NULL
, 1);
883 safe_signal(SIGPIPE
, brokpipe
);
886 for (ip
= msgvec
; *ip
&& ip
- msgvec
< msgCount
; ip
++) {
887 mp
= &message
[*ip
- 1];
891 if (! pipe
&& ip
!= msgvec
)
893 _show_msg_overview(mp
, *ip
, obuf
);
894 send(mp
, obuf
, doign
? ignore
: 0, NULL
,
895 pipe
&& value("piperaw") ? SEND_MBOX
:
897 doign
? SEND_TODISP
: SEND_TODISP_ALL
,
899 if (pipe
&& value("page")) {
903 tstats
[0] += mstats
[0];
904 tstats
[1] += mstats
[1];
908 if (obuf
!= stdout
) {
910 * Ignore SIGPIPE so it can't cause a duplicate close.
912 safe_signal(SIGPIPE
, SIG_IGN
);
914 safe_signal(SIGPIPE
, dflpipe
);
920 * Get the last, possibly quoted part of linebuf.
923 laststring(char *linebuf
, int *flag
, int strip
)
929 cp
= strlen(linebuf
) + linebuf
- 1;
932 * Strip away trailing blanks.
934 while (cp
> linebuf
&& whitechar(*cp
& 0377))
943 * Now search for the beginning of the command name.
946 if (quoted
== '\'' || quoted
== '\"') {
951 while (cp
> linebuf
) {
954 } else if (*(cp
- 1) != '\\') {
972 while (cp
> linebuf
&& !whitechar(*cp
& 0377))
974 if (whitechar(*cp
& 0377))
986 * Pipe the messages requested.
989 pipe1(char *str
, int doign
)
996 msgvec
= (int *)salloc((msgCount
+ 2) * sizeof *msgvec
);
997 if ((cmd
= laststring(str
, &f
, 1)) == NULL
) {
999 if (cmd
== NULL
|| *cmd
== '\0') {
1000 fputs(catgets(catd
, CATSET
, 16,
1001 "variable cmd not set\n"), stderr
);
1006 *msgvec
= first(0, MMNORM
);
1010 puts(catgets(catd
, CATSET
, 18, "No messages to pipe."));
1014 } else if (getmsglist(str
, msgvec
, 0) < 0)
1019 printf("No applicable messages.\n");
1022 printf(catgets(catd
, CATSET
, 268, "Pipe to: \"%s\"\n"), cmd
);
1023 stats
[0] = stats
[1] = 0;
1024 if ((ret
= type1(msgvec
, doign
, 0, 1, 0, cmd
, stats
)) == 0) {
1025 printf("\"%s\" ", cmd
);
1027 printf("%lu", (long)stats
[0]);
1029 printf(catgets(catd
, CATSET
, 27, "binary"));
1030 printf("/%lu\n", (long)stats
[1]);
1036 * Paginate messages, honor ignored fields.
1042 return (type1(msgvec
, 1, 1, 0, 0, NULL
, NULL
));
1046 * Paginate messages, even printing ignored fields.
1053 return (type1(msgvec
, 0, 1, 0, 0, NULL
, NULL
));
1057 * Type out messages, honor ignored fields.
1064 return(type1(msgvec
, 1, 0, 0, 0, NULL
, NULL
));
1068 * Type out messages, even printing ignored fields.
1075 return(type1(msgvec
, 0, 0, 0, 0, NULL
, NULL
));
1079 * Show MIME-encoded message text, including all fields.
1086 return(type1(msgvec
, 0, 0, 0, 1, NULL
, NULL
));
1090 * Pipe messages, honor ignored fields.
1096 return(pipe1(str
, 1));
1099 * Pipe messages, not respecting ignored fields.
1105 return(pipe1(str
, 0));
1109 * Print the top so many lines of each desired message.
1110 * The number of lines is taken from the variable "toplines"
1111 * and defaults to 5.
1116 int *msgvec
= v
, *ip
, c
, topl
, lines
, empty_last
;
1118 char *cp
, *linebuf
= NULL
;
1123 cp
= value("toplines");
1126 if (topl
< 0 || topl
> 10000)
1130 for (ip
= msgvec
; *ip
&& ip
-msgvec
< msgCount
; ip
++) {
1131 mp
= &message
[*ip
- 1];
1134 did_print_dot
= TRU1
;
1137 _show_msg_overview(mp
, *ip
, stdout
);
1138 if (mp
->m_flag
& MNOFROM
)
1139 printf("From %s %s\n", fakefrom(mp
),
1140 fakedate(mp
->m_time
));
1141 if ((ibuf
= setinput(&mb
, mp
, NEED_BODY
)) == NULL
) { /* XXX could use TOP */
1146 for (lines
= 0; lines
< c
&& lines
<= topl
; lines
++) {
1147 if (readline_restart(ibuf
, &linebuf
, &linesize
, 0) < 0)
1151 for (cp
= linebuf
; *cp
&& blankchar(*cp
); ++cp
)
1153 empty_last
= (*cp
== '\0');
1157 if (linebuf
!= NULL
)
1163 * Touch all the given messages so that they will
1172 for (ip
= msgvec
; *ip
!= 0; ip
++) {
1173 setdot(&message
[*ip
-1]);
1174 dot
->m_flag
|= MTOUCH
;
1175 dot
->m_flag
&= ~MPRESERVE
;
1177 * POSIX interpretation necessary.
1179 did_print_dot
= TRU1
;
1185 * Make sure all passed messages get mboxed.
1193 for (ip
= msgvec
; *ip
!= 0; ip
++) {
1194 setdot(&message
[*ip
-1]);
1195 dot
->m_flag
|= MTOUCH
|MBOX
;
1196 dot
->m_flag
&= ~MPRESERVE
;
1198 * POSIX interpretation necessary.
1200 did_print_dot
= TRU1
;
1206 * List the folders the user currently has.
1211 char dirname
[MAXPATHLEN
], *name
, **argv
= v
;
1215 name
= expand(*argv
);
1218 } else if (! getfold(dirname
, sizeof dirname
)) {
1219 fprintf(stderr
, tr(20, "No value set for \"folder\"\n"));
1224 if (which_protocol(name
) == PROTO_IMAP
) {
1226 imap_folders(name
, *argv
== NULL
);
1228 return ccmdnotsupp(NULL
);
1231 if ((cmd
= value("LISTER")) == NULL
)
1233 run_command(cmd
, 0, -1, -1, name
, NULL
, NULL
);