2 * Copyright notice from original mutt:
3 * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4 * Copyright (C) 2000 Thomas Roessler <roessler@does-not-exist.org>
6 * This file is part of mutt-ng, see http://www.muttng.org/.
7 * It's licensed under the GNU General Public License,
8 * please see the file GPL in the top level source directory.
15 #include <lib-lib/mem.h>
19 #include "recvattach.h"
21 #include "mutt_curses.h"
22 #include "mutt_menu.h"
28 #include "mutt_crypt.h"
29 #include "mutt_idna.h"
31 #include <sys/types.h>
46 #include "lib/debug.h"
54 #include <sys/types.h>
57 extern char *ReleaseDate;
59 /* The folder the user last saved to. Used by ci_save_message() */
60 static char LastSaveFolder[_POSIX_PATH_MAX] = "";
62 int mutt_display_message (HEADER * cur)
64 char tempfile[_POSIX_PATH_MAX], buf[LONG_STRING];
65 int rc = 0, builtin = 0;
66 int cmflags = M_CM_DECODE | M_CM_DISPLAY | M_CM_CHARCONV;
68 FILE *fpfilterout = NULL;
73 snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content),
74 cur->content->subtype);
76 mutt_parse_mime_message (Context, cur);
77 mutt_message_hook (Context, cur, M_MESSAGEHOOK);
79 mutt_mktemp (tempfile);
80 if ((fpout = safe_fopen (tempfile, "w")) == NULL) {
81 mutt_error _("Could not create temporary file!");
86 if (DisplayFilter && *DisplayFilter) {
89 /* mutt_endwin (NULL); */
90 filterpid = mutt_create_filter_fd (DisplayFilter, &fpout, NULL, NULL,
91 -1, fileno (fpfilterout), -1);
93 mutt_error (_("Cannot create display filter"));
94 safe_fclose (&fpfilterout);
100 if (!Pager || str_cmp (Pager, "builtin") == 0)
103 mutt_make_string (buf, sizeof (buf), NONULL (PagerFmt), Context, cur);
105 fputs ("\n\n", fpout);
108 msg = mx_open_message (Context, cur->msgno);
109 if (msg == NULL) res = -1;
112 /* see if crytpo is needed for this message. if so, we should exit curses */
113 if (WithCrypto && cur->security) {
114 if (cur->security & ENCRYPT) {
115 if (cur->security & APPLICATION_SMIME)
116 crypt_smime_getkeys (cur->env);
117 if (!crypt_valid_passphrase (cur->security))
120 cmflags |= M_CM_VERIFY;
122 else if (cur->security & SIGN) {
123 /* find out whether or not the verify signature */
124 if (query_quadoption (OPT_VERIFYSIG, _("Verify PGP signature?")) ==
126 cmflags |= M_CM_VERIFY;
131 if (cmflags & M_CM_VERIFY || cur->security & ENCRYPT) {
132 if (cur->security & APPLICATION_PGP) {
134 crypt_pgp_invoke_getkeys (cur->env->from);
136 crypt_invoke_message (APPLICATION_PGP);
139 if (cur->security & APPLICATION_SMIME)
140 crypt_invoke_message (APPLICATION_SMIME);
143 res = _mutt_copy_message (fpout, msg->fp, cur, cur->content, cmflags,
144 (option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) |
145 CH_DECODE | CH_FROM);
146 if (res == 0 && (ferror(fpout) || feof(fpout))) {
147 debug_print (1, ("_mutt_copy_message failed to detect EOF!\n"));
151 mx_close_message (&msg);
154 if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res == -1) {
155 mutt_error (_("Could not copy message"));
156 if (fpfilterout != NULL) {
157 mutt_wait_filter (filterpid);
158 safe_fclose (&fpfilterout);
161 /* this is maybe just plain wrong but it makes the pager display
162 * what we have; i.e. for the crypto stuff we only get
163 * 'Could not copy message' for invalid passphrases, no PGP output
164 * not nothing; so just display what we have...
167 mutt_unlink (tempfile);
172 if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0)
173 mutt_any_key_to_continue (NULL);
175 safe_fclose (&fpfilterout); /* XXX - check result? */
179 /* update crypto information for this message */
180 cur->security &= ~(GOODSIGN|BADSIGN);
181 cur->security |= crypt_query (cur->content);
183 /* Remove color cache for this message, in case there
184 are color patterns for both ~g and ~V */
192 && (cur->security & APPLICATION_SMIME) && (cmflags & M_CM_VERIFY)) {
193 if (cur->security & GOODSIGN) {
194 if (!crypt_smime_verify_sender (cur))
195 mutt_message (_("S/MIME signature successfully verified."));
197 mutt_error (_("S/MIME certificate owner does not match sender."));
199 else if (cur->security & PARTSIGN)
201 ("Warning: Part of this message has not been signed."));
202 else if (cur->security & SIGN || cur->security & BADSIGN)
203 mutt_error (_("S/MIME signature could NOT be verified."));
207 && (cur->security & APPLICATION_PGP) && (cmflags & M_CM_VERIFY)) {
208 if (cur->security & GOODSIGN)
209 mutt_message (_("PGP signature successfully verified."));
210 else if (cur->security & PARTSIGN)
212 ("Warning: Part of this message has not been signed."));
213 else if (cur->security & SIGN)
214 mutt_message (_("PGP signature could NOT be verified."));
217 /* Invoke the builtin pager */
218 memset (&info, 0, sizeof (pager_t));
221 rc = mutt_pager (NULL, tempfile, M_PAGER_MESSAGE, &info);
227 snprintf (buf, sizeof (buf), "%s %s", NONULL (Pager), tempfile);
228 if ((r = mutt_system (buf)) == -1)
229 mutt_error (_("Error running \"%s\"!"), buf);
231 keypad (stdscr, TRUE);
233 mutt_set_flag (Context, cur, M_READ, 1);
234 if (r != -1 && option (OPTPROMPTAFTER)) {
235 mutt_ungetch (mutt_any_key_to_continue _("Command: "), 0);
236 rc = km_dokey (MENU_PAGER);
245 void ci_bounce_message (HEADER * h, int *redraw)
247 char prompt[SHORT_STRING];
248 char buf[HUGE_STRING] = { 0 };
254 strfcpy (prompt, _("Bounce message to: "), sizeof (prompt));
256 strfcpy (prompt, _("Bounce tagged messages to: "), sizeof (prompt));
258 rc = mutt_get_field (prompt, buf, sizeof (buf), M_ALIAS);
260 if (option (OPTNEEDREDRAW)) {
261 unset_option (OPTNEEDREDRAW);
262 *redraw = REDRAW_FULL;
268 if (!(adr = rfc822_parse_adrlist (adr, buf))) {
269 mutt_error _("Error parsing address!");
274 adr = mutt_expand_aliases (adr);
276 if (mutt_addrlist_to_idna (adr, &err) < 0) {
277 mutt_error (_("Bad IDN: '%s'"), err);
279 rfc822_free_address (&adr);
284 rfc822_write_address (buf, sizeof (buf), adr, 1);
286 #define extra_space (15 + 7 + 2)
287 snprintf (prompt, sizeof (prompt),
288 (h ? _("Bounce message to %s") : _("Bounce messages to %s")),
291 if (mutt_strwidth (prompt) > COLS - extra_space) {
292 mutt_format_string (prompt, sizeof (prompt),
293 0, COLS - extra_space, 0, 0,
294 prompt, sizeof (prompt), 0);
295 str_cat (prompt, sizeof (prompt), "...?");
298 str_cat (prompt, sizeof (prompt), "?");
300 if (query_quadoption (OPT_BOUNCE, prompt) != M_YES) {
301 rfc822_free_address (&adr);
302 CLEARLINE (LINES - 1);
303 mutt_message (h ? _("Message not bounced.") : _("Messages not bounced."));
307 CLEARLINE (LINES - 1);
309 rc = mutt_bounce_message (NULL, h, adr);
310 rfc822_free_address (&adr);
311 /* If no error, or background, display message. */
312 if ((rc == 0) || (rc == S_BKG))
313 mutt_message (h ? _("Message bounced.") : _("Messages bounced."));
316 static void pipe_set_flags (int decode, int print, int *cmflags, int *chflags)
319 *cmflags |= M_CM_DECODE | M_CM_CHARCONV;
320 *chflags |= CH_DECODE | CH_REORDER;
322 if (option (OPTWEED)) {
324 *cmflags |= M_CM_WEED;
329 *cmflags |= M_CM_PRINTING;
333 static void pipe_msg (HEADER * h, FILE * fp, int decode, int print)
336 int chflags = CH_FROM;
338 pipe_set_flags (decode, print, &cmflags, &chflags);
340 if (WithCrypto && decode && h->security & ENCRYPT) {
341 if (!crypt_valid_passphrase (h->security))
347 mutt_parse_mime_message (Context, h);
349 mutt_copy_message (fp, Context, h, cmflags, chflags);
353 /* the following code is shared between printing and piping */
355 static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
356 int split, const char *sep)
363 /* mutt_endwin (NULL);
365 is this really needed here ?
366 it makes the screen flicker on pgp and s/mime messages,
367 before asking for a passphrase...
371 mutt_message_hook (Context, h, M_MESSAGEHOOK);
373 if (WithCrypto && decode) {
374 mutt_parse_mime_message (Context, h);
375 if (h->security & ENCRYPT && !crypt_valid_passphrase (h->security))
380 if ((thepid = mutt_create_filter (cmd, &fpout, NULL, NULL)) < 0) {
381 mutt_perror (_("Can't create filter process"));
386 pipe_msg (h, fpout, decode, print);
388 rc = mutt_wait_filter (thepid);
390 else { /* handle tagged messages */
392 if (WithCrypto && decode) {
393 for (i = 0; i < Context->vcount; i++)
394 if (Context->hdrs[Context->v2r[i]]->tagged) {
395 mutt_message_hook (Context, Context->hdrs[Context->v2r[i]],
397 mutt_parse_mime_message (Context, Context->hdrs[Context->v2r[i]]);
398 if (Context->hdrs[Context->v2r[i]]->security & ENCRYPT &&
399 !crypt_valid_passphrase (Context->hdrs[Context->v2r[i]]->
406 for (i = 0; i < Context->vcount; i++) {
407 if (Context->hdrs[Context->v2r[i]]->tagged) {
408 mutt_message_hook (Context, Context->hdrs[Context->v2r[i]],
411 if ((thepid = mutt_create_filter (cmd, &fpout, NULL, NULL)) < 0) {
412 mutt_perror (_("Can't create filter process"));
416 pipe_msg (Context->hdrs[Context->v2r[i]], fpout, decode, print);
417 /* add the message separator */
420 safe_fclose (&fpout);
421 if (mutt_wait_filter (thepid) != 0)
428 if ((thepid = mutt_create_filter (cmd, &fpout, NULL, NULL)) < 0) {
429 mutt_perror (_("Can't create filter process"));
433 for (i = 0; i < Context->vcount; i++) {
434 if (Context->hdrs[Context->v2r[i]]->tagged) {
435 mutt_message_hook (Context, Context->hdrs[Context->v2r[i]],
437 pipe_msg (Context->hdrs[Context->v2r[i]], fpout, decode, print);
438 /* add the message separator */
443 safe_fclose (&fpout);
444 if (mutt_wait_filter (thepid) != 0)
449 if (rc || option (OPTWAITKEY))
450 mutt_any_key_to_continue (NULL);
454 void mutt_pipe_message (HEADER * h)
456 char buffer[LONG_STRING];
459 if (mutt_get_field (_("Pipe to command: "), buffer, sizeof (buffer), M_CMD)
463 mutt_expand_path (buffer, sizeof (buffer));
464 _mutt_pipe_message (h, buffer,
465 option (OPTPIPEDECODE),
466 0, option (OPTPIPESPLIT), PipeSep);
469 void mutt_print_message (HEADER * h)
472 if (quadoption (OPT_PRINT) && (!PrintCmd || !*PrintCmd)) {
473 mutt_message (_("No printing command has been defined."));
477 if (query_quadoption (OPT_PRINT,
478 h ? _("Print message?") : _("Print tagged messages?"))
482 if (_mutt_pipe_message (h, PrintCmd,
483 option (OPTPRINTDECODE),
484 1, option (OPTPRINTSPLIT), "\f") == 0)
485 mutt_message (h ? _("Message printed") : _("Messages printed"));
487 mutt_message (h ? _("Message could not be printed") :
488 _("Messages could not be printed"));
492 int mutt_select_sort (int reverse)
494 int method = Sort; /* save the current method in case of abort */
496 switch (mutt_multi_choice (reverse ?
498 ("Rev-Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am?: ")
501 ("Sort (d)ate/(f)rm/(r)ecv/(s)ubj/t(o)/(t)hread/(u)nsort/si(z)e/s(c)ore/s(p)am?: "),
503 case -1: /* abort - don't resort */
515 Sort = SORT_RECEIVED;
526 case 6: /* (t)hread */
530 case 7: /* (u)nsort */
538 case 9: /* s(c)ore */
542 case 10: /* s(p)am */
547 Sort |= SORT_REVERSE;
549 return (Sort != method ? 0 : -1); /* no need to resort if it's the same */
552 /* invoke a command in a subshell */
553 void mutt_shell_escape (void)
555 char buf[LONG_STRING];
558 if (mutt_get_field (_("Shell command: "), buf, sizeof (buf), M_CMD) == 0) {
559 if (!buf[0] && Shell)
560 strfcpy (buf, Shell, sizeof (buf));
562 CLEARLINE (LINES - 1);
565 if (mutt_system (buf) != 0 || option (OPTWAITKEY))
566 mutt_any_key_to_continue (NULL);
571 /* enter a mutt command */
572 void mutt_enter_command (void)
575 char buffer[LONG_STRING], errbuf[SHORT_STRING];
579 if (mutt_get_field (":", buffer, sizeof (buffer), M_COMMAND) != 0
583 err.dsize = sizeof (errbuf);
584 memset (&token, 0, sizeof (token));
585 r = mutt_parse_rc_line (buffer, &token, &err);
586 p_delete(&token.data);
588 /* since errbuf could potentially contain printf() sequences in it,
589 we must call mutt_error() in this fashion so that vsprintf()
590 doesn't expect more arguments that we passed */
592 mutt_message ("%s", errbuf);
594 mutt_error ("%s", errbuf);
598 void mutt_display_address (ENVELOPE * env)
600 const char *pfx = NULL;
601 char buf[SHORT_STRING];
604 adr = mutt_get_address(env, &pfx);
610 * Note: We don't convert IDNA to local representation this time.
611 * That is intentional, so the user has an opportunity to copy &
612 * paste the on-the-wire form of the address to other, IDN-unable
617 rfc822_write_address (buf, sizeof (buf), adr, 0);
618 mutt_message ("%s: %s", pfx, buf);
621 static void set_copy_flags (HEADER * hdr, int decode, int decrypt,
622 int *cmflags, int *chflags)
625 *chflags = CH_UPDATE_LEN;
627 if (WithCrypto && !decode && decrypt && (hdr->security & ENCRYPT)) {
628 if ((WithCrypto & APPLICATION_PGP)
629 && mutt_is_multipart_encrypted (hdr->content)) {
630 *chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
631 *cmflags = M_CM_DECODE_PGP;
633 else if ((WithCrypto & APPLICATION_PGP)
634 && mutt_is_application_pgp (hdr->content) & ENCRYPT)
636 else if ((WithCrypto & APPLICATION_SMIME)
637 && mutt_is_application_smime (hdr->content) & ENCRYPT) {
638 *chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
639 *cmflags = M_CM_DECODE_SMIME;
644 *chflags = CH_XMIT | CH_MIME | CH_TXTPLAIN;
645 *cmflags = M_CM_DECODE | M_CM_CHARCONV;
647 if (!decrypt) { /* If decode doesn't kick in for decrypt, */
648 *chflags |= CH_DECODE; /* then decode RFC 2047 headers, */
650 if (option (OPTWEED)) {
651 *chflags |= CH_WEED; /* and respect $weed. */
652 *cmflags |= M_CM_WEED;
658 int _mutt_save_message (HEADER * h, CONTEXT * ctx, int delete, int decode,
660 int cmflags, chflags;
663 set_copy_flags (h, decode, decrypt, &cmflags, &chflags);
665 if (decode || decrypt)
666 mutt_parse_mime_message (Context, h);
668 if ((rc = mutt_append_message (ctx, Context, h, cmflags, chflags)) != 0)
672 mutt_set_flag (Context, h, M_DELETE, 1);
673 if (option (OPTDELETEUNTAG))
674 mutt_set_flag (Context, h, M_TAG, 0);
675 mutt_set_flag (Context, h, M_APPENDED, 1);
680 /* returns 0 if the copy/save was successful, or -1 on error/abort */
681 int mutt_save_message (HEADER * h, int delete,
682 int decode, int decrypt, int *redraw) {
683 int i, need_buffy_cleanup;
684 int need_passphrase = 0, app = 0;
685 char prompt[SHORT_STRING], buf[_POSIX_PATH_MAX];
698 snprintf (prompt, sizeof (prompt),
699 decode ? (delete ? _("Decode-save%s to mailbox") :
700 _("Decode-copy%s to mailbox")) :
701 (decrypt ? (delete ? _("Decrypt-save%s to mailbox") :
702 _("Decrypt-copy%s to mailbox")) :
703 (delete ? _("Save%s to mailbox") : _("Copy%s to mailbox"))),
704 h ? "" : _(" tagged"));
709 need_passphrase = h->security & ENCRYPT;
712 mutt_message_hook (Context, h, M_MESSAGEHOOK);
713 mutt_default_save (buf, sizeof (buf), h);
716 /* look for the first tagged message */
718 for (i = 0; i < Context->vcount; i++) {
719 if (Context->hdrs[Context->v2r[i]]->tagged) {
720 h = Context->hdrs[Context->v2r[i]];
727 mutt_message_hook (Context, h, M_MESSAGEHOOK);
728 mutt_default_save (buf, sizeof (buf), h);
730 need_passphrase = h->security & ENCRYPT;
737 mutt_pretty_mailbox (buf);
738 if (mutt_enter_fname (prompt, buf, sizeof (buf), redraw, 0) == -1)
741 if (*redraw != REDRAW_FULL) {
743 *redraw = REDRAW_INDEX | REDRAW_STATUS;
745 *redraw = REDRAW_STATUS;
751 /* This is an undocumented feature of ELM pointed out to me by Felix von
752 * Leitner <leitner@prz.fu-berlin.de>
754 if (str_cmp (buf, ".") == 0)
755 strfcpy (buf, LastSaveFolder, sizeof (buf));
757 strfcpy (LastSaveFolder, buf, sizeof (LastSaveFolder));
759 mutt_expand_path (buf, sizeof (buf));
761 /* check to make sure that this file is really the one the user wants */
762 if (mutt_save_confirm (buf, &st) != 0)
765 if (WithCrypto && need_passphrase && (decode || decrypt)
766 && !crypt_valid_passphrase (app))
769 mutt_message (_("Copying to %s..."), buf);
772 if (Context->magic == M_IMAP && !(decode || decrypt) && mx_get_magic (buf) == M_IMAP) {
773 switch (imap_copy_messages (Context, h, buf, delete)) {
778 /* non-fatal error: fall through to fetch/append */
781 /* fatal error, abort */
788 if (mx_open_mailbox (buf, M_APPEND, &ctx) != NULL) {
790 if (_mutt_save_message (h, &ctx, delete, decode, decrypt) != 0) {
791 mx_close_mailbox (&ctx, NULL);
795 for (i = 0; i < Context->vcount; i++) {
796 if (Context->hdrs[Context->v2r[i]]->tagged) {
797 mutt_message_hook (Context, Context->hdrs[Context->v2r[i]],
799 if (_mutt_save_message (Context->hdrs[Context->v2r[i]], &ctx, delete,
800 decode, decrypt) != 0) {
801 mx_close_mailbox (&ctx, NULL);
808 need_buffy_cleanup = (ctx.magic == M_MBOX || ctx.magic == M_MMDF);
810 mx_close_mailbox (&ctx, NULL);
812 if (need_buffy_cleanup) {
814 tmp = buffy_find_mailbox (buf);
815 if (tmp && tmp->new <= 0)
816 buffy_update_mailbox (tmp);
818 /* fix up the times so buffy won't get confused */
819 if (st.st_mtime > st.st_atime) {
820 ut.actime = st.st_atime;
821 ut.modtime = time (NULL);
836 void mutt_version (void)
838 mutt_message (mutt_make_version (1));
841 void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp)
843 char buf[LONG_STRING];
844 char obuf[LONG_STRING];
848 char charset[STRING];
851 short charset_changed = 0;
852 short type_changed = 0;
854 cp = mutt_get_parameter ("charset", b->parameter);
855 strfcpy (charset, NONULL (cp), sizeof (charset));
857 snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype);
858 strfcpy (obuf, buf, sizeof (obuf));
862 for (p = b->parameter; p; p = p->next) {
865 rfc822_cat (tmp, sizeof (tmp), p->value, MimeSpecials);
866 snprintf (buf + l, sizeof (buf) - l, "; %s=%s", p->attribute, tmp);
870 if (mutt_get_field ("Content-Type: ", buf, sizeof (buf), 0) != 0 ||
874 /* clean up previous junk */
875 mutt_free_parameter (&b->parameter);
876 p_delete(&b->subtype);
878 mutt_parse_content_type (buf, b);
881 snprintf (tmp, sizeof (tmp), "%s/%s", TYPE (b), NONULL (b->subtype));
882 type_changed = ascii_strcasecmp (tmp, obuf);
884 ascii_strcasecmp (charset, mutt_get_parameter ("charset", b->parameter));
886 /* if in send mode, check for conversion - current setting is default. */
888 if (!h && b->type == TYPETEXT && charset_changed) {
891 snprintf (tmp, sizeof (tmp), _("Convert to %s upon sending?"),
892 mutt_get_parameter ("charset", b->parameter));
893 if ((r = mutt_yesorno (tmp, !b->noconv)) != -1)
894 b->noconv = (r == M_NO);
897 /* inform the user */
899 snprintf (tmp, sizeof (tmp), "%s/%s", TYPE (b), NONULL (b->subtype));
901 mutt_message (_("Content-Type changed to %s."), tmp);
902 if (b->type == TYPETEXT && charset_changed) {
905 mutt_message (_("Character set changed to %s; %s."),
906 mutt_get_parameter ("charset", b->parameter),
907 b->noconv ? _("not converting") : _("converting"));
910 b->force_charset |= charset_changed ? 1 : 0;
912 if (!is_multipart (b) && b->parts)
913 mutt_free_body (&b->parts);
914 if (!mutt_is_message_type (b->type, b->subtype) && b->hdr) {
915 b->hdr->content = NULL;
916 mutt_free_header (&b->hdr);
919 if (fp && (is_multipart (b) || mutt_is_message_type (b->type, b->subtype)))
920 mutt_parse_part (fp, b);
922 if (WithCrypto && h) {
926 h->security |= crypt_query (b);
931 static int _mutt_check_traditional_pgp (HEADER * h, int *redraw)
936 h->security |= PGP_TRADITIONAL_CHECKED;
938 mutt_parse_mime_message (Context, h);
939 if ((msg = mx_open_message (Context, h->msgno)) == NULL)
941 if (crypt_pgp_check_traditional (msg->fp, h->content, 0)) {
942 h->security = crypt_query (h->content);
943 *redraw |= REDRAW_FULL;
947 h->security |= PGP_TRADITIONAL_CHECKED;
948 mx_close_message (&msg);
952 int mutt_check_traditional_pgp (HEADER * h, int *redraw)
957 if (h && !(h->security & PGP_TRADITIONAL_CHECKED))
958 rv = _mutt_check_traditional_pgp (h, redraw);
960 for (i = 0; i < Context->vcount; i++)
961 if (Context->hdrs[Context->v2r[i]]->tagged &&
962 !(Context->hdrs[Context->v2r[i]]->
963 security & PGP_TRADITIONAL_CHECKED))
965 _mutt_check_traditional_pgp (Context->hdrs[Context->v2r[i]], redraw)