This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
#1
PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
We have several accounts that are using PHPMailer. For some reason when the script sends mail, it is sending it as ROOT USER <root@localhost.sentora-domain.com>, for server security the actual domain has been redacted. 

The script allows users to enter SMTP details for authentication to send the email, however the emails appear to be only sent by SendMail and by SMTP which is what the script requests. 

There are no error messages in the PHP Script and the same scripts are working perfectly fine on other servers that run SendMail and Postfix.

I'm not sure why in the actual headers it's using localhost, which is not normally something I've seen. So I'm thinking this may be a bug or a misconfiguration during install, because it appears to be doing it on all of the Sentora installs we have.

The main issue is that no matter what is done, the email is always arriving as from "Root User" regardless of what is specified in any PHP scripts. So the email system or Sentora are overwriting the headers and replacing them with their own. Which is a problem because not all customers want to send emails from Root User, they'll want to send them from the scripts, forms, etc, that they want to use.


The script has been rewritten and changed several times attempting to get the correct information displayed and the correct SMTP configuration used. But Postfix or Sentora refuse to actually pass that information on to the receiving server (in this case Gmail). I've looked through the configuration for both and don't see anything that could be causing this to happen. I figured this community would know best what exactly is going on and how to correct it.

================
Email headers 
================
Date: Sat, 10 Feb 2018 01:16:43 -0500
To: Customer Name <customer@customerdomain.com>
From: Root User <root@localhost.sentora-domain.com>
Subject: THIS IS A TEST EMAIL
Message-ID: <a26cb298dfc320b4e2ba484bd585121e@customerdomain.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2 (http://code.google.com/a/apache-extras.org/p/phpmailer/)
Sender:
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="b1_a26cb298dfc320b4e2ba484bd585121e"


* sentora-domain.com is a stand in for the FQDN of the Sentora server.
* customerdomain.com is a stand in for the customer's FQDN.
Brad J Trammell
Director of Operations
SparkRack.com

Send me a message on Discord:
bradjtrammell#8210
Thanks given by:
#2
RE: PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
Have you looked in the Sentora postfix configuration?

I believe it's somewhere in
Code:
/etc/sentora/configs/postfix
Take a look in the file "main.cf". I think it specifies the FQDN?
MrKaKisen - Website - GitHub
Thanks given by:
#3
RE: PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
Thank you for your reply. Yes I have checked the main.cf configuration file and all instances of localhost.$mydomain were changed to $mydomain prior to this incident.

I've also noticed its not actually sending it from the sender domain (using my examples above, customer@customerdomain.com), instead it will send the email from root@localhost.sentora-domain.com, regardless of the steps taken to try to change it.
Brad J Trammell
Director of Operations
SparkRack.com

Send me a message on Discord:
bradjtrammell#8210
Thanks given by:
#4
RE: PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
This issue is solved. Essentially Postfix was using the servers domain instead of the customers, it was a problem in an included file. I've since corrected it and the customer has had no issue since then.
Brad J Trammell
Director of Operations
SparkRack.com

Send me a message on Discord:
bradjtrammell#8210
Thanks given by:
#5
RE: PHP Scripts are using SendMail instead of SMTP... - Server Wide Issue
(02-14-2018, 12:42 PM)sparkrack Wrote: This issue is solved. Essentially Postfix was using the servers domain instead of the customers, it was a problem in an included file. I've since corrected it and the customer has had no issue since then.

Great! If you could, can you post which file and setting in case somebody else has this issue? Thanks!
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
Server Crash rsthomas 3 8 ,110 05-18-2022, 09:26 AM
Last Post: Nigel
Server Vs. Workstation zHostingSolutions 4 9 ,327 09-14-2021, 06:30 AM
Last Post: sparkrack
Old issue on Daily Backup iraqiboy90 24 120 ,474 12-26-2020, 12:48 PM
Last Post: conglynina

Forum Jump:


Users browsing this thread: 1 Guest(s)