Unverified Commit c7362de1 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #330 from ikedas/optioal_wwsympa_url by ikedas

WWSympa: wwsympa_url would be optional
parents e491c807 97d893a8
......@@ -13,4 +13,6 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]List %1 automatic bounce managem
[% user %]
[% END %]
[% IF conf.wwsympa_url -%]
[%|loc%]Managing bouncing subscribers:[%END%] [% 'reviewbouncing' | url_abs([list.name]) %]
[% END -%]
......@@ -126,4 +126,6 @@ X-Loop: [% conf.email %]@[% domain %]
-----------==========================================-----------
[% IF conf.wwsympa_url -%]
[%|loc(conf.wwsympa_url)%]For further information, check the mailing list web site %1[%END%]
[% END -%]
......@@ -2,12 +2,16 @@
Subject: [% FILTER qencode %][%|loc(list.name)%]resubscription to %1[%END%][%END%]
[%|loc(list.name,domain,user.email)%]You have been subscriber of list %1@%2 with email %3 for 1 year or more.[%END%]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[% "${conf.email}@${domain}" | mailtourl({subject => "sub ${list.name}"}) %]
[%|loc%]Everything about this list: [%END%][% 'info' | url_abs([list.name]) %]
[%|loc%]Unsubscription:[%END%]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[% IF conf.wwsympa_url -%]
[%|loc%]Everything about this list: [%END ~%]
[% 'info' | url_abs([list.name]) %]
[%|loc%]Unsubscription:[%END%] [%""~%]
[% 'signoff' | url_abs([list.name]) %]
[% ELSE -%]
[%|loc%]Information about this list: [%END ~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "info ${list.name}"}) %]
[%|loc%]Unsubscription:[%END%] [%""~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "sig ${list.name} ${user.email}"}) %]
[% END -%]
......@@ -3,12 +3,16 @@ From: [% fromlist %]
Subject: [% FILTER qencode %][%|loc(list.name)%]resubscription to %1[%END%][%END%]
[%|loc(list.name,domain,user.email)%]You have been subscriber of list %1@%2 with email %3 for 1 year or more.[%END%]
[% | mailtourl({subject => "sub ${list.name}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[% "${conf.email}@${domain}" | mailtourl({subject => "sub ${list.name}"}) %]
[%|loc%]Everything about this list: [%END%][% 'info' | url_abs([list.name]) %]
[%|loc%]Unsubscription:[%END%]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[% IF conf.wwsympa_url -%]
[%|loc%]Everything about this list: [%END ~%]
[% 'info' | url_abs([list.name]) %]
[%|loc%]Unsubscription:[%END%] [%""~%]
[% 'signoff' | url_abs([list.name]) %]
[% ELSE -%]
[%|loc%]Information about this list: [%END ~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "info ${list.name}"}) %]
[%|loc%]Unsubscription:[%END%] [%""~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "sig ${list.name} ${user.email}"}) %]
[% END -%]
......@@ -6,15 +6,13 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Invitation to join list %1[%END%
[%|loc(list.subject)%]This list is about %1, so you are probably concerned.[%END%]
[%|loc%]To subscribe, click the following URL:[%END%]
[% IF user_interfaces.size() == 1 && user_interfaces.0 == 'mail' -%]
[% | mailtourl({subject => "AUTH ${keyauth} ${cmd}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[% IF conf.wwsympa_url -%]
[% 'auth' | url_abs([keyauth,'subscribe',list.name],{email=>user.email}) %]
[%~ ELSE -%]
[% "${conf.email}@${domain}" | mailtourl({subject => "AUTH ${keyauth} ${cmd}"}) %]
[%|loc(conf.email,domain)%]Or send a message to %1@%2 with the following subject:[%END%]
AUTH [% keyauth %] [% cmd %]
[%- ELSE -%]
[% 'auth' | url_abs([keyauth,'subscribe'],{email=>user.email}) %]
[%- END %]
[%~ END -%]
[%|loc%]If you don't want to subscribe just ignore this message.[%END%]
......@@ -3,8 +3,10 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]%1 mailing list creation[%END%][
[%|loc(list.name,domain)%]%1@%2 mailing list has been activated by listmaster.[%END%]
[% IF conf.wwsympa_url -%]
[%|loc%]homepage[%END%]
[% 'info' | url_abs([list.name]) %]
[%|loc(list.name)%]%1 admin page[%END%]
[% 'admin' | url_abs([list.name]) %]
[% END -%]
......@@ -6,6 +6,7 @@ Subject: [% FILTER qencode %][%|loc%]Your message has been rejected[%END%][%END%
[%|loc(subject)%](Subject of your mail: %1)[%END%]
[% IF conf.wwsympa_url -%]
[%|loc(list.name)%]Check %1 list usage:[%END%]
[% 'info' | url_abs([list.name]) %]
[% END -%]
......@@ -6,10 +6,14 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Reminder of your subscription to
[%|loc%]It is important to us to not send mail to people that don't want to receive it. If you do not want to be on this mailing list, please follow the instructions below to remove yourself.[%END%]
[%|loc%]List information: [%END%][% 'info' | url_abs([list.name]) %]
[% IF subscriber.included != 1 %]
[%|loc%]To unsubscribe:[%END%]
[% | mailtourl({subject => "sig ${list.name} ${user.email}"}) ~%]
[% conf.email %]@[% domain %]
[%~ END %]
[%END%]
[% IF conf.wwsympa_url -%]
[%|loc%]List information: [%END ~%]
[% 'info' | url_abs([list.name]) %]
[%|loc%]To unsubscribe:[%END%] [%""~%]
[% 'signoff' | url_abs([list.name]) %]
[% ELSE -%]
[%|loc%]List information: [%END ~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "info ${list.name}"}) %]
[%|loc%]To unsubscribe:[%END%] [%""~%]
[% "${conf.email}@${domain}" | mailtourl({subject => "sig ${list.name} ${user.email}"}) %]
[% END -%]
......@@ -33,7 +33,7 @@ Subject: [% FILTER qencode %]AUTH [%keyauth%] [%cmd%][%END%]
[%- END -%]
[% IF user_interfaces.size() == 1 and user_interfaces.0 == 'mail' -%]
[% IF not conf.wwsympa_url -%]
[% sympa = BLOCK %][% conf.email %]@[% domain %][%END -%]
[%|loc(sympa,"AUTH ${keyauth} ${cmd}") %]If you want this action to be taken, please
......
......@@ -31,8 +31,10 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Management of list %1[%END%][%EN
[%|loc(delegator,list.name,domain)%]You have been delegated the responsability of list moderator by %1 for list %2@%3.[%END%]
[% END %]
[% IF conf.wwsympa_url -%]
[%|loc%]The list homepage:[%END%] [% 'info' | url_abs([list.name]) %]
[%|loc%]Owner and moderator guide:[%END%] [% 'help/admin' | url_abs %]
[% END -%]
[% ELSIF type == 'ticket_to_family_signoff' -%]
Subject: [% FILTER qencode %][%|loc(family)%]Unsubscribing from family %1[%END%][%END%]
......
......@@ -10,6 +10,7 @@ Subject: [% FILTER qencode %][%|loc(list.name)%]Welcome to list %1[%END%][%END%]
[% CATCH %]
[% END %]
[% IF conf.wwsympa_url -%]
[%|loc%]The list homepage:[%END%] [% 'info' | url_abs([list.name]) %]
[%|loc%]General informations about mailing lists:[%END%] [% 'help/introduction' | url_abs %]
[% END -%]
......@@ -8,5 +8,7 @@ Subject: %2[%END%]
[%|loc(user.email)%]It was not possible to send you the message because the mailing list manager was unable to access your personal certificate (email %1).[%END%]
[%|loc(conf.email,domain)%]Please, in order to receive future encrypted messages send a signed message to %1@%2.[%END%]
[% IF conf.wwsympa_url -%]
[%|loc%]Information about this list:[%END%]
[% 'info' | url_abs([list.name]) %]
[% END -%]
......@@ -16,10 +16,45 @@
[% IF subaction == 'vhosts' %]
<h2>[%|loc%]Virtual Robots[%END%]</h2> <br />
[% IF robots %]
[%|loc%]The following virtual robots are running on this server:[%END%]
<ul>
[% FOREACH vr = robots %]<li><a href="[% vr.value.wwsympa_url %]/serveradmin">[% vr.key %]</a> - <i>[%|loc%]Sympa URL:[%END%]</i> <b>[% vr.value.wwsympa_url %]</b> - <i>[%|loc%]Mail domain:[%END%]</i> <b>[% vr.key %]</b> - <i>[%|loc%]Listmaster(s):[%END%]</i> <b>[% FOREACH admin = vr.value.listmaster %][% admin %] [% END %]</b></li>[% END %]
</ul>
<p>
[%|loc%]The following virtual robots are running on this server:[%END%]
</p>
[% FOREACH vr = robots %]
<h4>
[% IF vr.value.wwsympa_url ~%]
<a href="[% vr.value.wwsympa_url %]/serveradmin">
[% vr.value.title || vr.key %]
</a>
[%~ ELSE ~%]
[% vr.value.title || vr.key %]
[%~ END %]
</h4>
<ul>
<li>
<i>[%|loc%]Mail domain:[%END%]</i>
<b>[% vr.key %]</b>
</li>
[% IF vr.value.wwsympa_url ~%]
<li>
<i>[%|loc%]Sympa URL:[%END%]</i>
<b>[% vr.value.wwsympa_url %]</b>
</li>
[%~ END %]
<li>
<i>[%|loc%]Listmaster(s):[%END%]</i>
[% FOREACH admin = vr.value.listmasters ~%]
[% UNLESS loop.first ~%]
[% UNLESS loop.last ~%]
[%|loc%], [%END%]
[%~ ELSE ~%]
[%|loc%], and [%END%]
[%~ END %]
[%~ END ~%]
<b>[% admin %]</b>
[%~ END %]
</li>
</ul>
[% END %]
[% ELSE %]
<p>[%|loc%]No Virtual Robot defined on this server[%END%]</p>
[% END %]
......
......@@ -16989,8 +16989,11 @@ sub get_server_details {
my $r = $_;
( $r => {
(host => $r), # Compat.<6.2.32
( listmasters =>
[Sympa::get_listmasters_email($r)]
),
map { ($_ => Conf::get_robot_conf($r, $_)) }
qw(listmaster wwsympa_url)
qw(listmaster title wwsympa_url)
}
)
} @robots
......
......@@ -1971,9 +1971,6 @@ sub _infer_robot_parameter_values {
if not defined $param->{'config_hash'}{'domain'}
and defined $param->{'config_hash'}{'host'};
$param->{'config_hash'}{'wwsympa_url'} ||= sprintf 'http://%s/sympa',
$param->{'config_hash'}{'domain'};
$param->{'config_hash'}{'static_content_url'} ||=
$Conf{'static_content_url'};
$param->{'config_hash'}{'static_content_path'} ||=
......
......@@ -501,7 +501,7 @@ sub html_store {
$yyyy,
$mm,
Conf::get_robot_conf($list->{'domain'}, 'arc_path'),
Conf::get_robot_conf($list->{'domain'}, 'wwsympa_url'),
(Conf::get_robot_conf($list->{'domain'}, 'wwsympa_url') || ''),
$tag
),
'-umask' => $Conf::Conf{'umask'}
......@@ -669,7 +669,7 @@ sub html_rebuild {
$yyyy,
$mm,
Conf::get_robot_conf($robot_id, 'arc_path'),
Conf::get_robot_conf($robot_id, 'wwsympa_url'),
(Conf::get_robot_conf($robot_id, 'wwsympa_url') || ''),
$tag
),
'-umask' => $Conf::Conf{'umask'},
......
......@@ -1249,10 +1249,11 @@ our @params = (
# Basic configuration
{ 'name' => 'wwsympa_url',
'sample' => 'http://web.example.org/sympa',
'sample' => 'https://web.example.org/sympa',
'gettext_id' => 'URL prefix of web interface',
'vhost' => '1',
'file' => 'sympa.conf',
'optional' => '1',
'edit' => '1',
'gettext_comment' =>
'This is used to construct URLs of web interface.',
......
......@@ -1831,6 +1831,34 @@ sub upgrade {
}
}
# GH #330: wwsympa_url would be optional. http://domain/sympa is
# assigned to robot.conf for compatibility.
if (lower_version($previous_version, '6.2.33b.2')) {
my @robot_ids = Sympa::List::get_robots();
foreach my $robot_id (@robot_ids) {
next if $robot_id eq $Conf::Conf{'domain'}; # Primary domain
my $config_file =
sprintf '%s/%s/robot.conf', $Conf::Conf{'etc'}, $robot_id;
my $ifh;
next unless open $ifh, '<', $config_file;
my ($parameter) = grep {/\Awwsympa_url\s+\S+/} <$ifh>;
close $ifh;
next if $parameter;
$log->syslog('info', 'Updating wwsympa_url for %s', $robot_id);
my $ofh;
unless (open $ofh, '>>', $config_file) {
$log->syslog('err', 'Cannot write to %s: %m', $config_file);
next;
}
printf $ofh "\n\n# Added by upgrade from %s\n", $previous_version;
printf $ofh "wwsympa_url\thttp://%s/sympa\n", $robot_id;
close $ofh;
}
}
return 1;
}
......
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