Jonathan McMahon wrote, On 5/4/09 11:37 PM:
My email timed out and truncated the subject line...
I'm trying to set up an extremely basic mailserver on Leopard 10.5 in
order to check the behavior of some PHP scripts. Nothing fancy needed - I
just want to send and receive mail to/from myself without having to go
out to my ISP.
Then you should have no problem using the Postfix config Apple provides as a
base. It really only needs to be tweaked to run a smtpd all the time. I
believe that editing /System/Library/LaunchDaemons/org.postfix.master.plist
to eliminate "-e 60" as arguments to master and add a RunAtLoad key (and
reloading it) will do the trick.
QUESTION #1 I've been able to get Postfix started and can telnet into
127.0.0.1 to get a test email sent. The issue is that it bounces as an
unknown user...is there a basic checklist I can run through to make sure
the user does in fact exist? I can only find buts and pieces on the web.
Here is the error message I'm getting:
to=<j...@john-does-imac.localhost>, orig_to=<j...@john-does-imac>,
relay=local, delay=0.07, delays=0.06/0/0/0, dsn=5.1.1, status=bounced
(unknown user: "john")
It might have helped a bit to see the whole of that SMTP-by-telnet session,
but it's not really indispensable...
Presumably you said "RCPT TO:<j...@john-does-imac>" and your postfix config
added '.localhost' (which is odd...) and there's no user named 'john' so it
rejected the message.
I modified /etc/postfix/aliases:
root: john
then ran newaliases, but that doesn't seem to help.
Right, because that says to treat mail to the local user "root" to the local
user "john" and that is not helpful. on a mac, going the other way might
not help either, since by default /var/root/.forward contains '/dev/null'
and that will send mail to the bitbucket.
Assuming that you have a fairly normal Mac, the valid users all have home
directories under /Users named with what Apple refers to as the 'short name'
which is their Unix login name and the local part of the addresses Postfix
will accept as local.
QUESTION #2
I know that I need an FQDN in order for Postfix to function properly,
Yes and no.
You need Postfix to be able to determine and/or construct a FQDN. It can do
so on any normally configured Mac without any changes to the Postfix config.
The name may not be useful for exposing Postfix to the world, but it will
handle local delivery of messages submitted via port 25 on the loopback or
the sendmail compatibility interface just fine.
but I'm having trouble understanding what goes where in the
> "u...@host.domain.tld" scheme.
My System Preferences list the following:
Computer Name: John Doe's iMac
Computers on your local network can access your computer at:
john-does-imac.local
That looks like a usable FQDN to me, at least as long as you stay local.
Assuming I want to send a message to johndoe, what does the FQDN look
> like?
john-does-imac.local
Assuming that there's a local user 'johndoe', the whole address would be:
john...@john-does-imac.local
HOWEVER, Postfix would normally accept 'johndoe' and
'john...@john-does-imac' and extend them, unless you've fiddled with the
config.
> How about the following parameters?
>
myhostname =
mydomain =
myorigin =
Leave them alone. The defaults are fine.
The confusing part is what to use for the domain and tld since I don't
own an actual domain like "yahoo.com". My best guess is:
j...@john-does-imac.localdomain.local
No.
There's also no reason to guess. Postfix provides a tool that will tell you
its configuration: postconf
This is from a Mac I just set up and have left with the Apple main.cf:
william-coles-macbook:~ bill$ postconf mydomain myorigin myhostname
mydestination
mydomain = localdomain
myorigin = $myhostname
myhostname = william-coles-macbook.local
mydestination = $myhostname, localhost.$mydomain, localhost
None of those is actually set in my main.cf. No need.
----------
Output of postconf -n:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
mail_owner = _postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 10485760
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain_fallback = localhost
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = _postdrop
unknown_local_recipient_reject_code = 550
Any help would be appreciated. Thanks.
Action plan:
1. Revert to the main.cf and master.cf that Apple provides.
2. Fix up the launchd plist so that master doesn't kill itself
3. Use sender and recipient addresses with local parts that match real users
that your system actually has.
4. Use the FQDN that System Preferences shows you. It should match the
output of the commands 'postconf myhostname' and 'hostname'
Bottom line: this is a lot simpler than you thought, and trying to outsmart
the defaults is what has made it complicated. The most arcane part should be
making launchd run the postfix master in the right manner to allow SMTP mail
submission rather than just local 'sendmail' submission.