Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Install Postfix and Procmail:
  2. yum install postfix
  3. yum install procmail
  4.  
  5. (Optional)Setup mail relay: /etc/postfix/main.cf
  6. relayhost = [Relay server IP]
  7.  
  8. Setup procmail: /etc/postfix/main.cf
  9. mailbox_command = /usr/bin/procmail
  10.  
  11. Configuration: $HOME/.procmailrc
  12. PATH=/usr/local/bin:/bin:/usr/bin
  13. LOGFILE=$HOME/procmail.log
  14. VERBOSE=YES
  15. SHELL=/bin/sh
  16. :0
  17. * ^Subject:.*BANK*
  18. | $HOME/sendmail.php
  19.  
  20. PHP script: $HOME/sendmail.php
  21. #!/usr/bin/php
  22. <?php
  23. $to      = 'my@gmail.com';
  24. $subject = 'Test email bank';
  25. $message = '';
  26. $headers = 'From: my@gmail.com' . "\r\n" .
  27.     'Reply-To: my@gmail.com' . "\r\n" .
  28.     'X-Mailer: PHP/' . phpversion();
  29. $stdin = fopen('php://stdin', 'r');
  30. $line = fgets($stdin);
  31. $message .= $line;
  32. mail($to, $subject, $message, $headers);
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement