As this is 10.7 Server, the 10.8 command:
$ sudo serveradmin settings mail:postfix:add_whitelist_domain = "yahoo.com"
can't be used in this case.
1. Create an exception file
$ sudo touch /etc/postfix/sender_access
2. Fill this file with domains that are OK to be excluded from the (greylist) policy
$ echo 'mail-out.ovh.net OK' | sudo tee -a /etc/postfix/sender_access
3. Create database from text file
$ sudo postmap hash:/etc/postfix/sender_access
4. Modify the Mac OS Lion SMTP server configuration
This configuration change allows the domains configured in the exception file to bypass running the greylist check. Therefore open up the main.cf, for example using the nano
editor:
$ sudo nano /etc/postfix/main.cf
Search for the line that starts with smtpd_recipient_restrictions =
, for example using the key combination Ctrl + W
The line might look like:
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_policy_service unix:private/policy permit
For readability I am writing this one line now as multiple lines:
smtpd_recipient_restrictions =
permit_sasl_authenticated
permit_mynetworks
reject_unauth_destination
check_policy_service unix:private/policy
permit
After reject_unauth_destination
and before check_policy_service unix:private/policy
some new text has to be inserted. The new text tells the mail server to look in the newly created file. The magic words to insert are: check_sender_access hash:/etc/postfix/sender_access
.
Now the smtpd_recipient_restrictions
looks like:
smtpd_recipient_restrictions =
permit_sasl_authenticated
permit_mynetworks
reject_unauth_destination
check_sender_access hash:/etc/postfix/sender_access
check_policy_service unix:private/policy
permit
Or written as a single line, it looks like:
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination check_sender_access hash:/etc/postfix/sender_access check_policy_service unix:private/policy permit
To save the change press Ctrl + O, and to exit the nano editor press Ctrl + X.
5. Make the configuration changed become effective
$ sudo postfix reload
And presto, now the web form mail messages arrive without greylisting delay.
PS You can also use the sender_access file to reject users, by adding lines like: user@abadboy.com REJECT
Here's how I'd troubleshoot things using terminal. You can use the console app as well to look at logs, but the serveradmin
commands are more detailed than the server app allows currently and historically.
curl localhost
- this tests that port 80 is listening and a web server is running.
sudo serveradmin status web
- this tests the service named web - n.b. you could have the curl command work and have apache running on port 80 but have your web status STOPPED as several other "services" start up apache such as Xcode, Profile Manager, etc...
- Depending if the status was stopped, issue a start
sudo serveradmin start web
or issue an orderly shutdown and restart sudo serveradmin stop web && sleep 15 && sudo serveradmin start web
If you are not getting anything that makes sense from curl
- perhaps look over the web logs:
tail /var/log/apache2/access_log
tail -20 /var/log/apache2/error_log
Once you've narrowed down if the problem is running apache and basic networking/DNS to get localhost to work or if there are problems with the code/content you can take next steps.
Also, looking over the tutorial/lesson - it looks like the selection was on HTTPS and not HTTP, so go back and ensure you are using https://myserver.local and https://localhost or http:// throughout and the server app is configuring the port (80 for http and 443 for https). For simplicity, I've just used port 80 for this answer and my server setup.
Best Answer
Usually, it is not necessary to do something like this when configuring services using the Server app, but in this case I had to manually restart the web service:
After that, the PHP on my page was interpreted as expected.