Commit f88e3371 authored by sikeda's avatar sikeda
Browse files

[bug] If the list name contains "+", incorrect "mailto:" links are generated in service messages.

Fixed by encoding special characters using new "mailtourl" template filter.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12702 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 135d797e
......@@ -8,4 +8,6 @@ Subject: [% FILTER qencode %][%|loc%]near expiration of your certificate[%END%][
[%|loc(conf.email,conf.host)%]To receive them again, renew your certificate with your certification authority
and send a signed message to %1@%2
or
click: [%END%]mailto:[% conf.email %]@[% conf.host %]?subject=WHICH
click: [%END%][% | mailtourl({subject => 'WHICH'}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
......@@ -69,7 +69,7 @@ Note: Because binary files have to be encoded in less-efficient ASCII format bef
[%|loc(conf.listmaster_email,conf.host)%]For further information, please contact %1@%2[%END%]
[% ELSIF status == '5.6.0' -%]
[%|loc(list.name,conf.sympa,list.host,cmd)%]The following message was sent to list '%1' and it contains a line '%4' that can be interpreted as a command.
[%|loc(list.name,"${conf.email}@${conf.host}",list.host,cmd)%]The following message was sent to list '%1' and it contains a line '%4' that can be interpreted as a command.
If your message contained a command (like subscribe, unsubscribe, help, index, get, ...), please note that commands should never be sent to lists. Commands must be sent to %2 exclusively.
......@@ -111,7 +111,9 @@ You are not allowed to send this message for the following reason:[%END%]
[%|loc%]To find out the correct listname, ask for this server's lists directory:[%END%]
mailto:[% conf.email %]@[% conf.host %]?subject=WHICH
[% | mailtourl({subject => 'WHICH'}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.listmaster_email,conf.host)%]For further information, please contact %1@%2[%END%]
......
......@@ -6,4 +6,6 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Removed from %1[%END%][%END%]
because you didn't confirm your subscription.[%END%]
[%|loc%]You can subscribe again:[%END%]
[% FILTER escape_url %]mailto:[%conf.email%]@[%conf.host%]?subject=sub [%list.name%][% END %]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[%conf.email%]@[%conf.host%]
[%~ END %]
Subject: [% FILTER qencode %][%|loc(list.name)%]resubscription to %1[%END%][%END%]
[%|loc(list.name,list.host,user.email)%]You have been subscriber of list %1@%2 with email %3 for 1 year or more;[%END%]
mailto:[% conf.email %]@[% conf.host %]?subject=sub%20[% list.name %]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc%]Everything about this list: [%END%][% conf.wwsympa_url %]/info/[% list.name %]
[%|loc%]Unsubscription:[%END%]
mailto:[% conf.email %]@[% conf.host %]?subject=sig%20[% list.name %]%20[% user.email %]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
......@@ -2,8 +2,12 @@ From: [% fromlist %]
Subject: [% FILTER qencode %][%|loc(list.name)%]resubscription to %1[%END%][%END%]
[%|loc(list.name,list.host,user.email)%]You have been subscriber of list %1@%2 with email %3 for 1 year or more;[%END%]
mailto:[% conf.email %]@[% conf.host %]?subject=sub%20[% list.name %]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc%]Everything about this list: [%END%][% conf.wwsympa_url %]/info/[% list.name %]
[%|loc%]Unsubscription:[%END%]
[% FILTER escape_url %]mailto:[%conf.email%]@[%conf.host%]?subject=sig [%list.name%] [%user.email%][% END %]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
......@@ -10,6 +10,8 @@ X-Sympa-NoWrap: yes
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[% FOREACH l = lists -%]
[% l %] [% FILTER escape_url %]mailto:[%conf.sympa%]?subject=sig [%l%] [%user.email%][% END %]
[% l %] [% | mailtourl({subject => "sig ${l} ${user.email}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[% END -%]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
From: [% requested_by %]
Reply-To: [% conf.sympa %]
Reply-To: [% conf.email %]@[% conf.host %]
Subject: [% FILTER qencode %][%|loc(list.name)%]Invitation to join list %1[%END%][%END%]
[%|loc(list.subject)%]This list is about %1, so you are probably concerned.[%END%]
[%|loc%]To subscribe just hit the following link:[%END%]
[% url %]
[% | mailtourl({subject => "${subject}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.sympa,list.name)%]Or send a message to %1 with subject: "sub %2"[%END%]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
[% subject %]
[%|loc%]If you don't want to subscribe just ignore this message.[%END%]
......@@ -14,7 +14,9 @@ Content-Description: Notification
[%|loc%]To find out the correct listname, ask for this server's lists directory:[%END%]
mailto:[% conf.email %]@[% conf.host %]?subject=WHICH
[% | mailtourl({subject => 'WHICH'}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.listmaster_email,conf.host)%]For further information, please contact %1@%2[%END%]
......
......@@ -58,7 +58,10 @@ pending subscription requests you should click on the following link:[%END%]
AUTH [%keyauth%] ADD [%list.name%] [%who%] [%gecos%]
[%|loc%]That can be done using this mailto link:[%END%][% FILTER escape_url %]mailto:[%replyto%]?subject=auth [%keyauth%] ADD [%list.name%] [%escaped_who%] [%escaped_gecos%][% END %]
[%|loc%]That can be done using this mailto link:[%END%]
[% | mailtourl({subject => "auth ${keyauth} ADD ${list.name} ${who} ${gecos}"}) ~%]
[% replyto %]
[%~ END %]
[% IF custom_attribute %]
[%|loc%]The user has provided the following informations:[%END%]
......@@ -75,11 +78,11 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]UNsubscription request from list
A user asked to be deleted from your list. If this is OK
with you, you should click on the following link:[% END %]
[% FILTER escape_url %]mailto:[%sympa%]?subject=auth [%keyauth%] DEL [%list.name%] [%escaped_who%][% END %]
[% | mailtourl({subject => "auth ${keyauth} DEL ${list.name} ${who}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(sympa)-%]
or send an email to %1 with the following subject:
[%END%]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [%keyauth%] DEL [%list.name%] [%who%]
[% ELSIF type == 'automatic_bounce_management' -%]
......
......@@ -8,4 +8,4 @@ Subject: [% FILTER qencode %][%|loc%]Public lists[%END%][%END%]
[% END %]
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
mailto:listmaster@[% conf.host %]
mailto:[% conf.listmaster_email %]@[% conf.host %]
......@@ -25,12 +25,16 @@ Content-Disposition: inline
[% ELSE -%]
[% IF method == 'md5' && ! request_topic -%]
[%|loc(list.name)%]To distribute the attached message in list %1:[%END%]
<[% FILTER escape_url %]mailto:[%conf.sympa%]?subject=DISTRIBUTE [%list.name%] [%modkey%][% END %]>
<[% | mailtourl({subject => "DISTRIBUTE ${list.name} ${modkey}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]>
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
DISTRIBUTE [% list.name %] [% modkey %]
[%|loc%]To reject it (it will be removed):[%END%]
<[% FILTER escape_url %]mailto:[%conf.sympa%]?subject=REJECT [%list.name%] [%modkey%][% END %]>
<[% | mailtourl({subject => "REJECT ${list.name} ${modkey}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]>
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[%END%]
REJECT [% list.name %] [% modkey %]
[%END%]
......
......@@ -6,5 +6,7 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Reminder of your subscription to
[%|loc%]Everything about this list: [%END%][% conf.wwsympa_url %]/info/[% list.name %]
[% IF subscriber.included != 1 %]
[%|loc%]Unsubscription:[%END%]
[% FILTER escape_url %]mailto:[%conf.email%]@[%conf.host%]?subject=sig [%list.name%] [%user.email%][% END %]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%END%]
......@@ -4,4 +4,6 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Removed from %1[%END%][%END%]
[%|loc(user.email,list.name,list.host)%]Your email address (%1) has been removed from list %2@%3[%END%]
[%|loc%]You can subscribe again:[%END%]
[% FILTER escape_url %]mailto:[%conf.email%]@[%conf.host%]?subject=sub [%list.name%][% END %]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
......@@ -24,13 +24,17 @@ Subject: [% FILTER qencode %][%command%][%END%]
[%- END -%]
[%- END -%]
[%|loc(conf.sympa,command)-%]If you want this action to be taken, please
[% sympa = BLOCK %][% conf.email %]@[% conf.host %][%END%]
[%|loc(sympa,command) %]If you want this action to be taken, please
- reply to this mail
OR
- send a message to %1 with subject
%2
OR
- hit the following mailto[% END %] [% FILTER escape_url %]mailto:[%conf.sympa%]?subject=[%command_escaped%][% END %]
- hit the following mailto[% END %]
[% | mailtourl({subject => "$command"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc-%]If you do not want this action to be taken, you can safely ignore this message.[% END %]
Reply-to: [% conf.sympa %]
Reply-to: [% conf.email %]@[% conf.host %]
[% IF request_topic -%]Subject: [% FILTER qencode %][%|loc(list.name)%]Tag your message for list %1[%END%][%END%]
[% ELSE -%]Subject: [% FILTER qencode %]Confirm [% authkey %][%END%]
[% END -%]
......@@ -12,10 +12,11 @@ Content-Disposition: inline
[%conf.wwsympa_url%]/request_topic/[%list.name%]/[%authkey%]
[%- ELSE -%][%|loc(list.name)%]To distribute the attached message in list %1, follow the link below:[%END%]
[% FILTER escape_url %]mailto:[%conf.sympa%]?subject=CONFIRM [%authkey%][% END %]
[% | mailtourl({subject => "CONFIRM ${authkey}"}) ~%]
[% conf.email %]@[% conf.host %]
[%~ END %]
[%|loc(conf.sympa)%]Or send a message to %1 with the following subject:
[% END %]
[%|loc(conf.email,conf.host)%]Or send a message to %1@%2 with the following subject:[% END %]
CONFIRM [% authkey %]
[%- END -%]
......
......@@ -9562,37 +9562,54 @@ sub add_list_header {
$message->add_header(
'List-Help',
sprintf(
'<mailto:%s@%s?subject=help>',
Conf::get_robot_conf($robot, 'email'),
Conf::get_robot_conf($robot, 'host')
'<%s>',
Sympa::Tools::Text::mailtourl(
Sympa::get_address($self, 'sympa'),
query => {subject => 'help'}
)
)
);
} elsif ($field eq 'unsubscribe') {
$message->add_header(
'List-Unsubscribe',
sprintf(
'<mailto:%s@%s?subject=unsubscribe%%20%s>',
Conf::get_robot_conf($robot, 'email'),
Conf::get_robot_conf($robot, 'host'),
$self->{'name'}
'<%s>',
Sympa::Tools::Text::mailtourl(
Sympa::get_address($self, 'sympa'),
query => {
subject => sprintf('unsubscribe %s', $self->{'name'})
}
)
)
);
} elsif ($field eq 'subscribe') {
$message->add_header(
'List-Subscribe',
sprintf(
'<mailto:%s@%s?subject=subscribe%%20%s>',
Conf::get_robot_conf($robot, 'email'),
Conf::get_robot_conf($robot, 'host'),
$self->{'name'}
'<%s>',
Sympa::Tools::Text::mailtourl(
Sympa::get_address($self, 'sympa'),
query =>
{subject => sprintf('subscribe %s', $self->{'name'})}
)
)
);
} elsif ($field eq 'post') {
$message->add_header('List-Post',
sprintf('<mailto:%s>', $self->get_list_address()));
$message->add_header(
'List-Post',
sprintf('<%s>',
Sympa::Tools::Text::mailtourl(Sympa::get_address($self)))
);
} elsif ($field eq 'owner') {
$message->add_header('List-Owner',
sprintf('<mailto:%s>', $self->get_list_address('owner')));
$message->add_header(
'List-Owner',
sprintf(
'<%s>',
Sympa::Tools::Text::mailtourl(
Sympa::get_address($self, 'owner')
)
)
);
} elsif ($field eq 'archive') {
if (Conf::get_robot_conf($robot, 'wwsympa_url')
and $self->is_web_archived()) {
......@@ -9600,7 +9617,7 @@ sub add_list_header {
'List-Archive',
sprintf('<%s/arc/%s>',
Conf::get_robot_conf($robot, 'wwsympa_url'),
$self->{'name'})
Sympa::Tools::Text::encode_uri($self->{'name'}))
);
} else {
return 0;
......@@ -9619,10 +9636,10 @@ sub add_list_header {
my $archived_msg_url =
sprintf '%s/arcsearch_id/%s/%s-%s/%s',
Conf::get_robot_conf($robot, 'wwsympa_url'),
$self->{'name'}, $yyyy, $mm,
URI::Escape::uri_escape($message_id);
Sympa::Tools::Text::encode_uri($self->{'name'}), $yyyy, $mm,
Sympa::Tools::Text::encode_uri($message_id);
$message->add_header('Archived-At',
'<' . $archived_msg_url . '>');
sprintf('<%s>', $archived_msg_url));
} else {
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment