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.

Forcing PHP users to send email via SendMail

Discussion in 'E-mail Discussions' started by trparky, Jan 26, 2005.

  1. trparky

    trparky Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    184
    Likes Received:
    1
    Trophy Points:
    0
    Ok, we all know that CPanel implemented a way for us to detect who is sending an email via a PHP script even if it is being executed as nobody. I'm talking about the X-Source, X-Source-Args, and X-Source-Dir headers.

    Unfortunately, sometimes email that is sent via PHP sometimes is missing those headers. The only thing that I can think of is that they are bypassing SendMail which is the way that Exim is getting the data for those headers. The only way that I know of other than using SendMail is by directly connecting to SMTP using the PHP TCP/IP functions.

    Is there a way to force people to use SendMail to send an email and not bypass it without breaking a lot of scripts?
     
  2. trparky

    trparky Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    184
    Likes Received:
    1
    Trophy Points:
    0
    Any ideas?
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    WHM > Tweak Security > SMTP Tweak > Enable

    Note that this basically blocks outgoing connections on port 25 except for root and mailman. Users must therefore use the MUA (i.e. the sylinked sendmail to exim binary).

    To do this it uses iptables entries, so if you're already using a software firewall, you will need to adjust it (disable the iptables firewall, then enable the securty tweak to see what it does).
     
  4. jeroman8

    jeroman8 Well-Known Member

    Joined:
    Mar 14, 2003
    Messages:
    410
    Likes Received:
    0
    Trophy Points:
    16
    I just enabled SMTP Tweak and choose NOT to allow connections to port 25.

    I can still send mail using the SMTP server.
    I'm sending from my local computer (outlook)

    Did I miss something or shouldn't it prevent this also or is it just
    for local scripts etc ?
     
Loading...

Share This Page