Difference between revisions of "Setup Incoming Email Pipe to Script for Qmail"

From Brian Nelson Ramblings
Jump to: navigation, search
(Created page with "==Pipe incoming Emails to a Script== Some times you want to setup all incoming emails to be piped to a script. To do this, you will need to create a file like .qmail-redirec...")
 
(Pipe incoming Emails to a Script)
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Some times you want to setup all incoming emails to be piped to a script.
 
Some times you want to setup all incoming emails to be piped to a script.
  
To do this, you will need to create a file like .qmail-redirect in the mailbox folder.
+
To do this, you will need to create a file like .qmail-redirect in the domain folder, this would be for the user [email protected].
  
  vim /home/vpopmail/domains/briansnelson.com/brian/.qmail-redirect
+
  vim /home/vpopmail/domains/briansnelson.com/.qmail-redirect
  
 
and insert the following to pipe all incoming email to emailscanner.php
 
and insert the following to pipe all incoming email to emailscanner.php
  
  | /var/www/html/.emailscanner.php
+
  | /usr/bin/php -f /var/www/html/.emailscanner.php
  
 
===Check Permisson on your Mail Pipe file===
 
===Check Permisson on your Mail Pipe file===
Line 15: Line 15:
 
You will need to adjust the permission on the file 600 and ownership to vpopmail.username and then restart qmail.
 
You will need to adjust the permission on the file 600 and ownership to vpopmail.username and then restart qmail.
  
  chown vpopmail.briansnelsoncom /home/vpopmail/domains/briansnelson.com/brian/.qmail-redirect
+
  chown vpopmail.briansnelsoncom /home/vpopmail/domains/briansnelson.com/.qmail-redirect
  chmod 600 /home/vpopmail/domains/briansnelson.com/brian/.qmail-redirect
+
  chmod 600 /home/vpopmail/domains/briansnelson.com/.qmail-redirect
  
 
===Restart Qmail===
 
===Restart Qmail===

Latest revision as of 17:54, 17 March 2014

Pipe incoming Emails to a Script

Some times you want to setup all incoming emails to be piped to a script.

To do this, you will need to create a file like .qmail-redirect in the domain folder, this would be for the user [email protected].

vim /home/vpopmail/domains/briansnelson.com/.qmail-redirect

and insert the following to pipe all incoming email to emailscanner.php

| /usr/bin/php -f /var/www/html/.emailscanner.php

Check Permisson on your Mail Pipe file

You will need to adjust the permission on the file 600 and ownership to vpopmail.username and then restart qmail.

chown vpopmail.briansnelsoncom /home/vpopmail/domains/briansnelson.com/.qmail-redirect
chmod 600 /home/vpopmail/domains/briansnelson.com/.qmail-redirect

Restart Qmail

/etc/init.d/smtp restart

or if you have the qmailctl installed

qmailctl restart