Advertisement
metalx1000

Postfix mail server run script for address

Oct 28th, 2016
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #create new user
  2. useradd <myusername>
  3.  
  4. #add user to mail server
  5. vim /etc/postfix/virtual
  6. myusername@domain myusername
  7.  
  8. postmap /etc/postfix/virtual
  9.  
  10. vim /etc/postfix/main.cf
  11. virtual_alias_maps = hash:/etc/postfix/virtual
  12.  
  13. service postfix reload
  14.  
  15. vim /etc/postfix/master.cf
  16. myhook unix - n n - - pipe flags=F user=www-data argv=/path/to/script.sh ${sender} ${size} ${recipient}
  17.  
  18. postfix reload
  19. chmod +rx script.sh
  20.  
  21.  
  22. vim /etc/postfix/access
  23. myusername@domain FILTER myhook:dummy
  24.  
  25. postmap /etc/postfix/access
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement