From 50159c7895acc32e014ca5832e461f05c3d98fe3 Mon Sep 17 00:00:00 2001 From: pdmef Date: Thu, 16 Jun 2005 20:51:42 +0000 Subject: [PATCH] Rocco Rutte: - add $strict_mailto (as somewhat suggested by TLR and others in etc.) git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@317 e385b8ad-14ed-0310-8656-cc95a2468c6d --- UPGRADING | 2 + doc/manual.txt | 156 +++++++++++++++++++++++++++---------------------- init.h | 14 +++++ mutt.h | 1 + url.c | 10 +++- 5 files changed, 110 insertions(+), 73 deletions(-) diff --git a/UPGRADING b/UPGRADING index e5cb38a..d54eac2 100644 --- a/UPGRADING +++ b/UPGRADING @@ -32,6 +32,8 @@ sources of information. Due to frequent trouble, $imap_mail_check now defaults to 300 seconds (5 minutes) rather than 5 seconds. + The configuration variable $strict_mailto has been added. + 2005-05-17: Changes due to better integration of qdbm support w/ header caching: diff --git a/doc/manual.txt b/doc/manual.txt index 1325975..4120b27 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -233,7 +233,7 @@ +o cclleeaarr--ffllaagg (default: W) Furthermore, the following flags reflect who the message is addressed to. They - can be customized with the _$_t_o___c_h_a_r_s (section 6.3.315 , page 142) variable. + can be customized with the _$_t_o___c_h_a_r_s (section 6.3.316 , page 142) variable. + message is to you and you only @@ -342,7 +342,7 @@ _$_i_n_d_e_x___f_o_r_m_a_t (section 6.3.108 , page 89) to optionally display the number of hidden messages if the thread is collapsed. - See also: _$_s_t_r_i_c_t___t_h_r_e_a_d_s (section 6.3.304 , page 139). + See also: _$_s_t_r_i_c_t___t_h_r_e_a_d_s (section 6.3.305 , page 140). _2_._3_._4 _M_i_s_c_e_l_l_a_n_e_o_u_s _F_u_n_c_t_i_o_n_s @@ -435,7 +435,7 @@ Asks for an external Unix command and pipes the current or tagged message(s) to it. The variables _$_p_i_p_e___d_e_c_o_d_e (section 6.3.198 , page 113), _$_p_i_p_e___s_p_l_i_t (section 6.3.200 , page 113), _$_p_i_p_e___s_e_p (section 6.3.199 , page 113) and - _$_w_a_i_t___k_e_y (section 6.3.327 , page 144) control the exact behavior of this + _$_w_a_i_t___k_e_y (section 6.3.328 , page 144) control the exact behavior of this function. rreesseenndd--mmeessssaaggee @@ -445,7 +445,7 @@ message. This function is best described as "recall from arbitrary folders". It can conveniently be used to forward MIME messages while preserving the orig- inal mail structure. Note that the amount of headers included here depends on - the value of the _$_w_e_e_d (section 6.3.328 , page 144) variable. + the value of the _$_w_e_e_d (section 6.3.329 , page 145) variable. This function is also available from the attachment menu. You can use this to easily resend a message which was included with a bounce message as a mes- @@ -455,7 +455,7 @@ (default: !) Asks for an external Unix command and executes it. The _$_w_a_i_t___k_e_y (section - 6.3.327 , page 144) can be used to control whether Mutt-ng will wait for a key + 6.3.328 , page 144) can be used to control whether Mutt-ng will wait for a key to be pressed when the command returns (presumably to let the user read the output of the command), based on the return status of the named command. @@ -687,7 +687,7 @@ ple, can be set to ``ask-no''. The inclusion of headers is controlled by the current setting of the _$_w_e_e_d - (section 6.3.328 , page 144) variable, unless _m_i_m_e___f_o_r_w_a_r_d (section 6.3.134 , + (section 6.3.329 , page 145) variable, unless _m_i_m_e___f_o_r_w_a_r_d (section 6.3.134 , page 97) is set. Editing the message to forward follows the same procedure as sending or reply- @@ -2556,7 +2556,7 @@ Polling for new mail on an IMAP server can cause noticeable delays. So, you'll want to carefully tune the _$_i_m_a_p___m_a_i_l___c_h_e_c_k (section 6.3.97 , page 87) and - _$_t_i_m_e_o_u_t (section 6.3.313 , page 141) variables. + _$_t_i_m_e_o_u_t (section 6.3.314 , page 142) variables. Note that if you are using mbox as the mail store on UW servers prior to v12.250, the server has been reported to disconnect a client if another client @@ -3044,10 +3044,10 @@ needsterminal Mutt-ng uses this flag when viewing attachments with _a_u_t_o_v_i_e_w (sec- tion 5.4 , page 60), in order to decide whether it should honor - the setting of the _$_w_a_i_t___k_e_y (section 6.3.327 , page 144) variable + the setting of the _$_w_a_i_t___k_e_y (section 6.3.328 , page 144) variable or not. When an attachment is viewed using an interactive program, and the corresponding mailcap entry has a _n_e_e_d_s_t_e_r_m_i_n_a_l flag, Mutt- - ng will use _$_w_a_i_t___k_e_y (section 6.3.327 , page 144) and the exit + ng will use _$_w_a_i_t___k_e_y (section 6.3.328 , page 144) and the exit status of the program to decide if it will ask you to press a key after the external program has exited. In all other situations it will not prompt you for a key. @@ -3599,7 +3599,7 @@ set assumed_charset='iso-2022-jp:euc-jp:shift_jis:utf-8' However, only the first content is valid for the message body. This variable - is valid only if _$_s_t_r_i_c_t___m_i_m_e (section 6.3.303 , page 139) is unset. + is valid only if _$_s_t_r_i_c_t___m_i_m_e (section 6.3.304 , page 139) is unset. _6_._3_._1_2 _a_t_t_a_c_h___f_o_r_m_a_t @@ -4352,7 +4352,7 @@ is invoked. When _u_n_s_e_t, _b_u_f_f_y___l_i_s_t will just list all mailboxes which are already known to have new mail. - Also see the following variables: ``_$_t_i_m_e_o_u_t (section 6.3.313 , page 141)'', + Also see the following variables: ``_$_t_i_m_e_o_u_t (section 6.3.314 , page 142)'', ``_$_m_a_i_l___c_h_e_c_k (section 6.3.113 , page 93)'' and ``_$_i_m_a_p___m_a_i_l___c_h_e_c_k (section 6.3.97 , page 87)''. @@ -4434,7 +4434,7 @@ This variable contains a default from address. It can be overridden using my_hdr (including from send-hooks) and ``_$_r_e_v_e_r_s_e___n_a_m_e (section 6.3.234 , page - 121)''. This variable is ignored if ``_$_u_s_e___f_r_o_m (section 6.3.322 , page + 121)''. This variable is ignored if ``_$_u_s_e___f_r_o_m (section 6.3.323 , page 143)'' is unset. E.g. you can use send-hook Mutt-ng-devel@lists.berlios.de 'my_hdr From: Foo Bar @@ -4481,8 +4481,8 @@ The Mutt-ng E-Mail Client 84 When _s_e_t, this variable causes Mutt-ng to include the header of the message you - are replying to into the edit buffer. The ``_$_w_e_e_d (section 6.3.328 , page - 144)'' setting applies. + are replying to into the edit buffer. The ``_$_w_e_e_d (section 6.3.329 , page + 145)'' setting applies. _6_._3_._7_7 _h_e_a_d_e_r___c_a_c_h_e @@ -4972,7 +4972,7 @@ `to:' field (recipients) %T - the appropriate character from the _$_t_o___c_h_a_r_s (section 6.3.315 , + the appropriate character from the _$_t_o___c_h_a_r_s (section 6.3.316 , page 142) string %u @@ -5023,7 +5023,7 @@ %|X pad to the end of the line with character 'X' - See also: ``_$_t_o___c_h_a_r_s (section 6.3.315 , page 142)''. + See also: ``_$_t_o___c_h_a_r_s (section 6.3.316 , page 142)''. _6_._3_._1_0_9 _i_s_p_e_l_l @@ -5170,7 +5170,7 @@ When _s_e_t, the maximum line length for displaying ``format = flowed'' messages is limited to this length. A value of 0 (which is also the default) means that the maximum line length is determined by the terminal width and _$_w_r_a_p_m_a_r_g_i_n - (section 6.3.330 , page 145). + (section 6.3.331 , page 145). _6_._3_._1_2_2 _m_b_o_x @@ -6539,7 +6539,7 @@ time. When set to 0, only a single message will appear before the reading the mailbox. - Also see the ``_$_w_r_i_t_e___i_n_c (section 6.3.332 , page 145)'' variable. + Also see the ``_$_w_r_i_t_e___i_n_c (section 6.3.333 , page 145)'' variable. _6_._3_._2_2_5 _r_e_a_d___o_n_l_y @@ -7420,7 +7420,7 @@ Default: yes This variable is only useful when sorting by threads with ``_$_s_t_r_i_c_t___t_h_r_e_a_d_s - (section 6.3.304 , page 139)'' _u_n_s_e_t. In that case, it changes the heuristic + (section 6.3.305 , page 140)'' _u_n_s_e_t. In that case, it changes the heuristic Mutt-ng uses to thread messages by subject. With _$_s_o_r_t___r_e (section 6.3.291 , page 135) _s_e_t, Mutt-ng will only attach a message as the child of another mes- sage by subject if the subject of the child message starts with a substring @@ -7677,7 +7677,22 @@ The Mutt-ng E-Mail Client 141 - _6_._3_._3_0_3 _s_t_r_i_c_t___m_i_m_e + _6_._3_._3_0_3 _s_t_r_i_c_t___m_a_i_l_t_o + + Type: boolean + + Default: yes + + With mailto: style links, a body as well as arbitrary header information may be + embedded. This may lead to (user) headers being overwriten without note if + ``_$_e_d_i_t___h_e_a_d_e_r_s (section 6.3.54 , page 77)'' is unset. + + If this variable is _s_e_t, mutt-ng is strict and allows anything to be changed. + If it's _u_n_s_e_t, all headers given will be prefixed with ``X-Mailto-'' and the + message including headers will be shown in the editor regardless of what + ``_$_e_d_i_t___h_e_a_d_e_r_s (section 6.3.54 , page 77)'' is set to. + + _6_._3_._3_0_4 _s_t_r_i_c_t___m_i_m_e Type: boolean @@ -7692,7 +7707,7 @@ a single space to prevent the display of MIME-encoded ``Subject:'' header field from being devided into multiple lines. - _6_._3_._3_0_4 _s_t_r_i_c_t___t_h_r_e_a_d_s + _6_._3_._3_0_5 _s_t_r_i_c_t___t_h_r_e_a_d_s Type: boolean @@ -7705,39 +7720,39 @@ mailbox where you might have several unrelated messages with the subject ``hi'' which will get grouped together. - _6_._3_._3_0_5 _s_t_r_i_p___w_a_s + _6_._3_._3_0_6 _s_t_r_i_p___w_a_s Type: boolean Default: no When _s_e_t, mutt-ng will remove the trailing part of the ``Subject:'' line which - matches _$_s_t_r_i_p___w_a_s___r_e_g_e_x (section 6.3.306 , page 140) when replying. This is + matches _$_s_t_r_i_p___w_a_s___r_e_g_e_x (section 6.3.307 , page 140) when replying. This is useful to properly react on subject changes and reduce ``subject noise.'' (esp. in Usenet) - _6_._3_._3_0_6 _s_t_r_i_p___w_a_s___r_e_g_e_x + The Mutt-ng E-Mail Client 142 + + _6_._3_._3_0_7 _s_t_r_i_p___w_a_s___r_e_g_e_x Type: regular expression Default: '\([Ww][Aa][RrSs]: .*\)[ ]*$' - When non-empty and _$_s_t_r_i_p___w_a_s (section 6.3.305 , page 140) is _s_e_t, mutt-ng + When non-empty and _$_s_t_r_i_p___w_a_s (section 6.3.306 , page 140) is _s_e_t, mutt-ng will remove this trailing part of the ``Subject'' line when replying if it won't be empty afterwards. - _6_._3_._3_0_7 _s_t_u_f_f___q_u_o_t_e_d + _6_._3_._3_0_8 _s_t_u_f_f___q_u_o_t_e_d Type: boolean Default: no - The Mutt-ng E-Mail Client 142 - If _s_e_t, attachments with flowed format will have their quoting ``stuffed'', i.e. a space will be inserted between the quote characters and the actual text. - _6_._3_._3_0_8 _s_u_s_p_e_n_d + _6_._3_._3_0_9 _s_u_s_p_e_n_d Type: boolean @@ -7747,7 +7762,7 @@ usually CTRL+Z. This is useful if you run Mutt-ng inside an xterm using a com- mand like ``xterm -e muttng.'' - _6_._3_._3_0_9 _t_e_x_t___f_l_o_w_e_d + _6_._3_._3_1_0 _t_e_x_t___f_l_o_w_e_d Type: boolean @@ -7761,7 +7776,7 @@ Note that _$_i_n_d_e_n_t___s_t_r_i_n_g (section 6.3.107 , page 89) is ignored when this option is set. - _6_._3_._3_1_0 _t_h_o_r_o_u_g_h___s_e_a_r_c_h + _6_._3_._3_1_1 _t_h_o_r_o_u_g_h___s_e_a_r_c_h Type: boolean @@ -7772,7 +7787,9 @@ to be searched are decoded before searching. If _u_n_s_e_t, messages are searched as they appear in the folder. - _6_._3_._3_1_1 _t_h_r_e_a_d___r_e_c_e_i_v_e_d + The Mutt-ng E-Mail Client 143 + + _6_._3_._3_1_2 _t_h_r_e_a_d___r_e_c_e_i_v_e_d Type: boolean @@ -7781,19 +7798,16 @@ When _s_e_t, Mutt-ng uses the date received rather than the date sent to thread messages by subject. - _6_._3_._3_1_2 _t_i_l_d_e + _6_._3_._3_1_3 _t_i_l_d_e Type: boolean Default: no When _s_e_t, the internal-pager will pad blank lines to the bottom of the screen - - The Mutt-ng E-Mail Client 143 - with a tilde (~). - _6_._3_._3_1_3 _t_i_m_e_o_u_t + _6_._3_._3_1_4 _t_i_m_e_o_u_t Type: number @@ -7803,7 +7817,7 @@ pressed in the main menu before timing out and checking for new mail. A value of zero or less will cause Mutt-ng to never time out. - _6_._3_._3_1_4 _t_m_p_d_i_r + _6_._3_._3_1_5 _t_m_p_d_i_r Type: path @@ -7814,7 +7828,7 @@ set, the environment variable $TMPDIR is used. If $TMPDIR is not set then '/tmp' is used. - _6_._3_._3_1_5 _t_o___c_h_a_r_s + _6_._3_._3_1_6 _t_o___c_h_a_r_s Type: string @@ -7830,7 +7844,9 @@ indicate mail that was sent by _y_o_u. The sixth character is used to indicate when a mail was sent to a mailing-list you're subscribe to (default: L). - _6_._3_._3_1_6 _t_r_a_s_h + The Mutt-ng E-Mail Client 144 + + _6_._3_._3_1_7 _t_r_a_s_h Type: path @@ -7842,12 +7858,10 @@ NNoottee: When you delete a message in the trash folder, it is really deleted, so that there is no way to recover mail. - _6_._3_._3_1_7 _t_u_n_n_e_l + _6_._3_._3_1_8 _t_u_n_n_e_l Type: string - The Mutt-ng E-Mail Client 144 - Default: '' Setting this variable will cause Mutt-ng to open a pipe to a command instead of @@ -7859,7 +7873,7 @@ NNoottee:: For this example to work you must be able to log in to the remote machine without having to enter a password. - _6_._3_._3_1_8 _u_m_a_s_k + _6_._3_._3_1_9 _u_m_a_s_k Type: number @@ -7868,7 +7882,7 @@ This sets the umask that will be used by Mutt-ng when creating all kinds of files. If _u_n_s_e_t, the default value is 077. - _6_._3_._3_1_9 _u_n_c_o_l_l_a_p_s_e___j_u_m_p + _6_._3_._3_2_0 _u_n_c_o_l_l_a_p_s_e___j_u_m_p Type: boolean @@ -7877,7 +7891,7 @@ When _s_e_t, Mutt-ng will jump to the next unread message, if any, when the cur- rent thread is _u_ncollapsed. - _6_._3_._3_2_0 _u_s_e___8_b_i_t_m_i_m_e + _6_._3_._3_2_1 _u_s_e___8_b_i_t_m_i_m_e Type: boolean @@ -7887,10 +7901,12 @@ which supports the -B8BITMIME flag (such as sendmail 8.8.x) or you may not be able to send mail. + The Mutt-ng E-Mail Client 145 + When _s_e_t, Mutt-ng will invoke ``_$_s_e_n_d_m_a_i_l (section 6.3.245 , page 124)'' with the -B8BITMIME flag when sending 8-bit messages to enable ESMTP negotiation. - _6_._3_._3_2_1 _u_s_e___d_o_m_a_i_n + _6_._3_._3_2_2 _u_s_e___d_o_m_a_i_n Type: boolean @@ -7900,9 +7916,7 @@ tion) with the value of ``_$_h_o_s_t_n_a_m_e (section 6.3.88 , page 85)''. If _u_n_s_e_t, no addresses will be qualified. - _6_._3_._3_2_2 _u_s_e___f_r_o_m - - The Mutt-ng E-Mail Client 145 + _6_._3_._3_2_3 _u_s_e___f_r_o_m Type: boolean @@ -7912,7 +7926,7 @@ sages. If _u_n_s_e_t, no ``From:'' header field will be generated unless the user explicitly sets one using the ``_m_y___h_d_r (section 3.13 , page 25)'' command. - _6_._3_._3_2_3 _u_s_e___i_d_n + _6_._3_._3_2_4 _u_s_e___i_d_n Type: boolean @@ -7925,7 +7939,7 @@ NNoottee:: You can use IDNs for addresses even if this is _u_n_s_e_t. This variable only affects decoding. - _6_._3_._3_2_4 _u_s_e___i_p_v_6 + _6_._3_._3_2_5 _u_s_e___i_p_v_6 Type: boolean @@ -7935,7 +7949,7 @@ If this option is _u_n_s_e_t, Mutt-ng will restrict itself to IPv4 addresses. Nor- mally, the default should work. - _6_._3_._3_2_5 _u_s_e_r___a_g_e_n_t + _6_._3_._3_2_6 _u_s_e_r___a_g_e_n_t Type: boolean @@ -7944,7 +7958,9 @@ When _s_e_t, Mutt-ng will add a ``User-Agent:'' header to outgoing messages, indi- cating which version of Mutt-ng was used for composing them. - _6_._3_._3_2_6 _v_i_s_u_a_l + The Mutt-ng E-Mail Client 146 + + _6_._3_._3_2_7 _v_i_s_u_a_l Type: path @@ -7953,14 +7969,12 @@ Specifies the visual editor to invoke when the _~_v command is given in the builtin editor. - _6_._3_._3_2_7 _w_a_i_t___k_e_y + _6_._3_._3_2_8 _w_a_i_t___k_e_y Type: boolean Default: yes - The Mutt-ng E-Mail Client 146 - Controls whether Mutt-ng will ask you to press a key after _s_h_e_l_l_- _e_s_c_a_p_e, _p_i_p_e_- _m_e_s_s_a_g_e, _p_i_p_e_-_e_n_t_r_y, _p_r_i_n_t_-_m_e_s_s_a_g_e, and _p_r_i_n_t_-_e_n_t_r_y commands. @@ -7971,7 +7985,7 @@ When _s_e_t, Mutt-ng will always ask for a key. When _u_n_s_e_t, Mutt-ng will wait for a key only if the external command returned a non-zero status. - _6_._3_._3_2_8 _w_e_e_d + _6_._3_._3_2_9 _w_e_e_d Type: boolean @@ -7980,7 +7994,7 @@ When _s_e_t, Mutt-ng will weed headers when displaying, forwarding, printing, or replying to messages. - _6_._3_._3_2_9 _w_r_a_p___s_e_a_r_c_h + _6_._3_._3_3_0 _w_r_a_p___s_e_a_r_c_h Type: boolean @@ -7991,7 +8005,7 @@ When _s_e_t, searches will wrap around the first (or last) message. When _u_n_s_e_t, searches will not wrap. - _6_._3_._3_3_0 _w_r_a_p_m_a_r_g_i_n + _6_._3_._3_3_1 _w_r_a_p_m_a_r_g_i_n Type: number @@ -8000,7 +8014,9 @@ Controls the size of the margin remaining at the right side of the terminal when Mutt-ng's pager does smart wrapping. - _6_._3_._3_3_1 _w_r_i_t_e___b_c_c + The Mutt-ng E-Mail Client 147 + + _6_._3_._3_3_2 _w_r_i_t_e___b_c_c Type: boolean @@ -8009,31 +8025,29 @@ Controls whether Mutt-ng writes out the Bcc header when preparing messages to be sent. Exim users may wish to _u_n_s_e_t this. - _6_._3_._3_3_2 _w_r_i_t_e___i_n_c + _6_._3_._3_3_3 _w_r_i_t_e___i_n_c Type: number Default: 10 - The Mutt-ng E-Mail Client 147 - When writing a mailbox, a message will be printed every _w_r_i_t_e___i_n_c messages to indicate progress. If set to 0, only a single message will be displayed before writing a mailbox. Also see the ``_$_r_e_a_d___i_n_c (section 6.3.224 , page 119)'' variable. - _6_._3_._3_3_3 _x_t_e_r_m___i_c_o_n + _6_._3_._3_3_4 _x_t_e_r_m___i_c_o_n Type: string Default: 'M%?n?AIL&ail?' Controls the format of the X11 icon title, as long as _$_x_t_e_r_m___s_e_t___t_i_t_l_e_s (sec- - tion 6.3.334 , page 146) is _s_e_t. This string is identical in formatting to the + tion 6.3.335 , page 146) is _s_e_t. This string is identical in formatting to the one used by ``_$_s_t_a_t_u_s___f_o_r_m_a_t (section 6.3.301 , page 137)''. - _6_._3_._3_3_4 _x_t_e_r_m___s_e_t___t_i_t_l_e_s + _6_._3_._3_3_5 _x_t_e_r_m___s_e_t___t_i_t_l_e_s Type: boolean @@ -8043,19 +8057,21 @@ you're in an appropriate terminal). The default must be _u_n_s_e_t to force in the validity checking. - _6_._3_._3_3_5 _x_t_e_r_m___t_i_t_l_e + _6_._3_._3_3_6 _x_t_e_r_m___t_i_t_l_e Type: string Default: 'Mutt-ng with %?m?%m messages&no messages?%?n? [%n New]?' Controls the format of the title bar of the xterm provided that - _$_x_t_e_r_m___s_e_t___t_i_t_l_e_s (section 6.3.334 , page 146) has been _s_e_t. This string is + _$_x_t_e_r_m___s_e_t___t_i_t_l_e_s (section 6.3.335 , page 146) has been _s_e_t. This string is identical in formatting to the one used by ``_$_s_t_a_t_u_s___f_o_r_m_a_t (section 6.3.301 , page 137)''. _6_._4 _F_u_n_c_t_i_o_n_s + The Mutt-ng E-Mail Client 148 + The following is the list of available functions listed by the mapping in which they are available. The default key setting is given, and an explanation of what the function does. The key bindings of these functions can be changed @@ -8068,8 +8084,6 @@ tings for this menu will affect the default bindings for all menus (except as noted). - The Mutt-ng E-Mail Client 148 - bottom-page L move to the bottom of the page current-bottom not bound move current entry to bottom of page current-middle not bound move current entry to middle of page diff --git a/init.h b/init.h index 175133f..d0e7975 100644 --- a/init.h +++ b/init.h @@ -3289,6 +3289,20 @@ struct option_t MuttVars[] = { ** Setting this variable causes the ``status bar'' to be displayed on ** the first line of the screen rather than near the bottom. */ + {"strict_mailto", DT_BOOL, R_NONE, OPTSTRICTMAILTO, 1}, + /* + ** + ** .pp + ** With mailto: style links, a body as well as arbitrary header information + ** may be embedded. This may lead to (user) headers being overwriten without note + ** if ``$$edit_headers'' is unset. + ** + ** .pp + ** If this variable is \fIset\fP, mutt-ng is strict and allows anything to be + ** changed. If it's \fIunset\fP, all headers given will be prefixed with + ** ``X-Mailto-'' and the message including headers will be shown in the editor + ** regardless of what ``$$edit_headers'' is set to. + **/ {"strict_mime", DT_BOOL, R_NONE, OPTSTRICTMIME, 1}, /* ** .pp diff --git a/mutt.h b/mutt.h index d08b5da..c74e8fd 100644 --- a/mutt.h +++ b/mutt.h @@ -442,6 +442,7 @@ enum { OPTSORTRE, OPTSPAMSEP, OPTSTATUSONTOP, + OPTSTRICTMAILTO, OPTSTRICTMIME, OPTSTRICTTHREADS, OPTSTRIPWAS, diff --git a/url.c b/url.c index a7cb3c3..d9cc4de 100644 --- a/url.c +++ b/url.c @@ -237,13 +237,19 @@ int url_parse_mailto (ENVELOPE * e, char **body, const char *src) str_replace (body, value); } else { - taglen = safe_strlen (tag); +#define SAFEPFX (option (OPTSTRICTMAILTO) ? "" : "X-Mailto-") + taglen = safe_strlen (tag) + safe_strlen (SAFEPFX); /* mutt_parse_rfc822_line makes some assumptions */ - snprintf (scratch, sizeof (scratch), "%s: %s", tag, value); + snprintf (scratch, sizeof (scratch), "%s%s: %s", SAFEPFX, tag, value); +#undef SAVEPFX scratch[taglen] = '\0'; value = &scratch[taglen + 1]; SKIPWS (value); mutt_parse_rfc822_line (e, NULL, scratch, value, 1, 0, 0, &last); + /* if $strict_mailto is set, force editing headers to let + * users have a look at what we got */ + if (!option (OPTSTRICTMAILTO)) + set_option (OPTEDITHDRS); } } -- 2.20.1