Question : Modifying master.cf to route incoming emails to a PHP file

This is something I had set up in Cpanel a while back but since moving to a new server and doing everything "manually" in Apache without Cpanel, I couldn't figure out how to do this.

Basically we have an email address where we want anything inbound to be forwarded to a PHP script (after SpamAssassin gets done), for automatic processing. I'm not sure if I can filter just in the master.cf for an individual address, I'll probably have to have the PHP file test to see what address it's being sent to in order to determine processing.

Below is my current master.cf
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
# Postfix master process configuration file mydomain.ca.  For details on the format
# of the file, see the Postfix master(5) manual page.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd -o content_filter=spamassassin
smtps     inet  n       -       n       -       -       smtpd -v
         -o smtpd_sasl_auth_enable=yes
         -o smtpd_enforce_tls=yes
         -o smtpd_tls_wrappermode=yes
         -o content_filter=spamassassin
submission inet n       -       n       -       -       smtpd -v
         -o smtpd_sasl_auth_enable=yes
         -o smtpd_enforce_tls=yes
2525     inet   n       -       n       -       -       smtpd -v
         -o smtpd_sasl_auth_enable=yes
         -o smtpd_enforce_tls=yes
         -o smtpd_tls_wrappermode=yes
#628      inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
  -o content_filter=
  -o receive_override_options=no_header_body_checks
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
        -o fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
scache    unix  -       -       n       -       1       scache
spamassassin
          unix  -       n       n       -       -       pipe
  user=spamfilter argv=/usr/bin/spamc -f
                   -e /usr/sbin/sendmail.postfix
                   -oi -f ${sender} ${recipient}
mailman unix - n n - - pipe
 flags=FR user=mailman:mailman
 argv=/etc/mailman/postfix-to-mailman.py ${nexthop} ${user}

Answer : Modifying master.cf to route incoming emails to a PHP file

Have you looked at Policy Daemons

http://www.postfix.org/SMTPD_POLICY_README.html


Random Solutions  
 
programming4us programming4us