Issue with mail but only when sent by pve-ha

jeanlau

Well-Known Member
May 2, 2014
53
11
48
Hello everyone,

I'm not used to post on the forum so excuse me in advance if I'm not in the good place, and also excuse me for my English (French).

OK so, I have issues with mails sent by ha mechanism, I show you :

"This is the mail system at host pve1.toto.fr.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<admin@toto.fr> (expanded from <root@localhost>): host
smtp.toto.fr[X.X.X.X] said: 553 5.1.8 Sender address
<root@pve1> domain does not exist (in reply to MAIL FROM command)

Objet: SUCCEED: fencing: acknowledged - got agent lock for node xxxx
blabla blabla blabla

"

And this is the only case the problem occur.

It's weird, it is like the ha daemon sent mail in a different way than the whole system... because sending a mail from the command line works perfectly, or for example the mechanism to inform about upgrades, vzdump backup status too...
These other systems send mails from the server are using,
Sender address : <root@pve1.toto.fr>

Of course, I have tried "dpkg-reconfigure postfix" and nor as internet site nor satellite (I have another mail server configured to relay pve1 mails) changes my problem and the problem is the very same. (incomplete sender address, miss the fqdn )

I tried to configured everything ok :

"
Server is allowed to send mail in the DNS domain zone (SPF)
The reverse are all set ok
root@pve1 /etc/postfix # hostname -f
pve1.toto.fr
root@pve1 /etc/postfix # domainname
toto.fr
root@pve1 /etc/postfix # hostname --fqdn
pve1.toto.fr
root@pve1 /etc/postfix # hostname --domain
toto.fr
root@pve1 /etc/postfix # grep myhostname /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
myhostname = pve1.toto.fr
root@pve1 /etc/postfix # grep myorigin /etc/postfix/main.cf
myorigin = /etc/mailname
root@pve1 /etc/postfix # cat /etc/mailname
pve1.toto.fr
"

But when the mail is sent by the ha daemon, it always uses only root@pve1 as you can see...

I have search the web about an explanation/solution but found nothing.
Is there someone here that could have a hint about what's going on ?

Let me know if you need anything more to understand the problem...
Thank you for reading me and for maybe your help

Best regards,

PS My system in PVE4.4, up2date, it is an OVH install (maybe something from their install but not even think to ask them, they are not going to help here) and I have 3 server in my cluster and the problem is the same for the three !
 
thank you for trying to help me :)

root@pve1 ~ # cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 213.186.33.99
search toto.fr

Maybe I could add "domain toto.fr" but I dont know if it would change anything ?
 
Last edited:
ok thank you, I was becoming crazy... do you have an idea the delay before this kind of bug get corrected ? just by curiosity
 
Yes I imagine, and maybe, until that, I could change the file myself ? in the bug report you say :
We should not use $self->nodename() here. in the file /pve-ha-manager/src/PVE/HA/Env/PVE2.pm, I opened the file and found the code line you posted.
Do you think I can correct it myself or is it a bad idea ?
If you think I can, could you tell what should be instead of $self->nodename() ?
Sorry, I suppose I could find myself but I'm not good at perl language, I only know a little bash...
 
do you think that would be correct :

sub sendmail {

my ($self, $subject, $text) = @_;

my $hostname = `hostname -f`

my $mailfrom = 'root@' . '$hostname';

my $mailto = 'root@localhost';


PVE::Tools::sendmail($mailto, $subject, $text, undef, $mailfrom);

}
 
OK it seem not being the good code... I wanted to try but after the change, a simple "qm list" do not work anymore...
Could someone post a working code for this section :

sub sendmail {

my ($self, $subject, $text) = @_;


my $mailfrom = 'root@' . $self->nodename();

my $mailto = 'root@localhost';


PVE::Tools::sendmail($mailto, $subject, $text, undef, $mailfrom);

}

Thank you in advance for your help
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!