diff --git a/mailboxes/config.info b/mailboxes/config.info
index ccc4af40a..f32744266 100644
--- a/mailboxes/config.info
+++ b/mailboxes/config.info
@@ -51,6 +51,7 @@ spam_report=Report spam using,1,sa_learn-sa-learn --spam,spamassass
line3.5=From address options,11
from_addr=From: address to use when sending email manually,3,From mailbox username
webmin_from=From: address to use when Webmin sends email,3,Default (webmin-noreply@yourhost)
+webmin_from_name=Real name to use in From: address,3,None
from_virtualmin=Get From: address from Virtualmin?,1,1-Yes,0-No
from_dom=Domain to use in From: address,3,System hostname
no_orig_ip=Include browser IP in X-Originating-IP header?,1,0-Yes,1-No
diff --git a/mailboxes/mailboxes-lib.pl b/mailboxes/mailboxes-lib.pl
index 5cd0c6c6c..98cebc09b 100755
--- a/mailboxes/mailboxes-lib.pl
+++ b/mailboxes/mailboxes-lib.pl
@@ -600,16 +600,21 @@ return &ui_link("list_mail.cgi?user=$_[0]&folder=$_[1]->{'index'}",$text{'mail_r
# Returns the address to use when sending email from a script
sub get_from_address
{
-local $host = &get_from_domain();
+my $host = &get_from_domain();
+my $rv;
if ($config{'webmin_from'} =~ /\@/) {
- return $config{'webmin_from'};
+ $rv = $config{'webmin_from'};
}
elsif (!$config{'webmin_from'}) {
- return "webmin-noreply\@$host";
+ $rv = "webmin-noreply\@$host";
}
else {
- return "$config{'webmin_from'}\@$host";
+ $rv = "$config{'webmin_from'}\@$host";
}
+if ($config{'webmin_from_name'}) {
+ $rv = "\"$config{'webmin_from_name'}\" <$rv>";
+ }
+return $rv;
}
# get_from_domain()