+ Post New Thread
Results 1 to 12 of 12
Web Development Thread, CLEO blocking sendmail in PHP? in Coding and Web Development; I'm not great with PHP so my brother set me up with a simple email reply form which can be ...
  1. #1
    woody's Avatar
    Join Date
    Jun 2005
    Location
    Carlisle, Cumbria
    Posts
    617
    Thank Post
    3
    Thanked 17 Times in 15 Posts
    Rep Power
    22

    CLEO blocking sendmail in PHP?

    I'm not great with PHP so my brother set me up with a simple email reply form which can be filled out and it sends the content to my email address. My brother tested it on his own web server (completely seperate from CLEO network) and it works fine, I happily received the replies in my inbox.

    As soon as I put the page on our CLEO webspace, you can fill it in and it happily tells you that the reply has been sent, but I'm not getting the replies in my inbox.

    Running the PHPinfo thing from our webspace shows that 'sendmail' is enabled on the web server. I'm just wondering if they block it somewhere else. I have emailed our cleo contact about this but just thought I would ask on here to.

  2. #2

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: CLEO blocking sendmail in PHP?

    The server probably isn't configured to send mail anywhere sensible. ie, it'll just bin stuff.

  3. #3

    GrumbleDook's Avatar
    Join Date
    Jul 2005
    Location
    Gosport, Hampshire
    Posts
    9,950
    Thank Post
    1,345
    Thanked 1,797 Times in 1,116 Posts
    Blog Entries
    19
    Rep Power
    597

    Re: CLEO blocking sendmail in PHP?

    Most RBCs will not allow traffic out unless it is routed via their mail relay for filtering. This is one of the things set out by the DfES and BECTA for accrediation. Some RBCs give schools the option to opt out of the filters (or in the case of EMBC they give schools access to turn filtering to the lowest level and say 'on your own head be it'.)

  4. #4
    woody's Avatar
    Join Date
    Jun 2005
    Location
    Carlisle, Cumbria
    Posts
    617
    Thank Post
    3
    Thanked 17 Times in 15 Posts
    Rep Power
    22

    Re: CLEO blocking sendmail in PHP?

    Ok, I'll wait and see what CLEO says on the matter. But they must have a solution for a simple web reply form.

  5. #5

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,804
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: CLEO blocking sendmail in PHP?

    Conversly, the system may be listed in a spam blacklist. Thus spam filtering at the recievers end is discarding it.

  6. #6
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    Re: CLEO blocking sendmail in PHP?

    I set up a simple form the other week in PHP and its working fine.

  7. #7
    woody's Avatar
    Join Date
    Jun 2005
    Location
    Carlisle, Cumbria
    Posts
    617
    Thank Post
    3
    Thanked 17 Times in 15 Posts
    Rep Power
    22

    Re: CLEO blocking sendmail in PHP?

    Chris,

    does it use sendmail then?

  8. #8
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    Re: CLEO blocking sendmail in PHP?

    Its just using the PHP function so whatever the server is set to use:


    Code:
    <?php
    
    {
    	$Address = "sendto@thisemail.com";
    	$Subject = "the subject";
    	$Name = $_REQUEST['name'];
    	$Content = $_REQUEST['content'];
    	$Redirect = "../index.php?page=emailthankyou";
    	$message = "Name: $Name\r\nComments: $Content\r\n ";
    	mail ($Address, $Subject, $message);
    	header("Location: $Redirect");
    exit;
    }
    ?>

  9. #9
    woody's Avatar
    Join Date
    Jun 2005
    Location
    Carlisle, Cumbria
    Posts
    617
    Thank Post
    3
    Thanked 17 Times in 15 Posts
    Rep Power
    22

    Re: CLEO blocking sendmail in PHP?

    Mmmmm

    Well, something is blocking it. Here is my code:

    Code:
    <?php
    						if ($_POST['formsent'] == "1") {
    						if ((($_POST['name'] != "" && ($_POST['email'] != "" && ($_POST['story'] != ""))))) {
    						mail("mwood@nctc.cumbria.sch.uk","Story from website","".$_POST['story']."\n\nFrom:".$_POST['name']."\n\nE-Mail address: ".$_POST['email']."\n\nYear of leaving: ".$_POST['year']."","From: ".$_POST['email']."");
    						?>
    						
    Thank you. Your story has been sent. Click <a href=/>here</a> to return to the homepage...
    
    
    						<?php
    						} else {
    						?>
    						
    You have not entered the required details. Please ensure that your name, e-mail address and the story fields are complete.
    						<?php
    						}
    						} else {
    						?>

  10. #10

    Join Date
    Nov 2005
    Posts
    95
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: CLEO blocking sendmail in PHP?

    You need to be very careful using simple mailing scripts like this. I got stung when some spammer started using mine to send spam.

    Even though the To field was hard coded, others were able to set the CC and BCC field somehow.

    I started getting vast quantities of undeliverable mail. That was a couple of months ago and I still get it now dating back to when it started.

    I stopped it by a) checking the refering URL was correct (as there was only one page that linked to the form page)

    Code:
    if ($HTTP_REFERER!="http://mydomain.com/order.php") {echo "There was an error processing your request. It looks like you arrived at this page from somewhere other than the approved order page."; exit;}
    and b) stripping out dissallow strings from the email field

    Code:
    $disallowed_email = array(':',';',"'",'"','=','(',')','{','}','bcc:','cc:','to:');
    	foreach($disallowed_email as $value)
    	{
    	if(stristr($_POST[Email],$value)){header("location: $_SERVER[HTTP_REFERER]");exit;}
    	}

  11. #11

    Join Date
    Nov 2005
    Posts
    95
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: CLEO blocking sendmail in PHP?

    Also prevent the form being used with GET (only allow POST)

    Code:
    if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}

  12. #12
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,013
    Thank Post
    120
    Thanked 283 Times in 261 Posts
    Rep Power
    108

    Re: CLEO blocking sendmail in PHP?

    Thanks I will add those .

SHARE:
+ Post New Thread

Similar Threads

  1. CLEO emails IMAP
    By Outpost in forum Wireless Networks
    Replies: 2
    Last Post: 13th November 2007, 01:55 PM
  2. Cleo VPN Problem
    By dezt in forum Wireless Networks
    Replies: 8
    Last Post: 9th October 2007, 02:25 PM
  3. Moodle authentication hosted on CLEO servers
    By dezt in forum Virtual Learning Platforms
    Replies: 6
    Last Post: 29th March 2007, 08:03 PM
  4. Sendmail sending mail to Exchange
    By Ric_ in forum *nix
    Replies: 4
    Last Post: 24th October 2006, 09:33 PM
  5. Replies: 7
    Last Post: 14th September 2006, 10:37 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •