mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Merge branch 'master' of git@github.com:webmin/webmin
This commit is contained in:
@@ -20,6 +20,6 @@ if ($in{'owner_a'}) {
|
||||
$email = { 'enabled' => 1,
|
||||
'name' => $in{'email_a'},
|
||||
'values' => [ "|$wrapper_path majordomo" ] };
|
||||
&foreign_call("sendmail", "create_alias", $email, $aliases_files);
|
||||
&foreign_call($aliases_module, "create_alias", $email, $aliases_files);
|
||||
&redirect("");
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ require './majordomo-lib.pl';
|
||||
%access = &get_module_acl();
|
||||
$access{'create'} || &error($text{'create_ecannot'});
|
||||
&ui_print_header(undef, $text{'create_title'}, "");
|
||||
$bcss=' style="display: box; float: left; padding: 10px;"';
|
||||
|
||||
print <<EOF;
|
||||
<form action=create_list.cgi method=post>
|
||||
@@ -38,14 +39,16 @@ print <<EOF;
|
||||
|
||||
<tr> <td><b>$text{'create_archive'}</b></td>
|
||||
<td><select name=archive>
|
||||
<option value='' selected>$text{'no'}</option>
|
||||
<option value=Y>$text{'create_archiveyear'}</option>
|
||||
<option value=''>$text{'no'}</option>
|
||||
<option value=Y selected>$text{'create_archiveyear'}</option>
|
||||
<option value=M>$text{'create_archivemonth'}</option>
|
||||
<option value=D>$text{'create_archiveday'}</option>
|
||||
</select></td> </tr>
|
||||
|
||||
</table></td></tr></table>
|
||||
<input type=submit value="$text{'create'}"></form>
|
||||
<div $bcss>
|
||||
EOF
|
||||
print &ui_submit($text{'create'})."</form></div>";
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
@@ -44,15 +44,26 @@ $in{'footer'} =~ s/\r//g;
|
||||
&set_permissions("$ldir/$in{'name'}");
|
||||
&unlock_file("$ldir/$in{'name'}");
|
||||
|
||||
|
||||
|
||||
# Have majordomo create the new config file, by fooling the wrapper
|
||||
# into thinking it has received an email with a resend command
|
||||
#$lfile = "$ldir/$in{'name'}.config";
|
||||
#$cmd = "$wrapper_program_path resend -l $in{'name'} nobody";
|
||||
#open(WRAPPER, "|$cmd nobody >/dev/null 2>&1");
|
||||
#print WRAPPER "config $in{'name'} $in{'password'}\n\n";
|
||||
#close(WRAPPER);
|
||||
#&additional_log("exec", $cmd);
|
||||
#sleep(3);
|
||||
|
||||
# use provided template, majordomo provides onyl minimal needed config
|
||||
$lfile = "$ldir/$in{'name'}.config";
|
||||
$cmd = "$wrapper_program_path resend -l $in{'name'} nobody";
|
||||
open(WRAPPER, "|$cmd nobody >/dev/null 2>&1");
|
||||
print WRAPPER "config $in{'name'} $in{'password'}\n\n";
|
||||
close(WRAPPER);
|
||||
&additional_log("exec", $cmd);
|
||||
sleep(3);
|
||||
# copy listdir template to list.info, fallback copy from template.dist
|
||||
if ( ! -f "template/list.config") { ©_source_dest("template/list.config.dist","template/list.config"); }
|
||||
if ( ! -f "template/list.config") { &error("No default template found: template/list.config"); }
|
||||
if ( ! -f "$lfile") { ©_source_dest("template/list.config", $lfile); }
|
||||
if ( ! -f "$lfile") { &error("Could not create list config: $file"); }
|
||||
&set_permissions("$lfile");
|
||||
|
||||
# create the .info file
|
||||
&lock_file($lfile);
|
||||
@@ -72,7 +83,11 @@ if (&find_value("date_info", $list) eq "yes") {
|
||||
# create the archive directory
|
||||
$adir = &perl_var_replace(&find_value("filedir", $conf), $conf);
|
||||
$aext = &perl_var_replace(&find_value("filedir_suffix", $conf), $conf);
|
||||
if ($adir && $aext) {
|
||||
if( -d "$adir" && $adir =~ /\/archive$/) {
|
||||
# filedir exist and ends with /archive
|
||||
$arch = "$adir/$in{'name'}";
|
||||
}
|
||||
elsif ($adir && $aext) {
|
||||
&lock_file("$adir/$in{'name'}$aext");
|
||||
mkdir("$adir/$in{'name'}$aext", 0755);
|
||||
&set_permissions("$adir/$in{'name'}$aext");
|
||||
|
||||
@@ -83,23 +83,37 @@ if ($in{'confirm'}) {
|
||||
&redirect("");
|
||||
}
|
||||
else {
|
||||
# css for table
|
||||
local $tcss='style="width: 98%; margin: 1% !important;"';
|
||||
local $dcss='style="text-align: right; vertical-align: middle; padding: 0.3em 1em !important; min_heigth: 5em;"';
|
||||
local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 0.3em !important;"';
|
||||
|
||||
# ask the user if he is sure
|
||||
&ui_print_header(undef, $text{'delete_title'}."<br><font color=\"red\"><em>".&html_escape($name)."</em></font>", "");
|
||||
print "<b>",&text('delete_rusure', "<font color=\"red\"><em>".&html_escape($name)."</em></font>"),
|
||||
&ui_print_header(undef, $text{'delete_title'}.": ".&html_escape($in{'name'}), "");
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td>".&text('delete_rusure', "<font color=\"red\">".&html_escape($name)."</font>"),"</td>";
|
||||
print "<tr $cb> <td><table $tcss>\n";
|
||||
"</b><br>\n";
|
||||
print "<ul>\n";
|
||||
foreach $f (@files) {
|
||||
print "<tt>",&html_escape($f),"</tt><br>\n";
|
||||
}
|
||||
print "</ul>\n";
|
||||
print "<b>$text{'delete_aliases'}</b><br>\n";
|
||||
print "</td> </tr>\n";
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td>".&text('delete_aliases'),"</td>";
|
||||
print "<tr $cb> <td><table $tcss>\n";
|
||||
print "<ul>\n";
|
||||
foreach $a (@daliases) {
|
||||
print "<tt>",&html_escape("$a->{'name'}: $a->{'value'}"),
|
||||
"</tt><br>\n";
|
||||
}
|
||||
print "</ul>\n";
|
||||
print "</td> </tr>\n";
|
||||
print "</table></td></tr></table>\n";
|
||||
local $bcss=' style="padding: 10px; text-align: center;"';
|
||||
local $name_link="?name=".&urlize($in{'name'});
|
||||
print "<div $bcss><form action=\"delete_list.cgi".$name_link."&confirm=1\" method=\"post\">",
|
||||
&ui_submit($text{'delete_ok'})."</form></div>\n";
|
||||
&ui_print_footer("edit_list.cgi?name=$name", $text{'edit_return'});
|
||||
|
||||
@@ -40,7 +40,8 @@ print <<EOF;
|
||||
<input type=radio name=mode value=1> $lines</td> </tr>
|
||||
|
||||
</table></td></tr></table>
|
||||
<input type=submit value="$text{'create'}"></form>
|
||||
EOF
|
||||
print &ui_submit($text{'create'}),"</form>";
|
||||
EOF
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ print "</tr>\n";
|
||||
print "<tr> <td colspan=4>$text{'access_taboo'}</td> </tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -30,6 +30,6 @@ print &multi_input("message_headers", $text{'head_headers'}, $conf);
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
@@ -45,7 +45,7 @@ close(INTRO);
|
||||
print "</textarea></td> </tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -11,11 +11,9 @@ $list = &get_list($in{'name'}, &get_config());
|
||||
$conf = &get_list_config($list->{'config'});
|
||||
local $moderate= (&find_value('moderate', $conf) =~ /no/) ? "" : " (".$text{'index_moderated'}.")";
|
||||
|
||||
&ui_print_header(undef, $text{'edit_title'}."<br><em>".&html_escape($in{'name'})."</em><tt>$moderate</tt>", "");
|
||||
&ui_print_header( $text{'misc_header'}, $text{'edit_title'}.": ".&html_escape($in{'name'})."<tt>$moderate</tt>", "");
|
||||
|
||||
@links = ( "edit_subs.cgi",
|
||||
"edit_mesg.cgi", "edit_access.cgi",
|
||||
"edit_misc.cgi" );
|
||||
@links = ( "edit_subs.cgi", "edit_access.cgi", "edit_misc.cgi" );
|
||||
foreach $a (&foreign_call($aliases_module, "list_aliases",
|
||||
&get_aliases_file())) {
|
||||
if ($a->{'name'} =~ /-digestify$/i &&
|
||||
@@ -39,8 +37,19 @@ print $otherbut;
|
||||
|
||||
# css for table
|
||||
local $tcss='style="width: 98%; margin: 1% !important;"';
|
||||
local $dcss='style="text-align: right; vertical-align: top; padding: 5px !important; min_heigth: 5em;"';
|
||||
local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 5px !important;"';
|
||||
local $dcss='style="text-align: right; vertical-align: middle; padding: 0.3em 1em !important; min_heigth: 5em;"';
|
||||
local $vcss='style="width: 40%; border: 1px solid lightgrey; padding: 0.3em !important;"';
|
||||
|
||||
# list optionen
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>$text{'mesg_header'}</b></td>";
|
||||
print "<td width=10% nowrap><form action=\"edit_mesg.cgi".$name_link."\" method=\"post\">",
|
||||
&ui_submit($text{'modify'}),"</form>\n</tr>\n";
|
||||
print "<tr $cb> <td colspan=2><table $tcss>\n";
|
||||
|
||||
print "<tr><td $dcss><b>".$text{'mesg_reply'}."</b></td><td $vcss>",&find_value("reply_to", $conf)."</td></tr>\n";
|
||||
print "<tr><td $dcss><b>".$text{'mesg_subject'}."</b></td><td $vcss>".&find_value("subject_prefix", $conf)."</td></tr>\n";
|
||||
print "</table></td></tr></table>\n";
|
||||
|
||||
# title, descritpion, info
|
||||
print "<table border width=100%>\n";
|
||||
@@ -111,4 +120,7 @@ print "<div $bcss><form action=\"delete_list.cgi".$name_link."\" method=\"post\"
|
||||
print "<div style=\"padding-top: 20px;\">$text{'edit_deletemsg'}</div>\n";
|
||||
|
||||
&ui_print_footer("", $text{'index_return'});
|
||||
|
||||
print "<script>",
|
||||
"document.querySelectorAll('.btn.btn-default').forEach(function(button) {",
|
||||
" button.innerHTML=button.innerHTML.replace(/^/,'<i class=\"fa fa-fw fa-pencil-square-o\"></i> ');});",
|
||||
"</script>";
|
||||
|
||||
@@ -10,12 +10,16 @@ $list = &get_list($in{'name'}, &get_config());
|
||||
$desc = &text('edit_for', "<tt>".&html_escape($in{'name'})."</tt>");
|
||||
&ui_print_header($desc, $text{'members_title'}, "");
|
||||
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><b>";
|
||||
if ($access{'edit'}) {
|
||||
print "$text{'members_desc'}<br>\n";
|
||||
print "$text{'members_desc'}\n";
|
||||
}
|
||||
else {
|
||||
print "$text{'members_rodesc'}<br>\n";
|
||||
print "$text{'members_rodesc'}\n";
|
||||
}
|
||||
print "</b></td> </tr>\n";
|
||||
print "<tr $cb> <td><table width=100%>\n";
|
||||
print "<form action=save_members.cgi method=post enctype=multipart/form-data>\n";
|
||||
print "<input type=hidden name=name value='$in{'name'}'>\n";
|
||||
print "<textarea rows=15 cols=60 name=members>\n";
|
||||
@@ -26,28 +30,26 @@ while(<MEMS>) {
|
||||
close(MEMS);
|
||||
print "</textarea>\n";
|
||||
if (!$access{'edit'}) {
|
||||
print "<p>\n";
|
||||
print "<p></form></table>\n";
|
||||
}
|
||||
else {
|
||||
print "<br><input type=submit value=\"$text{'save'}\" name=update>\n";
|
||||
print &ui_hr();
|
||||
print "<br> <input class=\"btn btn-success\" type=submit value=\"$text{'save'}\" name=update>\n";
|
||||
|
||||
print "<table>\n";
|
||||
print "<table width=100%>\n";
|
||||
print "<tr> <td><b>$text{'members_sub'}</b></td>\n";
|
||||
print "<td><input name=addr_a size=40> ",
|
||||
"<input type=submit name=add ",
|
||||
"value=\"$text{'members_add'}\"></td> </tr>\n";
|
||||
&ui_submit($text{'members_add'}, "add"),"</td> </tr>\n";
|
||||
|
||||
print "<tr> <td><b>$text{'members_unsub'}</b></td>\n";
|
||||
print "<td><input name=addr_r size=40> ",
|
||||
"<input type=submit name=remove ",
|
||||
"value=\"$text{'members_rem'}\"></td> </tr>\n";
|
||||
print "</table></form>\n";
|
||||
print "<td width=500><input name=addr_r size=40> ",
|
||||
&ui_submit($text{'delete'}, "remove"), "</td> </tr>\n";
|
||||
print "</table></form></table>\n";
|
||||
|
||||
print &ui_hr();
|
||||
print "<form action=save_auto.cgi>\n";
|
||||
print "<input type=hidden name=name value='$in{'name'}'>\n";
|
||||
print "<table>\n";
|
||||
print "<table border width=100%>\n";
|
||||
print "<tr $tb> <td><small><strong>$text{'misc_header'}<strong></small></td> </tr>\n";
|
||||
print "<tr $cba><table width=100%>\n";
|
||||
$sync = $config{"sync_$in{'name'}"};
|
||||
print "<tr> <td><b>$text{'members_sync'}</b></td> <td>\n";
|
||||
printf "<input type=radio name=sync value=1 %s> %s\n",
|
||||
@@ -57,11 +59,9 @@ else {
|
||||
|
||||
$shost = $config{"shost_$in{'name'}"};
|
||||
print "<tr><td><b>$text{'members_dom'}</b></td>\n";
|
||||
print "<td><input name=shost size=40 value='$shost'>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></td> </tr>\n";
|
||||
|
||||
print "</table></form>\n";
|
||||
print "<td width=500><input name=shost size=40 value='$shost'>\n";
|
||||
print &ui_submit($text{'save'}),"</td> </tr>\n";
|
||||
print "</table></td></tr></table></form>\n";
|
||||
}
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ print &opt_input("maxlength", $text{'mesg_maxlength'}, $conf,
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ print &choice_input("date_intro", $text{'misc_intro'},
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ print "<td><b>$text{'subs_approval'}</b></td>\n";
|
||||
print "<td><input name=approval size=20 value='$approval'></td> </tr>\n";
|
||||
|
||||
print "</table></td></tr></table>\n";
|
||||
print "<input type=submit value=\"$text{'save'}\"></form>\n";
|
||||
print &ui_submit($text{'save'}),"</form>\n";
|
||||
|
||||
&ui_print_footer("edit_list.cgi?name=$in{'name'}", $text{'edit_return'});
|
||||
|
||||
|
||||
@@ -135,12 +135,16 @@ if (@lists) {
|
||||
push(@cols, "","<a href=edit_list.cgi?name=$l><img src=images/smallicon.gif></a>");
|
||||
push(@cols, "<a href=edit_list.cgi?name=$l>". &html_escape($l) ."</a>" );
|
||||
open(INFO, $list->{'info'});
|
||||
push(@cols, "<em>".<INFO>."</em>" ." <em><a href=edit_info.cgi?name=$l><span>edit</span></a></em>");
|
||||
local $info=<INFO>;
|
||||
$info=<INFO> if ( $info =~ !/^\[Last updated on:/);
|
||||
push(@cols, "<em>".$info."</em>" ." <em><a href=edit_info.cgi?name=$l><span>edit</span></a></em>");
|
||||
close(INFO);
|
||||
#push(@cols, $l . "-owner");
|
||||
push(@cols, "<em>". &find_value('reply_to', $conf) ."</em>");
|
||||
push(@cols, "<center><em>". $text{&find_value('moderate', $conf)} ."</em></center>");
|
||||
push(@cols, "<center>".`cat $list->{'members'} | wc -l` . " <em><a href=edit_members.cgi?name=$l><span>edit</span></a></em></center>");
|
||||
push(@cols, "<em>". &find_value('reply_to', $conf) .
|
||||
" <em><a href=edit_mesg.cgi?name=$l><span>edit</span></a></em>");
|
||||
push(@cols, "<center><em>". $text{&find_value('moderate', $conf)} .
|
||||
"</em>" ." <em><a href=edit_subs.cgi?name=$l><span>edit</span></a></em><center>");
|
||||
push(@cols, "<center>".`cat $list->{'members'} | wc -l` .
|
||||
" <em><a href=edit_members.cgi?name=$l><span>edit</span></a></em></center>");
|
||||
print&ui_columns_row(\@cols, \@tds);
|
||||
}
|
||||
} else {
|
||||
@@ -156,10 +160,14 @@ if ($access{'global'}) {
|
||||
&ui_print_footer("/", $text{'index'});
|
||||
print "<script>",
|
||||
"f__lnk_t_btn(['/majordomo/', '/majordomo/index.cgi'], 'table tbody td',",
|
||||
" 'a[href*=\"edit_info.cgi?\"], a[href*=\"edit_members.cgi?\"]',",
|
||||
" 'btn btn-transparent btn-xs vertical-align-top margined-top-2', 'fa-edit');",
|
||||
" 'a[href*=\"edit_info.cgi?\"], a[href*=\"edit_members.cgi?\"], a[href*=\"edit_subs.cgi?\"],",
|
||||
" a[href*=\"edit_mesg.cgi?\"]',",
|
||||
" 'btn btn-transparent btn-xs vertical-align-top margined-top-2', 'fa-edit');",
|
||||
"document.querySelectorAll('tbody td .btn.btn-transparent').forEach(function(button) {",
|
||||
" button.innerHTML=button.innerHTML.replace(/<\\/i>.*edit/,'');});",
|
||||
"document.querySelectorAll('.btn.btn-default').forEach(function(button) {",
|
||||
" button.className += \" btn-success\";",
|
||||
" button.innerHTML=button.innerHTML.replace(/^/,'<i class=\"fa fa-fw fa-plus-circle\"></i> ');});",
|
||||
"</script>",
|
||||
"<style>.btn.btn-transparent { padding: 0 !important; color: grey;}</style>";
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ $list{'members'} = "$ldir/$_[0]";
|
||||
$list{'config'} = "$ldir/$_[0].config";
|
||||
$list{'info'} = "$ldir/$_[0].info";
|
||||
$list{'intro'} = "$ldir/$_[0].intro";
|
||||
$list{'owner'} = "$ldir/$_[0].owner";
|
||||
return \%list;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,34 +34,50 @@ if ($in{'update'}) {
|
||||
&webmin_log("members", undef, $in{'name'});
|
||||
}
|
||||
elsif ($in{'add'}) {
|
||||
# call majordomo to subscribe an address
|
||||
# call send_mail to subscribe an address
|
||||
$pass || &error($text{'members_esub'});
|
||||
$in{'addr_a'} =~ /^(\S+)\@(\S+)\.(\S+)$/ ||
|
||||
&error($text{'members_esubaddr'});
|
||||
open(WRAPPER, "|$wrapper_path majordomo");
|
||||
printf WRAPPER "From: %s\n\n",
|
||||
$owner ? $owner : $in{'addr_a'};
|
||||
print WRAPPER "approve $pass subscribe $in{'name'} $in{'addr_a'}\n\n";
|
||||
close(WRAPPER);
|
||||
sleep(1);
|
||||
$mail=sprintf("From: %s\nTo: %s\nSubject: subcribe\n\n",
|
||||
$owner ? $owner : $in{'addr_a'}, "majordomo");
|
||||
$mail .= "approve $pass subscribe $in{'name'} $in{'addr_a'}\n\n";
|
||||
&send_mail($mail);
|
||||
&unlock_file($list->{'members'});
|
||||
&webmin_log("subscribe", undef, $in{'name'},
|
||||
{ 'addr' => $in{'addr_a'} });
|
||||
}
|
||||
elsif ($in{'remove'}) {
|
||||
# call majordomo to unsubscribe an address
|
||||
# call send_mail to unsubscribe an address
|
||||
$pass || &error($text{'members_eunsub'});
|
||||
$in{'addr_r'} =~ /^(\S+)\@(\S+)\.(\S+)$/ ||
|
||||
&error($text{'members_eunsubaddr'});
|
||||
open(WRAPPER, "|$wrapper_path majordomo");
|
||||
printf WRAPPER "From: %s\n\n",
|
||||
$owner ? $owner : $in{'addr_r'};
|
||||
print WRAPPER "approve $pass unsubscribe $in{'name'} $in{'addr_r'}\n\n";
|
||||
close(WRAPPER);
|
||||
sleep(1);
|
||||
$mail=sprintf("From: %s\nTo: %s\nSubject: unsubcribe\n\n",
|
||||
$owner ? $owner : $in{'addr_a'}, "majordomo");
|
||||
$mail .= "approve $pass unsubscribe $in{'name'} $in{'addr_r'}\n\n";
|
||||
&send_mail($mail);
|
||||
&unlock_file($list->{'members'});
|
||||
&webmin_log("unsubscribe", undef, $in{'name'},
|
||||
{ 'addr' => $in{'addr_r'} });
|
||||
}
|
||||
&redirect("edit_list.cgi?name=$in{'name'}");
|
||||
|
||||
sub send_mail
|
||||
{
|
||||
local $sent,$mail=$_[0];
|
||||
if (!$sent) {
|
||||
# Try to send the email by calling sendmail -t
|
||||
%sconfig = &foreign_config("sendmail");
|
||||
$sendmail = $sconfig{'sendmail_path'} ? $sconfig{'sendmail_path'}
|
||||
: &has_command("sendmail");
|
||||
if (-x $sendmail && open(MAIL, "| $sendmail -t")) {
|
||||
print MAIL $mail;
|
||||
if (close(MAIL)) {
|
||||
$sent = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$sent) {
|
||||
&error($text{'global_esendmail'}, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,15 +32,15 @@ foreach $a (@aliases) {
|
||||
$ownerlist = $a if (lc($a->{'name'}) eq lc("owner-$in{'name'}"));
|
||||
$approval = $a if (lc($a->{'name'}) eq lc("$in{'name'}-approval"));
|
||||
}
|
||||
&foreign_call('sendmail', 'modify_alias', $listowner,
|
||||
&foreign_call($aliases_module, 'modify_alias', $listowner,
|
||||
{ 'name' => "$in{'name'}-owner",
|
||||
'values' => [ $in{'owner'} ],
|
||||
'enabled' => 1 }) if ($listowner);
|
||||
&foreign_call('sendmail', 'modify_alias', $ownerlist,
|
||||
&foreign_call($aliases_module, 'modify_alias', $ownerlist,
|
||||
{ 'name' => "owner-$in{'name'}",
|
||||
'values' => [ $in{'owner'} ],
|
||||
'enabled' => 1 }) if ($ownerlist);
|
||||
&foreign_call('sendmail', 'modify_alias', $approval,
|
||||
&foreign_call($aliases_module, 'modify_alias', $approval,
|
||||
{ 'name' => "$in{'name'}-approval",
|
||||
'values' => [ $in{'approval'} ],
|
||||
'enabled' => 1 }) if ($approval);
|
||||
|
||||
388
majordomo/template/list.config.dist
Normal file
388
majordomo/template/list.config.dist
Normal file
@@ -0,0 +1,388 @@
|
||||
# The DEFAULT webmin configuration file for a majordomo mailing list.
|
||||
# Comments start with the first # on a line, and continue to the end
|
||||
# of the line. There is no way to escape the # character. The file
|
||||
# uses either a key = value for simple (i.e. a single) values, or uses
|
||||
# a here document
|
||||
# key << END
|
||||
# value 1
|
||||
# value 2
|
||||
# [ more values 1 per line]
|
||||
# END
|
||||
# for installing multiple values in array types. Note that the here
|
||||
# document delimiter (END in the example above) must be the same at the end
|
||||
# of the list of entries as it is after the << characters.
|
||||
# Within a here document, the # sign is NOT a comment character.
|
||||
# A blank line is allowed only as the last line in the here document.
|
||||
#
|
||||
# The values can have multiple forms:
|
||||
#
|
||||
# absolute_dir -- A root anchored (i.e begins with a /) directory
|
||||
# absolute_file -- A root anchored (i.e begins with a /) file
|
||||
# bool -- choose from: yes, no, y, n
|
||||
# enum -- One of a list of possible values
|
||||
# integer -- an integer (string made up of the digits 0-9,
|
||||
# no decimal point)
|
||||
# float -- a floating point number with decimal point.
|
||||
# regexp -- A perl style regular expression with
|
||||
# leading and trailing /'s.
|
||||
# restrict_post -- a series of space or : separated file names in which
|
||||
# to look up the senders address
|
||||
# (restrict-post should go away to be replaced by an
|
||||
# array of files)
|
||||
# string -- any text up until a \n stripped of
|
||||
# leading and trailing whitespace
|
||||
# word -- any text with no embedded whitespace
|
||||
#
|
||||
# A blank value is also accepted, and will undefine the corresponding keyword.
|
||||
# The character Control-A may not be used in the file.
|
||||
#
|
||||
# A trailing _array on any of the above types means that that keyword
|
||||
# will allow more than one value.
|
||||
#
|
||||
# Within a here document for a string_array, the '-' sign takes on a special
|
||||
# significance.
|
||||
#
|
||||
# To embed a blank line in the here document, put a '-' as the first
|
||||
# and ONLY character on the line.
|
||||
#
|
||||
# To preserve whitespace at the beginning of a line, put a - on the
|
||||
# line before the whitespace to be preserved
|
||||
#
|
||||
# To put a literal '-' at the beginning of a line, double it.
|
||||
#
|
||||
#
|
||||
# The default if the keyword is not supplied is given in ()'s while the
|
||||
# type of value is given in [], the subsystem the keyword is used in is
|
||||
# listed in <>'s. (undef) as default value means that the keyword is not
|
||||
# defined or used.
|
||||
|
||||
# admin_passwd [word] (admin.admin) <majordomo>
|
||||
# The password for handling administrative tasks on the list.
|
||||
admin_passwd =
|
||||
|
||||
# administrivia [bool] (yes) <resend>
|
||||
# Look for administrative requests (e.g. subscribe/unsubscribe) and
|
||||
# forward them to the list maintainer instead of the list.
|
||||
administrivia = no
|
||||
|
||||
# advertise [regexp_array] (undef) <majordomo>
|
||||
# If the requestor email address matches one of these regexps, then
|
||||
# the list will be listed in the output of a lists command. Failure
|
||||
# to match any regexp excludes the list from the output. The
|
||||
# regexps under noadvertise override these regexps.
|
||||
advertise << END
|
||||
|
||||
END
|
||||
|
||||
# announcements [bool] (yes) <majordomo>
|
||||
# If set to yes, comings and goings to the list will be sent to the
|
||||
# list owner. These SUBSCRIBE/UNSUBSCRIBE event announcements are
|
||||
# informational only (no action is required), although it is highly
|
||||
# recommended that they be monitored to watch for list abuse.
|
||||
announcements = yes
|
||||
|
||||
# approve_passwd [word] (admin.pass) <resend>
|
||||
# Password to be used in the approved header to allow posting to
|
||||
# moderated list, or to bypass resend checks.
|
||||
approve_passwd =
|
||||
|
||||
# archive_dir [absolute_dir] (undef) <majordomo>
|
||||
# The directory where the mailing list archive is kept. This item
|
||||
# does not currently work. Leave it blank.
|
||||
archive_dir =
|
||||
|
||||
# comments [string_array] (undef) <config>
|
||||
# Comment string that will be retained across config file rewrites.
|
||||
comments << END
|
||||
|
||||
END
|
||||
|
||||
# date_info [bool] (yes) <majordomo>
|
||||
# Put the last updated date for the info file at the top of the
|
||||
# info file rather than having it appended with an info command.
|
||||
# This is useful if the file is being looked at by some means other
|
||||
# than majordomo (e.g. finger).
|
||||
date_info = yes
|
||||
|
||||
# date_intro [bool] (yes) <majordomo>
|
||||
# Put the last updated date for the intro file at the top of the
|
||||
# intro file rather than having it appended with an intro command.
|
||||
# This is useful if the file is being looked at by some means other
|
||||
# than majordomo (e.g. finger).
|
||||
date_intro = yes
|
||||
|
||||
# debug [bool] (no) <resend>
|
||||
# Don't actually forward message, just go though the motions.
|
||||
debug = no
|
||||
|
||||
# description [string] (undef) <majordomo>
|
||||
# Used as description for mailing list when replying to the lists
|
||||
# command. There is no quoting mechanism, and there is only room
|
||||
# for 50 or so characters.
|
||||
description =
|
||||
|
||||
# digest_archive [absolute_dir] (undef) <digest>
|
||||
# The directory where the digest archive is kept. This item does
|
||||
# not currently work. Leave it blank.
|
||||
digest_archive =
|
||||
|
||||
# digest_issue [integer] (1) <digest>
|
||||
# The issue number of the next issue
|
||||
digest_issue = 1
|
||||
|
||||
# digest_maxdays [integer] (undef) <digest>
|
||||
# automatically generate a new digest when the age of the oldest
|
||||
# article in the queue exceeds this number of days.
|
||||
digest_maxdays =
|
||||
|
||||
# digest_maxlines [integer] (undef) <digest>
|
||||
# automatically generate a new digest when the size of the digest
|
||||
# exceeds this number of lines.
|
||||
digest_maxlines =
|
||||
|
||||
# digest_name [string] (admin) <digest>
|
||||
# The subject line for the digest. This string has the volume and
|
||||
# issue appended to it.
|
||||
digest_name =
|
||||
|
||||
# digest_rm_footer [word] (undef) <digest>
|
||||
# The value is the name of the list that applies the header and
|
||||
# footers to the messages that are received by digest. This allows
|
||||
# the list supplied headers and footers to be stripped before the
|
||||
# messages are included in the digest.
|
||||
digest_rm_footer =
|
||||
|
||||
# digest_rm_fronter [word] (undef) <digest>
|
||||
# Works just like digest_rm_footer, except it removes the front
|
||||
# material.
|
||||
digest_rm_fronter =
|
||||
|
||||
# digest_volume [integer] (1) <digest>
|
||||
# The current volume number
|
||||
digest_volume = 1
|
||||
|
||||
# digest_work_dir [absolute_dir] (undef) <digest>
|
||||
# The directory used as scratch space for digest. Don't change
|
||||
# this unless you know what you are doing
|
||||
digest_work_dir =
|
||||
|
||||
# get_access [enum] (list) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
get_access = list
|
||||
|
||||
# index_access [enum] (open) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
index_access = open
|
||||
|
||||
# info_access [enum] (open) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
info_access = open
|
||||
|
||||
# intro_access [enum] (list) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
intro_access = list
|
||||
|
||||
# maxlength [integer] (40000) <resend,digest>
|
||||
# The maximum size of an unapproved message in characters. When
|
||||
# used with digest, a new digest will be automatically generated if
|
||||
# the size of the digest exceeds this number of characters.
|
||||
maxlength = 40000
|
||||
|
||||
# message_footer [string_array] (undef) <resend,digest>
|
||||
# Text to be appended at the end of all messages posted to the
|
||||
# list. The text is expanded before being used. The following
|
||||
# expansion tokens are defined: $LIST - the name of the current
|
||||
# list, $SENDER - the sender as taken from the from line, $VERSION,
|
||||
# the version of majordomo. If used in a digest, no expansion
|
||||
# tokens are provided
|
||||
message_footer << END
|
||||
|
||||
END
|
||||
|
||||
# message_fronter [string_array] (undef) <resend,digest>
|
||||
# Text to be prepended to the beginning of all messages posted to
|
||||
# the list. The text is expanded before being used. The following
|
||||
# expansion tokens are defined: $LIST - the name of the current
|
||||
# list, $SENDER - the sender as taken from the from line, $VERSION,
|
||||
# the version of majordomo. If used in a digest, only the expansion
|
||||
# token _SUBJECTS_ is available, and it expands to the list of
|
||||
# message subjects in the digest
|
||||
message_fronter << END
|
||||
|
||||
END
|
||||
|
||||
# message_headers [string_array] (undef) <resend,digest>
|
||||
# These headers will be appended to the headers of the posted
|
||||
# message. The text is expanded before being used. The following
|
||||
# expansion tokens are defined: $LIST - the name of the current
|
||||
# list, $SENDER - the sender as taken from the from line, $VERSION,
|
||||
# the version of majordomo.
|
||||
message_headers << END
|
||||
|
||||
END
|
||||
|
||||
# moderate [bool] (no) <resend>
|
||||
# If yes, all postings to the list will be bounced to the moderator
|
||||
# for approval.
|
||||
moderate = no
|
||||
|
||||
# moderator [word] (undef) <resend>
|
||||
# Address for directing posts which require approval. Such
|
||||
# approvals might include moderated mail, administrivia traps, and
|
||||
# restrict_post authorizations. If the moderator address is not
|
||||
# set, it will default to the list-approval address.
|
||||
moderator =
|
||||
|
||||
# mungedomain [bool] (no) <majordomo>
|
||||
# If set to yes, a different method is used to determine a matching
|
||||
# address. When set to yes, addresses of the form user@dom.ain.com
|
||||
# are considered equivalent to addresses of the form user@ain.com.
|
||||
# This allows a user to subscribe to a list using the domain
|
||||
# address rather than the address assigned to a particular machine
|
||||
# in the domain. This keyword affects the interpretation of
|
||||
# addresses for subscribe, unsubscribe, and all private options.
|
||||
mungedomain = no
|
||||
|
||||
# noadvertise [regexp_array] (undef) <majordomo>
|
||||
# If the requestor name matches one of these regexps, then the list
|
||||
# will not be listed in the output of a lists command. Noadvertise
|
||||
# overrides advertise.
|
||||
noadvertise << END
|
||||
|
||||
END
|
||||
|
||||
# precedence [word] (bulk) <resend,digest>
|
||||
# Put a precedence header with value <value> into the outgoing
|
||||
# message.
|
||||
precedence = bulk
|
||||
|
||||
# purge_received [bool] (no) <resend>
|
||||
# Remove all received lines before resending the message.
|
||||
purge_received = no
|
||||
|
||||
# reply_to [word] () <resend,digest>
|
||||
# Put a reply-to header with value <value> into the outgoing
|
||||
# message. If the token $SENDER is used, then the address of the
|
||||
# sender is used as the value of the reply-to header. This is the
|
||||
# value of the reply-to header for digest lists.
|
||||
reply_to =
|
||||
|
||||
# resend_host [word] (undef) <resend>
|
||||
# The host name that is appended to all address strings specified
|
||||
# for resend.
|
||||
resend_host =
|
||||
|
||||
# restrict_post [restrict_post] (undef) <resend>
|
||||
# If defined, only addresses listed in these files (colon or space
|
||||
# separated) can post to the mailing list. By default, these files
|
||||
# are relative to the lists directory. These files are also checked
|
||||
# when get_access, index_access, info_access, intro_access,
|
||||
# which_access, or who_access is set to 'list'. This is less useful
|
||||
# than it seems it should be since there is no way to create these
|
||||
# files if you do not have access to the machine running resend.
|
||||
# This mechanism will be replaced in a future version of
|
||||
# majordomo/resend.
|
||||
restrict_post =
|
||||
|
||||
# sender [word] (owner-admin) <majordomo,resend,digest>
|
||||
# The envelope and sender address for the resent mail. This string
|
||||
# has "@" and the value of resend_host appended to it to make a
|
||||
# complete address. For majordomo, it provides the sender address
|
||||
# for the welcome mail message generated as part of the subscribe
|
||||
# command.
|
||||
sender =
|
||||
|
||||
# strip [bool] (yes) <majordomo>
|
||||
# When adding address to the list, strip off all comments etc, and
|
||||
# put just the raw address in the list file. In addition to the
|
||||
# keyword, if the file <listname>.strip exists, it is the same as
|
||||
# specifying a yes value. That yes value is overridden by the value
|
||||
# of this keyword.
|
||||
strip = yes
|
||||
|
||||
# subject_prefix [word] (undef) <resend>
|
||||
# This word will be prefixed to the subject line, if it is not
|
||||
# already in the subject. The text is expanded before being used.
|
||||
# The following expansion tokens are defined: $LIST - the name of
|
||||
# the current list, $SENDER - the sender as taken from the from
|
||||
# line, $VERSION, the version of majordomo.
|
||||
subject_prefix =
|
||||
|
||||
# subscribe_policy [enum] (open+confirm) <majordomo> /open;closed
|
||||
# One of three values: open, closed, auto; plus an optional
|
||||
# modifier: '+confirm'. Open allows people to subscribe themselves
|
||||
# to the list. Auto allows anybody to subscribe anybody to the list
|
||||
# without maintainer approval. Closed requires maintainer approval
|
||||
# for all subscribe requests to the list. Adding '+confirm', ie,
|
||||
# 'open+confirm', will cause majordomo to send a reply back to the
|
||||
# subscriber which includes a authentication number which must be
|
||||
# sent back in with another subscribe command.
|
||||
subscribe_policy = open
|
||||
|
||||
# taboo_body [regexp_array] (undef) <resend>
|
||||
# If any line of the body matches one of these regexps, then the
|
||||
# message will be bounced for review.
|
||||
taboo_body << END
|
||||
|
||||
END
|
||||
|
||||
# taboo_headers [regexp_array] (undef) <resend>
|
||||
# If any of the headers matches one of these regexps, then the
|
||||
# message will be bounced for review.
|
||||
taboo_headers << END
|
||||
|
||||
END
|
||||
|
||||
# unsubscribe_policy [enum] (open) <majordomo> /open;closed;auto;op
|
||||
# One of three values: open, closed, auto; plus an optional
|
||||
# modifier: '+confirm'. Open allows people to unsubscribe
|
||||
# themselves from the list. Auto allows anybody to unsubscribe
|
||||
# anybody to the list without maintainer approval. The existence of
|
||||
# the file <listname>.auto is the same as specifying the value
|
||||
# auto. Closed requires maintainer approval for all unsubscribe
|
||||
# requests to the list. In addition to the keyword, if the file
|
||||
# <listname>.closed exists, it is the same as specifying the value
|
||||
# closed. Adding '+confirm', ie, 'auto+confirm', will cause
|
||||
# majordomo to send a reply back to the subscriber if the request
|
||||
# didn't come from the subscriber. The reply includes a
|
||||
# authentication number which must be sent back in with another
|
||||
# subscribe command. The value of this keyword overrides the value
|
||||
# supplied by any existent files.
|
||||
unsubscribe_policy = auto
|
||||
|
||||
# welcome [bool] (yes) <majordomo>
|
||||
# If set to yes, a welcome message (and optional 'intro' file) will
|
||||
# be sent to the newly subscribed user.
|
||||
welcome = yes
|
||||
|
||||
# which_access [enum] (open) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
which_access = open
|
||||
|
||||
# who_access [enum] (open) <majordomo> /open;closed;list/
|
||||
# One of three values: open, list, closed. Open allows anyone
|
||||
# access to this command and closed completely disables the command
|
||||
# for everyone. List allows only list members access, or if
|
||||
# restrict_post is defined, only the addresses in those files are
|
||||
# allowed access.
|
||||
who_access = open
|
||||
Reference in New Issue
Block a user