The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

email pipe to program - what can it do?

Discussion in 'E-mail Discussions' started by malc_b, Aug 6, 2009.

  1. malc_b

    malc_b Registered

    Joined:
    Aug 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'm just moving my hosting to a host with cPanel. I'm looking for a good guide on the email feature of pipe to a program.

    I understand this puts the whole email on stdin and sends it to the program. And you need a shebang to get it to work. And php has a 2MB limit (what about perl?).

    But can I pipe through the program? I've used scripts with qmail in the past and there you can exit 0 or exit 99 to discard the email or continue processing and delivery.

    Do I just return nothing to discard or all to deliver? And what about memory limits?

    Or alternately is there a quick way of editing settings rather than using the gui? To add say 50 white list rules is far easier if that is just copy and paste into a file.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The pipe an email to a program can route mail to any executable within your home directory as a cPanel user, including executable scripts such as bash scripts, Perl scripts and PHP shell scripts.

    The email (including headers) is piped to the program via STDIN.

    Memory limit issues would be dependent upon whatever language/environment you are using.

    Email pipes to programs in a cPanel/WHM environment are not typically used for email filtering. Instead, they are often used for taking email information and entering it into some other system - for example, a ticket system.

    When you pipe to a program, it's as if you created an email forwarder. Therefore, if there is an actual email account on that address in addition to the forwarder, this pipe will be processing a copy of the email that has already been delivered. Of course, you could just remove that POP/IMAP account, leave the pipe then have your app handle the forwarding of the email. That would be up to you to code.

    Regarding your separate inquiry about whitelisting, what type of white list are you referring to? A boxtrapper whitelist, a SpamAssassin whitelist or some other type of whitelist?
     
  3. malc_b

    malc_b Registered

    Joined:
    Aug 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks. Useful info.

    The host I'm using does not have box trapper included. I thought it did when I signed up as it was on the demo videos. I could use the standard account email filters but I was wondering if I could making entering loads of filters less of a chore. I've since found the 2 text files that control the filters so with a pattern to work from I guess I could edit those directly to save some effort. Doesn't sound like pipe is what I want.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Individual hosting companies have the ability to enable or disable any functionality they desire. If you wish to use BoxTrapper, you may want to move to a hosting company using cPanel/WHM that also leaves BoxTrapper enabled.
     
Loading...

Share This Page