SMTP host doesn't work

Hello,

When I set a SMTP host in the Webui conf, it seems that mails still use localhost to relay:

nms01 sendmail[29258]: w19DLYZD029258: [email protected], [email protected] (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30335, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (w19DLYYo029259 Message accepted for delivery)

So it uses the external SMTP for my domain at the end.

my validate.php

====================================

Component Version
LibreNMS 1.36-52-g1188b53
DB Schema 235
PHP 7.0.22-0ubuntu0.16.04.1
MySQL 10.0.33-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Database connection successful
[OK] Database schema correct
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX] You can fix this with ./scripts/github-remove
Modified Files:
includes/functions.php
[FAIL] You need to run this script as root or librenms
[FAIL] We have found some files that are owned by a different user than librenms, this will stop you updating automatically and / or rrd files being updated causing graphs to fail.
[FIX] chown -R librenms:librenms /opt/librenms
Files:
/opt/librenms/config.bak

my validate launched as root :slight_smile:

Component Version
LibreNMS 1.36-52-g1188b53
DB Schema 235
PHP 7.0.22-0ubuntu0.16.04.1
MySQL 10.0.33-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Database connection successful
[OK] Database schema correct
[WARN] Your local git contains modified files, this could prevent automatic updates.
[FIX] You can fix this with ./scripts/github-remove
Modified Files:
includes/functions.php

You should fix that warning first, seems you have a modified file.

Hello,

After fixing the warning,the validate.php is now OK but same problem with smtp host setting.

Still using localhost as a relay.

Does anybody had this issue ?

====================================

Component Version
LibreNMS 1.36-64-g561846a
DB Schema 235
PHP 7.0.22-0ubuntu0.16.04.1
MySQL 10.0.33-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Database connection successful
[OK] Database schema correct

Now post your settings so we can see what you are doing.

I just installed sendmail and put email_smtp_host mymxrelay.mydomain.com in global settings.

We need to see your full mail transport settings. Feel free to post a screenshot.

Tested with mail, sendmail and smtp but doesnt change.

Your original message says you’re using smtp but you have mail set.

Hello,

In this screenshot yes but i tested the tree options :

No matter what mail delivery selected the mail is still relayed with “relay=[127.0.0.1]”.

I can send more infos about settings if needed.

Can’t say much more. You’re current settings and your original post show this mail is being delivered by sendmail and was accepted for delivery. So as far as we’re concerned, this is working.

Coming at this from a different direction - I configured Postfix on my LibreNMS box…

Why? Simply because its used for several monitoring type applications all of which can send email alerts, so if/when the SMTP smarthost is changed then I only have to change one destination.

To prevent relaying, it’s only listening on localhost/127.0.0.1/::1

Hello,

Yes, the mail was accepted for delivery by my external mx relay, I don’t want that.

Let me clarify :

I need to send mail via an internal mx relay I specified in the webui conf (in SMTP Host section).

But, as we can see in the logs (relay=[127.0.0.1]) it uses localhost as relay, not the one I specified.

OK, problem solved, thanks for your help.

Looks like sendmail was the problem, I removed it and installed postfix as satellite, configured my internal relay in the postfix conf.

As the “SMTP Host” field in the Email transport section does not really work with some configurations, it could be safer to specify in the official doc something like "works only with **** "

I’ve not come across any situation yet where it doesn’t work.

It does work with sendmail - just configuring Sendmail is more finicky (& much less forgiving of misconfiguration) than Postfix is