Fetching tickets from multiple mailboxes (pop3) [RESOLVED]

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
grandfso
Posts: 26
Joined: Fri May 30, 2014 12:47 pm

Fetching tickets from multiple mailboxes (pop3) [RESOLVED]

Post by grandfso »

Hello,
In HESK you can only configure a single POP3 account. I tried to find some info on the forums, but couldn't. I am curious if it would be possible to fetch mail from multiple mailboxes ? Messages from each mailbox would fall into a specified category. Any ideas ?

thanks and regards, Radek
Last edited by grandfso on Mon Jul 07, 2014 7:16 am, edited 1 time in total.
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: Fetching tickets from multiple mailboxes (pop3)

Post by Klemen »

There is no built-in way of doing this.

You would for example have to make multiple copies of the hesk_pop3.php file and manually override settings that start with "$hesk_settings['pop3" inside it.

Then to get each account into a category you would also need to modify the hesk_email2ticket function inside inc/pipe_functions.inc.php to accept category ID as an argument for example and pass a different category ID to the function in each of the hesk_pop3 copies.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
grandfso
Posts: 26
Joined: Fri May 30, 2014 12:47 pm

Re: Fetching tickets from multiple mailboxes (pop3)

Post by grandfso »

Hi, I am clueless with PHP. I read this viewtopic.php?f=14&t=4799
and this looks almost like the solution, because I understand this will set the category based on contents of the email. I think It would be better, if we were able to specify the Category ID for each instance of hesk_pop3.php and pass it to the hesk_email2ticket function.

thanks and regards, Radek
grandfso
Posts: 26
Joined: Fri May 30, 2014 12:47 pm

Re: Fetching tickets from multiple mailboxes (pop3)

Post by grandfso »

EDIT: Below are instructions that allowed me to fetch mail from multiple inboxes into specified categories.

Hi! Right, I almost managed to figure out that to achieve multi-inbox downloads but I have some problem with password, as I am unable to specify it and when I execute the script, it says

Code: Select all

Error: Password error: Authentication failed
. I understand that this is getting the password from the admin panel because I didn't specify it in the PHP file. How do you specify it?

So far I've this is what I figured out...

First you need to skip checking whether POP3 is ON or OFF in Admin Panel
in /inc/mail/hesk_pop3.php
find:

Code: Select all

// Is this feature enabled?
if (empty($hesk_settings['pop3']))
{
	die($hesklang['pfd']);
}
change to:

Code: Select all

// Is this feature enabled?
// if (empty($hesk_settings['pop3']))
// {
//	die($hesklang['pfd']);
//}
in /inc/mail/hesk_pop3.php
Find:

Code: Select all

require(HESK_PATH . 'hesk_settings.inc.php');
Underneath add (remember to put your own details there):

Code: Select all

$hesk_settings['pop3_host_name']='mail.server.com';
$hesk_settings['pop3_host_port']=110;
$hesk_settings['pop3_tls']=0;
$hesk_settings['pop3_user']='user@server.com';
$hesk_settings['pop3_password']='password';
in /inc/mail/hesk_pop3.php
find:

Code: Select all

define('HESK_PATH', dirname(dirname(dirname(__FILE__))) . '/');
underneath add:

Code: Select all

define('CATEGORY',1);
in /inc/pipe_functions.inc.php
find:

Code: Select all

$tmpvar['category'] 	= 1;

change to:

Code: Select all

$tmpvar['category'] 	= CATEGORY;

Now you're all set up :) To add new inbox for HESK to check and create tasks from that inbox into specified category just make a copy of /inc/mail/hesk_pop3.php and edit the target category ID in define('CATEGORY',1);
Next define the details required to connect to the mailbox (the code added below require(HESK_PATH . 'hesk_settings.inc.php');

Then just call this file via browser or CRON. :)


thanks and regards, grand
Last edited by grandfso on Mon Jul 07, 2014 7:14 am, edited 1 time in total.
Klemen
Site Admin
Posts: 10143
Joined: Fri Feb 11, 2005 4:04 pm

Re: Fetching tickets from multiple mailboxes (pop3)

Post by Klemen »

A few lines down, search the file for $hesk_settings['pop3_user'] and $hesk_settings['pop3_password']

However, instead of finding and modifying all the lines it may be easier to find

Code: Select all

require(HESK_PATH . 'hesk_settings.inc.php');
And below that paste your new details (to overwrite imported settings):

Code: Select all

$hesk_settings['pop3_host_name']='mail.server.com';
$hesk_settings['pop3_host_port']=110;
$hesk_settings['pop3_tls']=0;
$hesk_settings['pop3_user']='user@server.com';
$hesk_settings['pop3_password']='password';
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
grandfso
Posts: 26
Joined: Fri May 30, 2014 12:47 pm

Re: Fetching tickets from multiple mailboxes (pop3)

Post by grandfso »

Hi Klemen! Thank you for this piece of code ! I've updated my earlier post to include complete instructions on how to get this done so this can be useful for others as well.

thanks and regards, Radek
Post Reply