Skip to main content
Welcome, Guest. Please login.

Login with username, password and session length
3 Guests, 0 Users

Recent

Topic: Postfix call script via bcc (Read 12204 times) previous topic - next topic

Postfix call script via bcc

Code: [Select]
vim /etc/postfix/master.cf

Add the following
Code: [Select]
  -o receive_override_options=no_address_mappings

Just below the
Code: [Select]
smtp      inet  n       -       -       -       -       smtpd

Setup the recipient bcc

Code: [Select]
vim /etc/postfix/recipient_bcc

Add the following as appropriate

Code: [Select]
upload@tinoest.co.uk upload-script@localhost

Run postmap so postfix can read it.

Code: [Select]
 postmap /etc/postfix/recipient_bcc 


Setup the transport

Code: [Select]
vim /etc/postfix/transport

Add the following as appropriate

Code: [Select]
upload-script@localhost :

Run postmap so postfix can read it.

Code: [Select]
 postmap /etc/postfix/transport 

edit the main.cf

Code: [Select]
 vim /etc/postfix/main.cf 

Add the following:

Code: [Select]
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc
transport_maps = hash:/etc/postfix/transport


Also ensure that localhost is in the mydestination list

Edit the /etc/aliases file

Code: [Select]
vim /etc/aliases

Add the following, to point to the relevant file you wish to parse the data

Code: [Select]
upload-script: "|/usr/bin/postfix-parse"




Then restart postfix

Code: [Select]
systemcntl restart postfix