IMAP Fetch problem

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

IMAP Fetch problem

Post by hbk08 »

Hello everybody,

I hope that you can help me with the following problem.
When I want to setup IMAP Fetch and typed in all information needed (tested with multiple email provider), then it is just testing the connection and there is nothing more happen.

When I click on "save settings" then HTTP ERROR 500 appears.

Does someone has any ideas?

Thank you in advance :)
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

The 500 is an error returned by your server, not by HESK.

For example "mod security" could be causing this, your host will need to check and verify that by examining logs.

Here are a few mod security rules known to create problems:

Code: Select all

# Host is an IP address
SecRuleRemoveById 960017

# Error because of "IP whois" URL in settings
SecRuleRemoveById 950120

# Error when saving URLs with many special chars
SecRuleRemoveById 981173

# Error because the HESK spam subject setting contains "Repetitive Non-Word Characters"
SecRuleRemoveById 960024

What happens when you click the "Test connection" in IMAP settings?
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
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

Hey,

i am hosting a Fedora DIstribution in a VM. So in this case I am the host :D

When I click on test imap, the loading icon is just running around and nothing is happen.
When I change other settings and click on "save settings" it is working without problem. Just IMAP Fetch is causing this problem.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

Perhaps IMAP port is blocked (IN and/or OUT) on the VM?

Until the test is successful, it won't save and work.
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
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

I opened the port 993 but it still doesnt work. I tried it today on a phyiscal machine as well and it doesnt work.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

Do you even have the IMAP extension installed/enabled in PHP?
http://php.net/manual/en/book.imap.php
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
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

IMAP Extension was missing, thank you! But now I get this error:

[CLOSED] IMAP connection broken (server response)
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

I got it! SSL instead of TLS
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

When I send an E-Mail to the adresss of IMAP Fetching, there will be no Ticket created.

Any ideas why?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

You need to setup a cron job to run the inc/mail/hesk_imap.php script every 5 minutes or so.

When run, the script will login to the IMAP account, fetch emails and process them.
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
hbk08
Posts: 7
Joined: Fri Mar 10, 2017 7:24 pm

Re: IMAP Fetch problem

Post by hbk08 »

I created with the command: crontab -e following line:

1 * * * * /var/www/html/support/inc/mail/hesk_imap.php

after I rebooted the system. But it still doesnt create tickets.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

What happens if you turn Debug mode ON in Hesk settings then open hesk_imap.php in your browser?

If that works, something is wrong with your cron setup:

1. the hesk_imap.php file isn't executable on your server (try chmod to 755)
2. the path to PHP on your server is not the same as set inside the hesk_imap.php, try

Code: Select all

1 * * * * /usr/bin/php -q /path/to/hesk/inc/mail/hesk_imap.php >/dev/null 2>&1
(make sure you change /usr/bin/php to php on or server)

Also, note that 1 * * * * will make the cron job run only once per hour (at 10:01, 11:01, 12:01, 13:01, ...). For every minute use * * * * * or (recommended for live setup) use */5 * * * * to run it every 5 minutes.
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
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: IMAP Fetch problem

Post by Klemen »

P.s.: I just noticed I forgot to publish IMAP fetching instructions in the knowledgebase :oops:

Here is the article: HESK IMAP fetching
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
Post Reply