CactiEZ Email Alerts Sending Wrong SMTP Username

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
CellarDoor
Posts: 3
Joined: Mon Feb 15, 2016 2:38 pm

CactiEZ Email Alerts Sending Wrong SMTP Username

Post by CellarDoor »

Looking for a little direction for resolving an odd issue I'm experiencing. See version info at bottom of post.

I had e-mails alerts working until I added a PTR record for the host.

Using test email and based on packet captures, it seems that the PHP Mail function gets me the closest to success, however, SMTP and PHP Mail Function ultimately results in a 220 (SMTP) or 550 (PHP) response from the SMTP server. I'm believing the issue is with /var/www/html/plugins/settings/include/mail.php though I could be wrong. Using the php mail function, the email address being passed to the mail server is the apache user at the fqdn of the host e.g. apache@subdomain.domain.tld

I have verified that all fields in the webGUI are filled out correctly but have not been able to find where cacti passes this information to the PHP mail function. Hopefully someone can point me down the right road. FYI I do not know PHP so if this is where the issue exists then I might need additional help with that.

I did notice that the PHP uname is also the FQDN of the host as well so perhaps this is what I need to look at? But regardless I need it to pass the correct user provided for the SMTP authentication, not apache.

CactiEZ v0.7
Apache/2.2.15 (CentOS)
PHP Version 5.3.3
Cacti Version 0.8.8a
User avatar
micke2k
Cacti User
Posts: 261
Joined: Wed Feb 03, 2016 3:38 pm

Re: CactiEZ Email Alerts Sending Wrong SMTP Username

Post by micke2k »

What is you mail settings in /etc/php.ini?

What do you see in the maillog on cacti?

cat /var/log/maillog

What do you see in the maillog on the smtp server?
CellarDoor
Posts: 3
Joined: Mon Feb 15, 2016 2:38 pm

Re: CactiEZ Email Alerts Sending Wrong SMTP Username

Post by CellarDoor »

Thanks for the reply. The php.ini file has been left fairly default as have many things on the server. I believe these are variables of interest:
[mail function]
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i
mail.add_x_header = On

tail of the maillog:
Feb 20 09:08:21 cacti postfix/local[30428]: warning: biff_notify: Operation not permitted
Feb 20 09:08:21 cacti postfix/qmgr[1156]: 226CE1C1E13: removed
Feb 20 09:12:54 cacti postfix/pickup[28233]: C08E31C1E71: uid=48 from=<apache>
Feb 20 09:12:54 cacti postfix/cleanup[30989]: C08E31C1E71: message-id=<20160220151254.C08E31C1E71@myserver.mydomain.tld>
Feb 20 09:12:54 cacti postfix/qmgr[1156]: C08E31C1E71: from=<apache@myserver.mydomain.tld>, size=670, nrcpt=1 (queue active)
Feb 20 09:12:56 cacti postfix/smtp[30991]: C08E31C1E71: to=<myrecipient@mydomain.tld>, relay=mail.mydomain.tld[<my-mail-server-ip>]:25, delay=1.5, delays=0.18/0.03/1.1/0.14, dsn=5.0.0, status=bounced (host mail.mydomain.tld[<my-mail-server-ip>] said: 550-Verification failed for <apache@myserver.mydomain.tld> 550-The mail server could not deliver mail to apache@myserver.mydomain.tld. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
Feb 20 09:12:56 cacti postfix/cleanup[30989]: 35D981C1E72: message-id=<20160220151256.35D981C1E72@myserver.mydomain.tld>
Feb 20 09:12:56 cacti postfix/qmgr[1156]: 35D981C1E72: from=<>, size=3038, nrcpt=1 (queue active)
Feb 20 09:12:56 cacti postfix/bounce[30992]: C08E31C1E71: sender non-delivery notification: 35D981C1E72
Feb 20 09:12:56 cacti postfix/qmgr[1156]: C08E31C1E71: removed
Feb 20 09:12:56 cacti postfix/local[30993]: 35D981C1E72: to=<root@myserver.mydomain.tld>, orig_to=<apache@myserver.mydomain.tld>, relay=local, delay=0.15, delays=0.05/0.03/0/0.06, dsn=2.0.0, status=sent (delivered to mailbox)
Feb 20 09:12:56 cacti postfix/local[30993]: warning: biff_notify: Operation not permitted
Feb 20 09:12:56 cacti postfix/qmgr[1156]: 35D981C1E72: removed

I'll have to check with my hosting provider if I can get their maillog.
User avatar
micke2k
Cacti User
Posts: 261
Joined: Wed Feb 03, 2016 3:38 pm

Re: CactiEZ Email Alerts Sending Wrong SMTP Username

Post by micke2k »

I booted up CactiEZ and saw the same thing as you.

With PHP mail it doesnt read the from field.

With sendmail it complains about the -t option.

With SMTP it worked fine for me. But you wont see it in the maillog.

When you send with SMTP do you get any errors?

EDIT: reread your post and saw you got 220 from SMTP. This is not a error message, it indicated the server is ready to receive.

Checked you spam folder?
CellarDoor
Posts: 3
Joined: Mon Feb 15, 2016 2:38 pm

Re: CactiEZ Email Alerts Sending Wrong SMTP Username

Post by CellarDoor »

It's not in the spam folder. 220 was in the cacti test email window results along with this: We do not authorize the use of this system to transport unsolicited.

looking at the packet capture for using smtp, cacti sends HELO and then immediately FIN-ACK's, followed by 250 from the mail server which cacti then sends a RST. Mail server returns 421 lost input connections and then the connection is closed.

I'm sure this is some weird interaction with how my mail provider has things setup, and I don't have a preference of which function I use to send mail. I just want one to work. So I think if I could figure out how to get the PHP function to pass the right credentials I could get that to work. Digging to figure out why cacti is doing the FIN-ACK and RST of the connection with SMTP seems like an uphill battle.
User avatar
micke2k
Cacti User
Posts: 261
Joined: Wed Feb 03, 2016 3:38 pm

Re: CactiEZ Email Alerts Sending Wrong SMTP Username

Post by micke2k »

Alright,

I would contact the hosting provider and have them check why its blocking. Or atleast change the from email to something generic like cacti@companyname.com.

https://wordpress.org/support/topic/see ... r-for-smtp

If you want to go down the php route its in the folder plugin/settings

plugin/settings/email-test.php
plugin/settings/include/functions.php

etc

But even if you get it to work, it might still be blocked in the same way?
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests