The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable address validation when sending mail remotely using SMTP

Discussion in 'E-mail Discussions' started by noyearzero, May 13, 2011.

  1. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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 'no-reply@domain.com'.

    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?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,481
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hmm, check your settings from the cPanel account > Email Authentication, page. Not sure if thats helpful at all or not.
     
  3. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Already checked into that. I added the test servers IP there with no difference
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,481
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Whats happens when you disable those setting completely?
     
  6. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    It was disabled to start off with. I turned it on and added the IP in.
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  8. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  9. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  11. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I added the IP to the file, but that alone didn't work... I'll try restarting exim
     
  12. noyearzero

    noyearzero Member

    Joined:
    Oct 28, 2008
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    hmmm no luck still
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
Loading...

Share This Page