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
Fetching tickets from multiple mailboxes (pop3) [RESOLVED]
Moderator: mkoch227
Fetching tickets from multiple mailboxes (pop3) [RESOLVED]
Last edited by grandfso on Mon Jul 07, 2014 7:16 am, edited 1 time in total.
Re: Fetching tickets from multiple mailboxes (pop3)
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.
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 
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


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
Re: Fetching tickets from multiple mailboxes (pop3)
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
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
Re: Fetching tickets from multiple mailboxes (pop3)
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. 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:
change to:
in /inc/mail/hesk_pop3.php
Find:
Underneath add (remember to put your own details there):
in /inc/mail/hesk_pop3.php
find:
underneath add:
in /inc/pipe_functions.inc.php
find:
change to:
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
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
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']);
}
Code: Select all
// Is this feature enabled?
// if (empty($hesk_settings['pop3']))
// {
// die($hesklang['pfd']);
//}
Find:
Code: Select all
require(HESK_PATH . 'hesk_settings.inc.php');
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';
find:
Code: Select all
define('HESK_PATH', dirname(dirname(dirname(__FILE__))) . '/');
Code: Select all
define('CATEGORY',1);
find:
Code: Select all
$tmpvar['category'] = 1;
change to:
Code: Select all
$tmpvar['category'] = CATEGORY;
Now you're all set up

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.
Re: Fetching tickets from multiple mailboxes (pop3)
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
And below that paste your new details (to overwrite imported settings):
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');
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 
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


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
Re: Fetching tickets from multiple mailboxes (pop3)
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
thanks and regards, Radek