Trace php actions

Discussion in 'Server Operation' started by Wiesemarc, Oct 12, 2006.

  1. Wiesemarc

    Wiesemarc New Member

    How can i trace if a use uses php for sending mails? Or how many resources the scripts are using ?

    Hope some can help with this issue.

    Marc
     
  2. falko

    falko Super Moderator Howtoforge Staff

    You can check the email header if you find some hints there.

    I don't think it's possible to find out how many resources a PHP script is using. :confused:
     
  3. Wiesemarc

    Wiesemarc New Member

    The headers, Okay

    Well know about that, But can't find anything there whats why im asking in here.

    Would also like to know if any one on this forum/site have some one spamming with your domain (ofcause not from your server or something). I have one who do it, and don't know how to stop it beside closing my mx record.
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Sometimes you find something like
    Code:
    X-Mailer: PHP
    or something similar in the headers. But of course you can set the headers with PHP's mail function, therefore it can look totally different.

    There's nothing you can do about it. A weakness of the SMTP protocol is that you can set the sender address to whatever you like. So if I decide that I want to send from one of your email addresses, there's nothing you can do about it.
    But many mail servers try to check the domains for SPF records, and if the mail server where the mail originates from is not in the SPF record of that domain, then the mail is blocked. So you should set SPF records for your domains.
     
  5. Wiesemarc

    Wiesemarc New Member

    Okay..

    But how do i set the SPF and where ? Don't know much about mailservers, and have used the guide from this site to setup my mailserver.
    Maybe i should find a guide for sendmail-sql i think it can store mails send from anywhere on the server.

    Just got at mail from a user and in the header there is this info, what tells me all about it. X-PHP-Script: "domain and path" for x.x.x.x

    Also about php, do anyone know a guide to setup suphp, cgi, users and ftp (w. mysql) like that? Or some there know a way to block users from viewing anything outside their folder (not talking chmod) ?

    Regards
    Marc Wiese

    People In here Are Cool, They Answer Your Questions :D
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You do it on the authoritative name server for your domain. To create the proper SPF record, you can use this wizard: http://www.openspf.org/wizard.html

    Have a look here: http://www.howtoforge.com/apache2_suphp_php4_php5

    You can use PHP Safe Mode for it: http://de.php.net/features.safe-mode
     
  7. Wiesemarc

    Wiesemarc New Member

    Nice guides..

    This: http://www.howtoforge.com/apache2_suphp_php4_php5
    Only descripes php? Also wanted something with cgi/perl. The reason is that right not i can't allow cgi, perl, ruby or anything else than php with a lot of classes disabled. Also uses open_base_dir and some other thing. But it only apply to php so it doesn't work super.
     
  8. falko

    falko Super Moderator Howtoforge Staff

Share This Page