Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
there is a mail server called "Maìldir" ? got a link? –  Dagon Mar 2 '11 at 20:02
    
maildir is a format for storing email server-side, usually used by IMAP servers. –  Marc B Mar 2 '11 at 20:08
    
ah, that explains it. –  Dagon Mar 2 '11 at 20:47
add comment

migrated from stackoverflow.com Mar 3 '11 at 5:12

This question came from our site for professional and enthusiast programmers.

2 Answers

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.

share|improve this answer
    
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. –  Andre Resende Mar 2 '11 at 20:21
    
So are you trying to forward an email or do something else with it using PHp? –  luckytaxi Mar 2 '11 at 20:29
    
Yes. I followed the tutorial at evolt.org/incoming_mail_and_php using Exim configurations (my MTA is Exim). But it just works if linux-username is email username. –  Andre Resende Mar 2 '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. –  luckytaxi Mar 2 '11 at 21:46
add comment

|/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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.