We recently installed Moodle onto a recent version of SuSe, and we're getting an fsockopen error. This error has been mentioned 8 times in the using moodle forum, but never answered.
I've tried leaving the config mail fields blank, but no mail or error message is sent. (There does appear to be one message waiting in the mail queue.) If I understand moodle correctly, it uses sendmail as the default? We were apparently unable to install sendmail due to an alleged incompatibility issue with postfix.
Any help would be greatly appreciated. I don't want to manually add users
Thanks in advance,
Mark Stevens
The first step is to make sure you mail works at all. Can you send a message using the 'mail' command at the command line? If not you will need to find an accessible SMTP server and fill that in, in the mail field.
Failing that, when *exactly* do you see the fsockopen error, and can you post the complete error. Have you checked the apache error log to see if there is any more information to be had in there?
One easy solution if you don't want to have a mail server running locally is to use some external mail server. For example you could create yourself an account with yahoo or a similar free service and then use their mail server.
Perhaps you have been put off from trying this by the text next to the smtp server setting on the configuration page which says: "Give the full name of one or more local SMTP servers that Moodle should use to send mail". I think the "local" should be taken out of that sentence because the SMTP server does not have to be local.
I am going to disagree with you slightly - the SMTP server in 99% of cases *will* be local. To prevent relaying most SMTP servers only allow connections to be made from the local network. The exception is those that require authorization, but I have actually yet to see such a server in a production environment.
With most Linux distros you only get a minimal mail setup out of the box. I wouldn't say that you are strictly speaking running a mail server as they usually don't accept mail. The postfix/sendmail setup will send mail though - if it can. Most institutions of any size tend to firewall outgoing mail except fro authorized machine to prevent spamming and other problems. In this case you would find that your machine can send to internal addresses but not external - probably not what you wanted.
--Greg
Mark,
Have you set up a cron job to call moodle/admin/cron.php (every 5 minutes or so)? You can call this script in the browser and if it sends any mail in queue, that may be all that's wrong. The command line for crontab should look something like this:
wget -q -O /dev/null http://yoursite.com/moodle/admin/cron.php on Linux.
If you have a mail server set up and running ok, leave smtphost: and other config fields blank. If this still doesn't work, something in PHP may not be set up correctly.
I loaded the chron.php file and it sent out the whole backlog of forum emails, so I know there's no problem the sendmail program and PHP. I tried to set up a cronjon to run the line you gave every five minutes. Hopefully that will work too.
--Greg