Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th September 2009, 00:05
acoghlan acoghlan is offline
Junior Member
 
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default Piping email to php script (Virtual Users And Domains With Postfix, Courier & MySQL)

I have used the article Virtual Users And Domains With Postfix, Courier And MySQL (CentOS 5.1) to build a number of servers now: I really like it and it's solved a number of issues - especially after implementing some of the tweaks in the comments on the article.

I am now trying to pipe certain emails to our support system, and I just cant get it to work.

The idea is that any email coming into issue-999@support.domain.com would route through to a specified php file and be processed in a specified way.

I am confident that the instructions in our support system will be correct in as much as specifying the syntax for getting their php script to work, however I cant get postfix to actually divert any email to the script.

At the moment I am using a catch all email account, using a forwarder @support.domain.com => address@support.domain.com. Regardless of what I try postfix always sends the inbound message to the forwarder. If I remove the forwarder entry from the table, then the message is bounced back to sender with an 'address not found' error.

Would you be able to give me a hint on how this is done? Better yet, if you could throw together another tutorial (because I know these things take no time at all to put together!) describing how to extend the excellent tutorial to piping email to different places, that would be brillient.

Regards

Andrew
Reply With Quote
Sponsored Links
  #2  
Old 4th September 2009, 18:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

I think this can be achieved by using maildrop or a Postfix filter (see http://www.postfix.org/FILTER_README.html ).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 5th September 2009, 12:51
acoghlan acoghlan is offline
Junior Member
 
Join Date: Jan 2007
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default

The system that I am using for support tickets (Eventum from MySQL) suggests these steps for postfix:

Quote:
In /etc/mail/main.cf define

Code:
transport_maps = regexp:/etc/mail/transportregex
local_recipient_maps = unix:passwd.byname $alias_maps $transport_maps

Be sure to include your domain in mydestination

Code:
mydestination = $transport_maps, $myhostname, eventum.example.com
In /etc/mail/master.cf define eventum transport:

Code:
eventum   unix  -       n       n       -       10       pipe
 flags=DRhu user=apache argv=/usr/bin/php /var/www/html/eventum/misc/route_${nexthop}.php
Create /etc/mail/transportregex file:

Code:
/note-.*@eventum.example.com/         eventum:notes
/issue-.*@eventum.example.com/        eventum:emails
/drafts-.*@eventum.example.com/       eventum:drafts
Run postmap on that file

Code:
postmap /etc/mail/transportregex
That doesnt seem to work at all with this virtual mail setup, and I am not sure that maildrop is the way to go either - surely this is a native postfix thing as there are many apps that make use of this type of functionality - I just cant work it into this server setup....

Last edited by acoghlan; 5th September 2009 at 12:55.
Reply With Quote
Reply

Bookmarks

Tags
centos 5, mysql, postfix, transport

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail (Ubuntu 8.10) VTCop HOWTO-Related Questions 9 9th April 2009 16:17
Virtual Users And Domains With Postfix, Courier And MySQL Secondary MX acoghlan HOWTO-Related Questions 1 8th March 2008 05:02
Virtual Users And Domains With Postfix, Courier And MySQL - "apt-get" and Courier burritonator HOWTO-Related Questions 3 15th March 2006 20:11
Problem with Virtual Users And Domains With Postfix, Courier And MySQL Howto fenix Server Operation 4 11th March 2006 02:53
Another Problem: Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP bluegrass Installation/Configuration 24 8th March 2006 01:41


All times are GMT +2. The time now is 05:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.