Skip to content

Small script to receive callbacks from a transactional mail service and send a fax

License

Notifications You must be signed in to change notification settings

phaxio/mailphax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mailphax

Send faxes with Phaxio using 3rd party email services. Mailphax is a simple sinatra app. You can run it on any host or with any service that supports ruby and sinatra.

Installation on Heroku

Use the deploy button

Deploy

Or do it yourself

(This assumes you have the Heroku toolbelt installed and have a Heroku account.)

  1. git clone this repo && cd mailphax
  2. heroku create
  3. heroku config:set PHAXIO_KEY=yourPhaxioApiKey
  4. heroku config:set PHAXIO_SECRET=yourPhaxioApiSecret
  5. git push heroku master

Now set up your hosted email service to invoke callbacks to this service when mail is received. (See below.)

Configuring Mailgun

  1. Sign up for a mailgun account
  2. In the Mailgun console, click "Domains" in the navbar.
  3. Add a new inbound domain that you have DNS control over. (Or use something.mailgun.org and you can use a mailgun subdomain! If you use a mailgun subdomain, you can skip the next step as DNS is set up by mailgun already.)
  4. Modify the DNS on your inbound domain to point to Mailgun using MX records.
  5. Click "Routes" in the main Mailgun Navbar.
  6. Click "Create new route"
  7. Leave the priority field alone.
  8. For "filter expression", specify "match_recipient("[0-9]+@YOURDOMAIN")" where YOURDOMAIN is the domain you added in step 3.
  9. For "Actions" specify "forward("http://yourMailPhaxInstallation/mailgun")" where yourMailPhaxInstallation should be the location where you've installed the sinatra app.
  10. Click "Save".
  11. Profit.

Configuring Mandrill

  1. Sign up for a mandrill account
  2. In the Mandrill console, click "Inbound" in the left sidebar.
  3. Add a new inbound domain that you have DNS control over.
  4. Modify the DNS on your inbound domain to point to Mandrill using MX records. (Click the "DNS Settings" button for more info.)
  5. Click "Routes" in the Mandrill console under your new inbound domain.
  6. Add a wildcard route "*" and point it to http://yourMailPhaxInstallation/mandrill (e.g. http://example.com/mandrill)
  7. Profit.

Configuring SendGrid

TODO

TODOs

  • Support SendGrid
  • Reply to user with confirmation of fax success/failure
  • Reply to user if fax submission failed (e.g. bad number, no attachment)
  • Allow filtering inbound emails by regexes

About

Small script to receive callbacks from a transactional mail service and send a fax

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages