[pve-devel] [PATCH ha-manager v2] fix #1347: let postfix fill in FQDN in fence mails
Philip Abernethy
p.abernethy at proxmox.com
Thu Sep 14 14:39:33 CEST 2017
Using the nodename in $mailto is not correct and can lead to mails not
forwarding in restrictive mail server configurations.
Also changes $mailfrom to 'root' instead of 'root at localhost', which
results in postfix appending the proper FQDN there, too. As a result the
Delivered-to header reads something like 'root at host.domain.tld' instead
of 'root at localhost', which is much more informational and more
consistent.
---
src/PVE/HA/Env/PVE2.pm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
index fdfadd7..8baf2d0 100644
--- a/src/PVE/HA/Env/PVE2.pm
+++ b/src/PVE/HA/Env/PVE2.pm
@@ -204,8 +204,11 @@ sub log {
sub sendmail {
my ($self, $subject, $text) = @_;
- my $mailfrom = 'root@' . $self->nodename();
- my $mailto = 'root at localhost';
+ # Leave it to postfix to append the correct hostname
+ my $mailfrom = 'root';
+ # /root/.forward makes pvemailforward redirect the
+ # mail to the address configured in the datacenter
+ my $mailto = 'root';
PVE::Tools::sendmail($mailto, $subject, $text, undef, $mailfrom);
}
--
2.11.0
More information about the pve-devel
mailing list