email problem

Discussion in 'General' started by m u r, May 16, 2006.

  1. m u r

    m u r Member

    We set up a formmail.php script to send email from a form on a site. We are able to receive mail to a hotmail account but not to an account on the mail server set up using ISPConfig. The following is the .php script we used:

    <?php

    //echo "<html><body>";
    $recipient=$_POST["recipient"];
    $subject=$_POST["subject"];
    $whofrom=$_POST["Email"];
    while (list ($key, $val) = each ($_POST)){
    $message=$message."".$key.": ".$val."\r\n";
    }
    mail ($recipient, $subject, $message,"From: ".$whofrom."\r\nReply-To: ".$whofrom."\r\n");

    //echo "Sending mail...";
    //echo "</body></html>";

    ?>
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you get any errors in the mail log?

    By the way, dont use scripts like this. It can be easily exploited by spammers to use your server as spam relay.

    Check every variable with a regular expression if they contain valid content.
     
  3. m u r

    m u r Member

    Is there a way to access the mail log remotely or to do it using ISPConfig?
     
  4. falko

    falko Super Moderator Howtoforge Staff

    You can do it with SSH. If you are on Windows, download PuTTY and connect to your server on port 22. Afterwards, you're on your server's command line as usual.
     
  5. m u r

    m u r Member

    Where do I find the mail log once I log on using SSH? How do I pull it up and see if there are errors?
     
  6. rayit

    rayit Member

    logs

    on debian:

    /var/log/mail.log

    so:
    cat /var/log/mail.log or
    pico /var/log/mail.log

    also nice is
    tail -F /var/log/mail.log
    This nice if you are testing, it shows the ongoing(new entries) updates of the file..
     
  7. m u r

    m u r Member

    I'm actually on SuSe. Do you know where it is in that?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Login with SSH, then execute:

    ls /var/log/

    you now get a list of your log files. The most common names for the mail log are:

    mail.log
    mail.info

    or just:

    mail
     
  9. falko

    falko Super Moderator Howtoforge Staff

    On SuSE the mail log is /var/log/mail.
     
  10. m u r

    m u r Member

    Thanks for all the help. I have another question: when I pull this up using pico or cat, how do I copy the text to the clipboard, so I can sift through it using Windows? Is there a simply copy and paste command? cp copies it to a specific destination, right? . . . not to a clipboard that can be pasted anywhere.

    Thanks.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    If you use putty, just mark the text part wirg your mouse cursor. Putty copies the marked text to the clipboard automatically.
     

Share This Page