Reference: http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/index.html
General steps:
1. Install exim4, on ubuntu: apt-get install exim4
2. Configure commands
a) dpkg-reconfigure exim4-config
This is just a simple gui for adjusting several basic parameters.
To add
1) non-split config (do_use_split_config="false" in /etc/exim4/update-exim4.conf.conf)
vi /etc/exim4/exim4.conf.template and add the address_pipe definition above
update-exim4.conf -v, it will generate /var/lib/exim4/config.autogenerated which is the real conf file that exim reads.
/etc/init.d/exim4 restart
2) split config (do_use_split_config="true")
replace the address_pipe definition in /etc/exim4/conf.d/transport/30_exim4-config_address_pipe
update-exim4.conf -v
/etc/init.d/exim4 restart
To setup an mail handler in user home:
create ~/.forward with
xxx@somedomain.com, |/home/someone/MailHandler.php
Notes:
*) xxx@somedomain.com is used for backup.
*) must use the abolute path to specify the php script.