Help - Search - Members - Calendar
Full Version: Mail Parser Setup
Invision Power Services > Invision Power Services, Inc. > IPS Company Feedback > IP.Nexus Beta Feedback
Josh
NOTE: CPanel installations can look and act differently depending on the skin that is used. If you are unable to use these directions, please provide a screenshot of your mail forwarder or Default Addresses screen, and we can let you know what changes need to be made. We will continue to update these instructions to address as many different CPanel issues as we can.

Setting Up The Mail Parser

First decide which e-mail addresses you want to use in conjunction with IP.Nexus. The domain you choose for your addresses needs to be properly set up on your server. For example, if you plan to use support@superwidgets.com as one of your IP.Nexus addresses, then the domain name superwidgets.com needs to be set up to work with the hosting account you are install IP.Nexus into. In the majority of cases, your host performs this domain setup automatically, but consult them if you have any problems when following these instructions. There’s 2 ways of using the mail parser, it is up to you which you choose to use. In either case, the addresses you plan to use cannot already exist – if they do, you will need to delete them in CPanel before you set them up for IP.Nexus.

Catch-all Account

When email is sent to any address on your domain, the server looks through your configuration to see if it can find the username (the part before the @ symbol). If it can, it delivers the mail to that user. If it fails to find a matching username, it delivers it to a catch-all account – essentially a collection box for any other usernames that don’t exist on the server. IP.Nexus can use this behaviour to its advantage by analysing the mail delivered to the catch-all account to see if it matches any of the departments or rules you’ve set up, and if so, handle the mail itself (leaving any other non-IP.Nexus mail alone). The advantage for you is that you only have to set up one address within CPanel, and IP.Nexus does all the work of distributing mail for it.

Setting up the Cachch-all
  1. Log into your CPanel installation using the normal process (ask your host if you’re unsure).
  2. In CPanel, click on the Mail icon to go to the Mail Management screen. Select the Mail icon in CPanel
  3. From the Mail Management screen, click Default Address . CPanel will show you where unrouted mail for each of your domains (if you have more than one) will be sent. CPanel may have set up a default value for the domain you’re using with IP.Nexus, but we’ll need to change that value.
  4. Click Set Default Address .
  5. Select your domain from the drop-down box if it isn’t already selected. In the textbox, you need to tell CPanel where your IP.Nexus mail parser script is located. Note that this has to be a path on the server and not a URL. It is also imperative that the path you enter is preceded by a pipe character |. An example of what you might enter is |/usr/bin/php –q /home/user/public_html/process_mail.php
  6. Click Change to complete the process. Although the parser is now set up, it has nowhere to send mail to because no mail rules will yet be configured in IP.Nexus.

Individual Addresses

The second method involves you setting up each email address you want to use in IP.Nexus within CPanel. The advantage with this method is you may find it more logical being able to see your addresses from within CPanel and, as we’ll cover later on, you can also route mail to particular departments right from CPanel, without needing to set up mail rules in IP.Nexus to achieve it. If you want to use the method that routes mail directly to a department, jump to the Routing mail directly to departments section. Setting up individual addresses (without routing)

Setting Up Individual Addresses
  1. The process for setting up individual addresses is somewhat similar to setting up the catch-all address. To begin with, log into your CPanel.
  2. Click the Mail icon to go to the Mail Management screen.
  3. Click the Forwarders link to go to Forwarding Maintenance.
  4. To add a new forwarder, click Add Forwarder at the foot of the page.
  5. This screen asks you to enter some details for the forwarder. The first textbox will be the first part of the email address you want to use. For example, if you want to set up support@superwidgets.com then enter support in this box. Next, select the domain from the drop-down box if it isn’t already selected. In the 3rd field you need to enter a command so that the script is executed by PHP and the path to the mail parser script in IP.Nexus. This must be a server path and not a URL, and additionally it must be prefixed by a pipe character |. An example of what you might enter is |/usr/bin/php –q /home/user/public_html/process_mail.php, naturally changing the path as appropriate.
  6. Click Add Forwarder to complete the process. Your address is now set up for use in IP.Nexus. Repeat the process for other addresses you want to set up.

As with the catch-all method, although you’ve set up your addresses IP.Nexus doesn’t know what to do with them until you set up some mail rules.

Routing Mail Directly To Departments

