0

I used to pipe incoming emails using:

|/path/to/php/script in .forward file at /home folder.

But the actual system I'm working on is based on Maìldir instead MBOX. So that solution does not work.

I have no clue how to pipe emails correctly to PHP.

2 Answers2

0

It should be similar, what are you trying to accomplish? My server is in Maildir format, and I have something similar to what you are doing and it works fine. It shouldn't matter if you're using Maildir or MBOX format, all that is handled by the mail server.

sdot257
  • 3,059
  • 5
  • 30
  • 39
  • Thanks, luckytaxi. The email box at maildir is different from my linux username. So when I put a .forward file at Home, nothing happens. I can list all my emails at /home/username/mail, but they are stuck there. I can't forward to anywhere. –  Mar 02 '11 at 20:21
  • So are you trying to forward an email or do something else with it using PHp? – sdot257 Mar 02 '11 at 20:29
  • Yes. I followed the tutorial at http://www.evolt.org/incoming_mail_and_php using Exim configurations (my MTA is Exim). But it just works if linux-username is email username. –  Mar 02 '11 at 20:34
  • Ohhh i see now, that's the same tutorial I tried. Do what grawity said, put it inside /etc/aliases. That way, an email comes in and your MTA immediately knows what to do with it. – sdot257 Mar 02 '11 at 21:46
0

|/path/to/script should work just fine. Forwarding, whether using ~/.forward or procmail, is done before the mail system gets to touch your Maildirs.


In case of "virtual mailboxes", /etc/aliases can do the same thing.

foouser: |/path/to/script
user1686
  • 10,162
  • 1
  • 26
  • 42