Sendmail or Postfix - auth and non-auth relay (solved)
My cable provider blocks TCP connections on port 25, so I have a hosted virtual server running Postfix as my mail exchanger. It does some anti-SPAM filtering, then delivers mail for my domains to my local machine (still running sendmail) on a different port. My local machine takes mail from my local clients and relays it out through my ISP.
Now... I just got an Android, and want to be able to connect from anywhere, authenticate and send mail wherever I want. Simple, right? Set up sasl, and it works. I can connect remotely and send mail wherever I want from my phone. Unfortunately, all OTHER incoming connections are now told they can't relay, because they didn't authenticate. Not good!
So I want to allow the mail server to operate as it does now -- anyone is able to send mail to my domains. Plus, I want authenticated users to be able to relay anywhere. Right now it's either requiring auth from all users, or not permitting relaying except from my local machines.
UPDATE: I found the solution a couple of hours after posting this, of course. The solution: Quit trying to get sendmail to behave the way I want, and do it with Postfix. On my postfix server I added the following lines to /etc/postfix/master.cf:
I set up the Droid to use a local username and password on the remote (hosted) mail server, and everything works fine. It connects, uses TLS, authenticates, relays, all's good. I hope this helps someone else some time.
submission inet n - n - - smtpd