-
-
Save 3014zhangshuo/23c9e0572ae136af462542c832e73140 to your computer and use it in GitHub Desktop.
Postfix email to Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: /etc/postfix/header_checks | |
# Add to the bottom of the file | |
/To:.*[email protected].*/ FILTER send_to_my_app: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: /etc/postfix/main.cf | |
# Make sure you have next line in the file | |
header_checks = regexp:/etc/postfix/header_checks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: /etc/postfix/master.cf | |
# Add to the bottom | |
send_to_my_app unix - n n - - pipe | |
flags=Xhq user=yury directory=/home/yury/MyApp/production/current argv=sh ./receive_mail.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File: ../shared/receive_mail.sh | |
/home/yury/.rvm/bin/rvm 2.1.5@my_gemset do bundle exec rails runner -e production "SomeMailer.receive(STDIN.read)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment