Follow us on Twitter

E-mail Piping – Integrating your mailbox with your web application.

by on 13/11/09 at 3:28 pm

E-mail Piping is the process of passing the contents of an email as an input-variable to a script or a program on your webserver.

For example, with e-mail piping you can do things like:

  • allow mobile users to upload photos or videos to your website from their cellphones
  • send an auto response
  • submit help desk ticket
  • subscribe the sender to a newsletter
  • spam filtering etc.

E-mail piping usually follows the following technique:

  1. execute the program every time an email arrives for a predefined recipient (e.g. uploads@company.com), and
  2. send the message content to the program’s standard input (in other words, to simulate typing of the entire message through the keyboard)

How To Setup Email Piping

Placing .forward, .qmail-default, .procmailrc files to your mailman’s directory

If you have access to your sever’s shell, log-in to your servers root and create the following file depending on your servers email program:

This example is specific to Qmail
Filename: .qmail-{username}, ie .qmail-default, .qmail-support, .qmail-info

Place the file in the following location

/var/qmail/mailnames/yourdomain.com/.qmail-support

The file contents should contain a “pipe” (|) along with the script to pipe the information to.

|/home/path/to/your/script.php

Restart Qmail

/etc/init.d/qmail restart


Leave a Reply