Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Install Postfix and Procmail:
- yum install postfix
- yum install procmail
- (Optional)Setup mail relay: /etc/postfix/main.cf
- relayhost = [Relay server IP]
- Setup procmail: /etc/postfix/main.cf
- mailbox_command = /usr/bin/procmail
- Configuration: $HOME/.procmailrc
- PATH=/usr/local/bin:/bin:/usr/bin
- LOGFILE=$HOME/procmail.log
- VERBOSE=YES
- SHELL=/bin/sh
- :0
- * ^Subject:.*BANK*
- | $HOME/sendmail.php
- PHP script: $HOME/sendmail.php
- #!/usr/bin/php
- <?php
- $to = 'my@gmail.com';
- $subject = 'Test email bank';
- $message = '';
- $headers = 'From: my@gmail.com' . "\r\n" .
- 'Reply-To: my@gmail.com' . "\r\n" .
- 'X-Mailer: PHP/' . phpversion();
- $stdin = fopen('php://stdin', 'r');
- $line = fgets($stdin);
- $message .= $line;
- mail($to, $subject, $message, $headers);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement