views:

516

answers:

1

Hey, I'm trying to get php's mail function working on my local dev box in such a way where all mail sent using mail(), regardless of recipient, would stay local and show up in a thunderbird account (pop/imap/etc).

I've got php set up to use sendmail and I've got postfix installed. But i'm at a loss where to go next.

Any pointers?

+2  A: 
  1. register a user in postfix, something like testuser@localhost
  2. make sure postfix always forwards all emails to testuser@localhost
  3. make sure postfix always deletes all messages which were forwarded
  4. make sure your smtp server accepts mail for invalid local addresses
  5. uncheck any flag that sounds like 'do not permit SMTP relaying of non-local mail'
  6. set up a pop-inbox in thunderbird for testuser@localhost

[edit] just for the record. point 4 will make sure that you can use whatever addresses so when you're testing a system where emails are unique (which is pretty normal) then you won't run out of valid email-addresses.[/edit]

sidenote: I work on windows with mercury. but the basic approach is the same.

tharkun
Cool, I'll play with that, thanks!