The Ultimate Business Machine - Archives
List of Categories : Database * Technology * Commentary * Singapore * Travel *
Sat 11 Oct 2003
Yeh! Postfix on Panther works again
Category : Technology/postfix-watch.txt
The following instructions are for 7B74 onwards. 7B74 introduces postfix-watch, which looks like an Apple "innovation", and which threw me off quite a bit.
To enable Postfix on Panther, make sure you have eveything set as Apple had intended things to be. If you had ever changed things around in a bid to enable Postfix, and was not successful, try reverting everything to the default and start again. Specifically, the files that need to be reset to the original are : /etc/hostconfig, /etc/postfix/main.cf, and /etc/postfix/master.cf. I needed to do this before I could find the answer.
By default, in /etc/hostconfig, HOSTNAME=-AUTOMATIC- and MAILSERVER=-AUTOMATIC-. Leave these as they are, to keep your sanity.
Then when your Mac boots up, /usr/sbin/postfix-watch will be launched. If I am right in my guessing, Apple is being very thoughtful here. At this point, the usual Postfix processes are not yet launched, thus conserving CPU processes.
But, try using the "mail" command from the command line in Terminal.app. You will find that, unlike the case in Jaguar where you're required to enable sendmail first, the "mail" command is already working out of the box. I think postfix-watch's job is to watch for the need to call Postfix and it will then lauunch the required Postfix processes on your behalf.
So why can't you telnet port 25 on localhost? That's because Apple has commented out the smtp line in the master.cf file. Use BBedit, open /etc/master.cf, look for the smtp line and take out the leading "#" to uncomment the smtp directive.
Then do a "sudo postfix reload" from the command line to activate smtp. Do a "telnet localhost 25". You will find that your Mac will now listen on port 25.
So, launch Mail.app, create an account that will allow you to send mail out from localhost (i.e., by setting the outgoing mail server to either "localhost" or "127.0.0.1"). You will find that you can now send mail out from Mail.app using your own Mac as a roving smtp server. This is what Sendmail Enabler does for people on the road, but we're able to get here much faster by editing just that one line in the /etc/postfix/master.cf file.
Just one more thing. Add these lines to the end of your /etc/postfix/main.cf file :
myhostname = iBook.cutedgesystems.com
myorigin = cutedgesystems.com
Replace "cutedgesystems.com" with your own domain name. Now, myorigin acts like the Masquerade_As field in sendmail. Do a "sudo postfix reload". Now, use Mail.app to send mail out again, perhaps to yourself, so that you can examine the headers. You will find that you're now able to make the message look like it's coming from "firstname.lastname@example.org", say, rather than "bernard@iBook.local", which was what you would get before you made that last change.
A bonus : with Postfix, using myorigin, you don't get the "May be forged" warning that you may sometimes get when using sendmail with the Masquerade_As feature. This is what I found from a test that I made.
So, it's really quite easy to enable Postfix on Panther. I like to think that, maybe, Apple learnt from the response to Sendmail Enabler that there is a demand from Mac users for the ability to do such a thing. So they've made it easy, this time.
So where does this leave Postfix Enabler. I don't know. Maybe there's no need for Postfix Enabler, now. It's gotten so ridiculously easy. But then again, who knows, maybe people will still find this hard to do. Also, I've only once managed to get SMTP-AUTH to work with sendmail, and even then, only fleetingly. But with Postfix, I've got SMTP-AUTH working on the cutedgesystems and roadstead.com server that four of us are using for more than a month now. And it works great.
I hope this helps. I think Apple has done a great job on Postfix and Panther's really going to be a must-have upgrade.
Please note : if you write to me for trouble-shooting help and I don't respond, please try to understand. It's really hard to help everyone.
Posted at 3:37PM UTC | permalink