I am trying to find a simple configuration for either sendmail/postifx or something else that will only allow e-mail to be sent from the server. The server is a simple VPS that runes lighttpd/php/mysql/ssh and a simple mail program that will send mail from it. I have an exchange server that hosts the e-mail for the one domain on the server.
Precisely You can see how hard it is to google anything because it's next to impossible to find anything on howto send mail only, because it gets confused with sendmail
I'd simply block port 25 in the firewall or set inet_interfaces to 127.0.0.1 in /etc/postfix/main.cf.
You could set sendmail up so that it receives no email but I don't think that would be a good idea as it would apply to internal email as well, which you shouldn't cut off. I'd take advantage of the situation and have the server serve as a honeypot. Since there is no MX record for it, anyone from the outside hitting it up for email must be spamming. So setup the firewall to not allow port 25 or 110 from outside the box and log the ip addresses to a file so that your company firewall can block those ip's.
You could easily setup a secondary mail server (in my case on a second box) with postfix with standard configuration but do not declare it in the DNS as the secondary priority MX. However you will need to setup SPF records in your domain dns zone and designate the second mail server IP address as permitted sender since all receiving mail servers will look into SPF (if it exists). I also have DomainKeys & DKIM signing on the second server. This way you could send onnly through this second server but nobody will try to send you emails since it is not listed in the domain dns records as a secondary MX. I cant say that this is really following RFC guidelines but it works like a charm and nobody ever complained. Regards Andy