Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ossec-maild Issue with V2.9.0 #1122

Closed
JohnMelody opened this issue May 12, 2017 · 13 comments
Closed

ossec-maild Issue with V2.9.0 #1122

JohnMelody opened this issue May 12, 2017 · 13 comments

Comments

@JohnMelody
Copy link

After a yum upgrade from 2.8.3 to 2.9.0 on Centos 6 - the email alerts do not work

The mail configuration uses "localhost" as the smtp server (postfix) and it was working perfectly prior to the upgrade, I get the following error:

2017/05/12 16:29:42 ossec-maild(1223): ERROR: Error Sending email to localhost (smtp server)

The problem seems to be in the ossec-maild executable. I replaced the V2.9.0 with the old V2.8.3 executable and everything works as before. So I have a V2.9.0 installation with the maild at V2.8.3

Has anyone else had a problem with this? Is there further configuration required for maild on V2.9.0 or is there something else we need to configure on the smtp server?

John.

@JohnMelody JohnMelody changed the title maild Issue maild Issue with V2.9.0 May 12, 2017
@JohnMelody JohnMelody changed the title maild Issue with V2.9.0 ossec-maild Issue with V2.9.0 May 12, 2017
@aquerubin
Copy link
Contributor

aquerubin commented May 12, 2017 via email

@ghtux
Copy link

ghtux commented May 21, 2017

Same problem here. localhost exists in /etc/hosts and postfix can send mails.
ERROR: Error Sending email to 127.0.0.1 (smtp server)
Tried localhost too

@schneider3005
Copy link

Same problem here. Seems that sender and recipient address from config is not considered any more.
ossec tries to send to no-reply@example.com:
to=no-reply@example.com, relay=none, delay=80340, delays=80280/0.02/60/0, dsn=4.4.1, status=deferred (connect to example.com[2606:2800:220:1:248:1893:25c8:1946]:25: Connection timed out). Issue also exists in version 2.9.1

@jknockaert
Copy link
Contributor

After upgrading to 2.9.1 it couldn't send email to localhost. After changing
<smtp_server>localhost</smtp_server>
to
<smtp_server>127.0.0.1</smtp_server>
it worked again.

@sterndata
Copy link

I tried added "127.0.0.1 localhost" to /var/ossec/etc/hosts but that didn't work. jknockaert's advice worked for me. (Thanks!)

@ghtux
Copy link

ghtux commented Nov 5, 2017

After updating to 2.9.2 with "127.0.0.1" mail alerts are working fine.

@jmeile
Copy link

jmeile commented Feb 21, 2018

Thanks Antonio, changing "localhost" by "127.0.0.1" fixed the problem. I also rechecked and localhost is defined in my /etc/hosts file as:
127.0.0.1 my_host.my_domain.com localhost
::1 localhost ip6-localhost ip6-loopback

So, I don't really now why ossec doesn't accept "localhost". Anyway, it is fixed with: "127.0.0.1"

By the way: I don't have the file: "/var/ossec/etc/hosts". I only have: "/etc/hosts"

Best regards
Josef

@ddpbsd
Copy link
Member

ddpbsd commented Feb 21, 2018

Did you copy the changes into /var/ossec/etc/hosts? maild runs chrooted to /var/ossec

@jmeile
Copy link

jmeile commented Feb 22, 2018

Dear Dan

Ok, that make sense. I copied the host file into /var/ossec/etc/hosts and now it works.

Thanks
Josef

@AlexMRuch
Copy link

Updating to <smtp_server>127.0.0.1</smtp_server> also worked for me! Thanks so much!

@Jamalc0m
Copy link

Jamalc0m commented Nov 18, 2018

After a yum upgrade from 2.8.3 to 2.9.0 on Centos 6 - the email alerts do not work

The mail configuration uses "localhost" as the smtp server (postfix) and it was working perfectly prior to the upgrade, I get the following error:

2017/05/12 16:29:42 ossec-maild(1223): ERROR: Error Sending email to localhost (smtp server)

The problem seems to be in the ossec-maild executable. I replaced the V2.9.0 with the old V2.8.3 executable and everything works as before. So I have a V2.9.0 installation with the maild at V2.8.3

Has anyone else had a problem with this? Is there further configuration required for maild on V2.9.0 or is there something else we need to configure on the smtp server?

John.

which file you have replaced ??? @JohnMelody

@ddpbsd
Copy link
Member

ddpbsd commented Nov 19, 2018

@Jamalc0m Probably ossec-maild, but copying /etc/resolv.conf to /var/ossec/etc might also help.

@aquerubin
Copy link
Contributor

Another way to address this problem without having to copy /etc/hosts to /var/ossec/etc is to add a period after 'localhost' in ossec.conf.

<smtp_server>localhost.</smtp_server>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants