Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    May 2010
    Posts
    7

    Default Email Piping to PHP with CATCH ALL

    Hello Masters,

    I have a problem and i need some help / guidance in order to solve the issue.

    First, let me try to explain the requirements :

    I have a site, where the office staff can send email to mobile users on their CELL NUMBER email address (like, 83838388@txt.att.net). The email/txt to the mobile user will be sent like office_staff_name_talk_1@domain.com

    Now you can see that there will be the name of the office staff with the TALK 1, that is the specific talk from that staff to the particular mobile user.

    Now, what I think is that, instead of having so many email addresses for each staff, why not just have 1 Catch all email address, and whenever some one send an email to office_staff_name_talk_1@domain.com, it will be forwarded to the catch_all_email@domain.com

    Is this possible ?

    Now, when the catch_all_email@domain.com receives the email that was send to office_staff_name_talk_1@domain.com, the email will be PIPE to a PHP script that will determine the original recipient (i.e.office_staff_name_talk_1@domain.com) and notified the same staff that there is a reply from the mobile user.

    Now, please tell me is that all doable and can be done like i mentioned ?

    Is there any other way to do this ?

    I have CPanel, and i want to know if catch all for above scenario and piping for above scenario is possible

    Thanks
    ZH

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    You could but why would you want to?

    You are substantially increasing your work as well as the mail server processing and loads by doing it that way.

  3. #3
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Hi

    Thanks for your reply. How you would suggest me to do it instead ?

    Actually, when a staff sends a message, it will open a communication window, and as soon as the mobile user reply ONLY that window will update instantly.

    Now, if I do not do the way i described, how i can do ?

    thanks
    Zeeshan Hashmi

  4. #4
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Well, so no one at this Forum can provide guidance / help ?

  5. #5
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,893
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    Quote Originally Posted by zeeshanhashmi View Post
    Well, so no one at this Forum can provide guidance / help ?
    Please keep in mind this past weekend was a long holiday weekend for some.

    I'm not sure I understand the question, but you can if you like, create forwarders instead of actual email accounts easy enough from your cPanel.

    staff1@yourdomain.com, staff2@yourdomain.com etc, and have them all be forwarded to staffadministrator@yourdomain.com (this one being the valid email account)


    But, the title of your thread:
    Email Piping to PHP with CATCH ALL
    suggests that you might be wanting something different than your actual post content reads to me.

    If you can explain it a bit differently or with more details I am quite sure you'll find the help you seek.

    Everyone is back to work today.

  6. #6
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Hi

    Thanks for your reply,

    Well, your understanding is almost correct.

    Yes i will make a master/actual email addresses like all_staff@website.com, and all the other email addresses, staff1@website.com will be forwarder to all_staff@website.com.

    But, here are the other part of the requirements,

    1) all such non-actual email address, like staff1@website.com etc, will me made in the real time by the script.

    2) Whatever email is coming to all_staff@website.com, i want that email to be PIPED to my PHP Script.

    Now, tell me, is this all ok and achievable ?

  7. #7
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Thanks for your reply. How you would suggest me to do it instead ?

    Actually, when a staff sends a message, it will open a communication window, and as soon as the mobile user reply ONLY that window will update instantly.

    Now, if I do not do the way i described, how i can do ?
    Sorry was offline Monday and a bit busy yesterday just like InfoPro said ....

    Setting up what you ask is ridiculously easy ---

    The point I was making in the last post is that by blindly piping every inbound email to script with wildcard matching you are going to have large numbers of extra script launches using up server resources and processing space for child processes just simply handling spam messages. Other than potential DoS type situations, you also open yourself up to a number of other potential security problems doing that.

  8. #8
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Well, thanks for your reply.

    In fact, this is going to be a 2 way REAL TIME communication on site.

    Like the online staff, will send a message to mobile user, and then mobile user will send the message to the staff email address and that will update the communication window live.

    Now, what would you suggest a better way for this ? if not email piping ?

  9. #9
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Hellooo uuuu hoooooo


    any 1 ????

    No one here who can help ?

  10. #10
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by zeeshanhashmi View Post
    Well, thanks for your reply.

    In fact, this is going to be a 2 way REAL TIME communication on site.

    Like the online staff, will send a message to mobile user, and then mobile user will send the message to the staff email address and that will update the communication window live.

    Now, what would you suggest a better way for this ? if not email piping ?
    You could always have a PHP script based on http://sdk.cpanel.net/lib/xmlapi/php..._v1.0.5.tar.gz that creates the email forwarders in real time, making cPanel do all the work of forwarding, without setting up a catch-all piping program. When you're done using a forwarder, you could always manage them via the cPanel interface or build your own script to handle mass deletions.

    Would it be okay if I move this thread over to Developer Discussions so those that work with our APIs can further assist you with pursuing this particular solution?

  11. #11
    Member
    Join Date
    May 2010
    Posts
    7

    Default

    Hi

    thanks for your reply, and yes I think you can move this discussion to the relevant forum.

    thanks
    ZH

  12. #12
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default

    Hi ZH,

    I guess you could do it like DavidG suggests.

    1)a email with is prepared with a unique id related to the task
    2)a forwarder is added via the xml-api (possibly using the PHP client class DavidG pointed to)
    3)the email is sent, with the "from" and "reply-to" address the same as the new forwarder
    4)mobile user sends a reply to email
    5)email get forwarded to "catch_all" box
    6)"catch_all" pipes a copy of all incoming email to a script that will update the task status, etc
    7) the script also checks for any old forwards and removes them (in the opposite manor they were created, ie. xml-api); updates their task status if necessary.

    Another way would be to sent and receive all the mail from the "catch_all" address and place the task id in the subject line. It's easier to implement cause all you need is the task creation/maintaince script and the script that is on the other side of the pipe (all of which you'd have to write anyway). If you did do it that way, I'd recommend putting the id (ex. [[TKT#A123456]] ) at the END of the subject.

    I personally can't stand how automated mail queues insist on placing this giant unique id at the beginning of the subject. On a mobile device, you always have to open the email or at least the email client, to get a glimpse at what the darn things is even about! Totally negates any mobile notification screens...sigh.

    Good Luck,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

Similar Threads & Tags
Similar threads

  1. Email piping to a php script fopen disabled
    By broncha in forum cPanel Developers
    Replies: 5
    Last Post: 08-28-2011, 05:51 AM
  2. PHP Email Piping not working with cPanel 11
    By celliott in forum E-mail Discussions
    Replies: 13
    Last Post: 02-06-2009, 04:46 AM
  3. Email Piping
    By rligg in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-23-2008, 05:28 PM
  4. Replies: 1
    Last Post: 06-20-2003, 01:57 PM
  5. email piping?
    By mamady in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 02-13-2003, 01:29 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube