Disable address validation when sending mail remotely using SMTP

noyearzero

Member
Oct 28, 2008
8
0
51
So i'm using the PEAR Mail package to send email from PHP scripts. It sends them fine when the script is running on the actual server were the mail server resides. But I also have a test server on a different Dedicated IP. When the scripts run on the test server and try to send mail from the live server's mail server it attempts to verify the From address against actual email accounts. This is good to prevent spam and whatnot. But my scripts will be sending email from fake addresses like '[email protected]'.

Is there any way to add my test servers IP to a list of approved IP's so it won't attempt the validation when using SMTP?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
So, you are basically trying to relay from the test server to the live server? If you are trying to allow that IP to relay, you need to do the following on the live machine (the one you are relaying through for the test script):

Code:
touch /etc/alwaysrelay
echo "IP#" >> /etc/alwaysrelay
Edit the IP# with the IP number for the test machine.

Since the /etc/relayhosts file can't be manually edited as antirelayd will wipe any changes you make to it, you can add the file mentioned above called /etc/alwaysrelay and add the IP into that file for to allow that IP to relay through your server. The /usr/sbin/antirelayd script will look for that file and then add the IP into relayhosts file for you.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Did you do the steps I indicated? It sounds like you are trying to relay and the steps I mentioned allow one machine to relay through another to send emails.
 

noyearzero

Member
Oct 28, 2008
8
0
51
I'll look into that Tristan. I'm not sure about all the technical jargon, but if a 'relay' is when you use a mail server on an external server to send email then yes. I guess it would be the same thing as when I use Thunderbird to send an email.
 

noyearzero

Member
Oct 28, 2008
8
0
51
I'm finally able to give this a try. Is it possible to make this a 'per account' thing? I tried putting a file in /home/account/etc/alwaysrelay didn't seem to work.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
It isn't possible to make it a per account setting. The steps I noted need to be followed exactly as indicated for this to function if this is a relay setup. You would simply need to put the file onto the live machine and put the IP for the test machine into that /etc/alwaysrelay file. You may then also want to restart exim.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please try opening up a ticket with us so we can check the settings for that script along with your Exim Configuration area's settings.