If you use the individual address method, it is possible to route mail directly to a particular department from within CPanel. To achieve this, you first need to set up your departments.
  1. Navigate to the Department Manager.
  2. Click the icon to the right of the department you want to set up with the mail parser, and click Edit .
  3. Once on the Edit Department screen, look in the address bar of your web browser, and make a note of the number that is paired with the id parameter. For example, if the address was ...#appcomponent:support;module:helpdesk;section:departments;do:edit;id:2, then the number you need to make a note of is 2.
  4. Follow steps 1-4 of the Setting up individual addresses (without routing) section.
  5. Follow step 5 above, but at the end of the path you enter, insert a space then type the number you noted down. The contents of the text box will contain something like |/usr/bin/php –q /home/user/public_html/process_mail.php 2. It is important to ensure the first character is the pipe |, and that the department id is preceded by one space.
  6. Click Add Forwarder in CPanel to complete the setup. The IP.Nexus mail parser will now know to route any email sent to this address to the department you specified.

NOTE: Before the mail is routed to the specified department, any mail rules you have set up are applied. It is therefore possible to still have rules that affect which department an email will go to, with them being sent to the department you specified if no rules are matched.

Common Issues

Mail Forwarder setup does not allow '/usr/bin/php' in the send to email field

There may be a 'Pipe to Program' option, in this case you will need enter the path only '/home/user/public_html/process_mail.php', and then add the following line to the top of process_mail.php:

#!/usr/bin/php -q

The path to PHP can vary from host to host, if that line does not work, please contact your host to find the correct path.

NOTE: We will add that line by default in a future beta, but for now you will need to add it yourself if you are having this issue.
Alεx
Much appreciated, thankyou! Will get to testing this tomorrow original.gif
Luke
May have found an error in the guide.

Under cache all you mention:

|/home/username/public_html/process_mail.php

And the rest you mention:

|/usr/bin/php –q /home/user/public_html/process_mail.php

The first will work ONLY if you have a shebang line in the php script on the first line:

CODE
#!/usr/bin/php -q


Without a shebang line, or specifying the interpreter before the script, shell wouldn't know what to do with it.

And with PHP, obviously, the installation path can be different from server to server, so you're better off using the second line anyway.
LMarkham
I believe that I have set things up correctly. Here are the screenies, at the bottom of the page i have posted the error I recieve back from my domain:

Mail Forwarder:



Create Mail Forwarder:




and finally the failuer message:

CODE
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

pipe to |/home/blah/public_html/nexus/process_mail.php
generated by sup@blah.com
local delivery failed


As a side note: I found a bug about the route email from box length to I created a new address sup@domain.com since support was to long.

If you require admin access to my cPanel or to my IPN please send me a PM and I will get you access.

Thanks!

Edit:bad link for screenies
LMarkham
I added the shebang line in the php file and it works great! Thanks Luke and Josh.
Josh
QUOTE(MarkhamLA @ Oct 24 2007, 08:55 PM) *
I added the shebang line in the php file and it works great! Thanks Luke and Josh.


Glad to hear it's working, I've updated the original post to include the solution you used, thanks for testing original.gif
LMarkham
Anytime! Love testing software!
LMarkham
Might I suggest to put the shebang in the file it self?
Digi
No MS support eh?
Myr
I was having troubles with this until I remembered to check the file permissions. It must be CHMOD to 0755 or equivalent.
(it defaults to 0644 on my system).

It worked like a charm as soon as I changed the permissions.
Digi
QUOTE(Digi @ Dec 21 2007, 03:45 AM) *
No MS support eh?


hallo? tongue.gif
bfarber
I haven't actually looked at the script, but could you elaborate Digi? Why is it not working on Windows? You getting an error or something?

Naturally any mail forwarding/piping is going to be setup differently on a different mail server, but assuming you got that figured out are you getting errors or something?
Digi
You can't forward to a pipe on windows servers (I spent 4 months trying to find a way) original.gif I know windows supports named pipes, I've just not found any way to use them for this. I've had to fall back on using the imap extensions in php for my script mail delivery.
Digi
I revamped your piping file for an IMAP process, but it appears that your system is pushing out SQL errors upon trying to find a customer (this happens after the ticket already exists from what I can tell). Has this already been reported?

Here's the link (please do not hit this link if you are not IPS as it will cause the first pending email to be recreated every time it is loaded):
http://dev.metalaxe.com/ipstest/nexus/meta...map_process.php
Digi
My above report works under the new beta version.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.