Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How can I setup Exim to pipe all incoming mail to a command (PHP)? and never reject an email?

I'm using Debain squeeze, and Exim4

share|improve this question
possible duplicate of forward all mail on a specified domain to script –  mailq Nov 3 '11 at 23:19
@mailq except I want all domains, and I use Exim, not Postfix –  Petah Nov 3 '11 at 23:28

2 Answers 2

With a permissive ACL and a pipe transport Do you really mean all incoming mail?

If you want to just write a damn configuration file yourself instead of fighting the Debian way of doing Exim, name it /etc/exim4/exim4.conf - it will override the Debian-specific scattered-in-subdirectories configuration.

share|improve this answer
up vote 0 down vote accepted

Got it working using this config:

primary_hostname =
domainlist local_domains =
domainlist relay_to_domains =
hostlist   relay_from_hosts =

received_header_text = Received: by $primary_hostname id $message_exim_id

acl_smtp_rcpt = acl_check_rcpt

never_users = root

host_lookup = *

begin acl

  accept domains =
  accept authenticated = *

begin routers

  debug_print = "R: receive_router for $local_part@$domain"
  driver = accept
  domains =
  transport = php_receive

  debug_print = "R: send_router for $local_part@$domain"
  unseen = true
  driver = accept
  transport = php_send

  debug_print = "R: dnslookup for $local_part@$domain"
  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  ignore_target_hosts = :

begin transports

  driver = smtp
  return_path =

  driver = pipe
  command = /var/mailer/receive >> /var/mailer/receive_output.log
  group = mail

  driver = pipe
  command = /var/mailer/send >> /var/mailer/send_output.log
  group = mail

begin rewrite        Ffrsbc
share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.