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.

problem using smtp via a script...

Discussion in 'E-mail Discussions' started by 4u123, Jul 27, 2006.

  1. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    Scenario...

    Customer has a script that sends mail - script asks him to enter his smtp details for sending mail. So he uses the details from one of the addresses he created in cpanel.

    The mail from his script is not being delivered. Message in the log says...


    Rejected RCPT <test@hisotherdomain.org>: server.hostname [server.ip] is currently not permitted to relay through this server. Perhaps you have not logged into the pop/imap server in the last 30 minutes or do not have SMTP Authentication turned on in your email client.

    The IP in the error is the actual server IP he's trying to send from. The server is not relaying for itself ?

    Any ideas ?
     
  2. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    What use is antirelayd ? If I remove it - will smtp authentication still be required ? As far as I care, as long as the users authenticate correctly they should be allowed to send mail - whats the point in making them pop the server first ?
     
  3. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    A user will be authenticated to send mail if they either use standard SMTP authentication or POP the server beforehand.

    There's only one error message, the one you're seeing, to cover both scenarions.

    The user doesn't need to POP the server before sending - they can use standard SMTP authentication.

    Therefore your user is generating this error due to either:

    1) Them not entering their details correctly
    2) The script not working properly

    When trying to send mail, does the script try to connect directly to localhost on port 25? Or does it try to connect to an IP or domain name?
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yup, authentication is automatically allowed. However, as webignition points out, it's best to use localhost as the SMTP server, otherwise authentication is done by checking the sending domain in /etc/localdomains.

    You should also check that you do not have the WHM > Tweak Security > SMTP Tweak enabled which will block connections to port 25 except from exim, root or mailman.

    Better yet, they should really use the sendmail binary to avoid all these problems, i.e. /usr/sbin/sendmail instead of performing direct port 25 communication which is generally a bad idea.
     
  5. 4u123

    4u123 Well-Known Member
    PartnerNOC

    Joined:
    Jan 2, 2006
    Messages:
    765
    Likes Received:
    1
    Trophy Points:
    18
    I do have the smtp tweak enabled but the option to allow connections form localhost is ticked - I thought that would allow it.

    I'll get them to use a sendmail script instead.
     
Loading...

Share This Page