Skip to content

Instantly share code, notes, and snippets.

@bensie
Created January 30, 2009 18:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bensie/55208 to your computer and use it in GitHub Desktop.
Save bensie/55208 to your computer and use it in GitHub Desktop.
Configure Postfix to handle all email for a domain/subdomain and forward to a rails app
/etc/postfix/main.cf:
mydestination = localhost.localdomain, localhost, list.domain.com
virtual_maps = hash:/etc/postfix/virtual
alias_maps = hash:/etc/aliases
/etc/postfix/virtual:
@list.domain.com rails_mailer
/etc/aliases:
rails_mailer: "|/path/to/app/lib/mail_handler.rb http://www.example.com/emails 298cc9dceb1f3cac91fef8b42be624c07843fc8e"
Run these commands to apply:
postmap virtual
postalias /etc/aliases
postfix reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment