elsif (/^From:\s*(.*)/) {
$simple->{'from'} = $1;
}
+ elsif (/^Charset:\s*(\S+)/) {
+ $simple->{'charset'} = $1;
+ }
else {
push(@lines, $_);
}
if ($simple->{'from'}) {
&print_tempfile(AUTO, "From: $simple->{'from'}\n");
}
+if ($simple->{'charset'}) {
+ &print_tempfile(AUTO, "Charset: $simple->{'charset'}\n");
+ }
&print_tempfile(AUTO, $simple->{'autotext'});
&close_tempfile(AUTO);
}
"<td>".&ui_date_input($etm[3], $etm[4], $etm[5],
"dend", "mend", "yend")." ".
&date_chooser_button("dend", "mend", "yend")."</td> </tr>\n".
+ "<tr> <td><b>$text{'index_charset'}</b></td> ".
+ "<td>".&ui_opt_textbox("charset", $r->{'charset'}, 20,
+ $text{'default'}." (iso-8859-1)")."</td> </tr>\n".
"</table>",
undef, \@tds);
&ui_textarea("reply", $filter->{'reply'}->{'autotext'}, 5, 80,
undef, $dis));
+# Character set
+print &ui_table_row($text{'auto_charset'},
+ &ui_opt_textbox("charset", $filter->{'reply'}->{'charset'}, 20,
+ $text{'default'}." (iso-8859-1)"));
+
# Period
if (!$config{'reply_force'}) {
$r = $filter->{'reply'};
index_mins=minutes
index_astart=Don't send autoreply before
index_aend=Don't send autoreply after
+index_charset=Autoreply message character set
index_nowebmin=This module is only for use in Usermin. If it is visible in Webmin, the theme you are using is incomplete.
edit_title1=Create Filter
save_enewfolder3=A folder with the same name already exists
save_estart=Invalid autoreply start date
save_eend=Invalid autoreply end date
+save_echarset=Missing or invalid autoreply character set
delete_err=Failed to delete filters
delete_enone=None selected
auto_header=Automatic email reply options
auto_enabled=Automatic response enabled?
auto_reply=Reply message
+auto_charset=Message character set
auto_period=Minimum interval between replies
auto_err=Failed to save automatic reply
delete($filter->{'reply'}->{'autoreply_'.$p});
}
}
+ # Save character set
+ if ($in{'charset_def'}) {
+ delete($filter->{'reply'}->{'charset'});
+ }
+ else {
+ $in{'charset'} =~ /^[a-z0-9\.\-\_]+$/i ||
+ error($text{'save_echarset'});
+ $filter->{'reply'}->{'charset'} = $in{'charset'};
+ }
}
elsif ($in{'amode'} == 7) {
# Create a new folder for saving (always in Maildir format)
"$user_module_config_directory/replies";
}
+ # Save character set
+ if ($in{'charset_def'}) {
+ delete($filter->{'reply'}->{'charset'});
+ }
+ else {
+ $in{'charset'} =~ /^[a-z0-9\.\-\_]+$/i ||
+ error($text{'save_echarset'});
+ $filter->{'reply'}->{'charset'} = $in{'charset'};
+ }
+
if ($old) {
&modify_filter($filter);
}
# Work out the content type and encoding
$type = $rbody =~ /<html[^>]*>|<body[^>]*>/i ? "text/html" : "text/plain";
+$cs = $rheader{'Charset'};
+delete($rheader{'Charset'});
if ($rbody =~ /[\177-\377]/) {
# High-ascii
$enc = "quoted-printable";
$encrbody = "ed_encode($rbody);
- $type .= "; charset=iso-8859-1";
+ $type .= "; charset=".($cs || "iso-8859-1");
}
else {
$enc = undef;
$encrbody = $rbody;
+ $type .= "; charset=$cs" if ($cs);
}
# run sendmail and feed it the reply