opensupports / opensupports

OpenSupports is a simple and beautiful open source ticket system
http://www.opensupports.com/
GNU General Public License v3.0
918 stars 338 forks source link

IMAP Server #487

Open matthewbacon opened 5 years ago

matthewbacon commented 5 years ago

Looking forward to testing this feature out. However while I have successfully setup my SMTP server in OpenSupports Admin I have been unsuccessful with the IMAP Server {ip-address:993/imap/ssl}INBOX with the same username and password for the SMTP settings.

Aside from that what does "To parse emails and create tickets, you have to make a POST request to the indicated url and provide the IMAP Token. It's recommended to make it frequently, for example you can use a hook that calls it every time an email is received." - How? by a script/cron job? An example or suggestion would be appreciated.

matthewbacon commented 5 years ago

Visiting the "indicated URL" in my OpenSupports Admin page O get a 404 error.

"404 Page Not Found The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.

Visit the Home Page"

matthewbacon commented 5 years ago

I have subsequently written a PHP test code using IMAP_OPEN() with the same settings I'm providing for OpenSupports Admin and can access my inbox?

matthewbacon commented 5 years ago

image

matthewbacon commented 5 years ago

SOLVED When the Admin page shows "HIDDEN" for password it doesn't work! typing in the password again works. I have spent many hours on this.

image

ivandiazwm commented 5 years ago

@matthewbacon Yes, there's an issue regarding that you've to put the actual password in order for "Test" to be successful. An idea for polling could be to use something like a web hook or a script to call it repeatedly.

Please take a look to the documentation for this: https://github.com/opensupports/opensupports/wiki/Configure-Settings#email-settings https://www.youtube.com/watch?v=dEtALRMdOhs

cklabautermann commented 5 years ago

@ivandiazwm i did it as far as @matthewbacon but now there is missing the last step. Can you please explain how to actually retrieve the emails periodically , e.g. via cron or however? This is not explained in neither of both links in your post above. Thanks Claudio

nickbe commented 5 years ago

I've just used "restlet client" for chrome to poll the mail queue. However, despite the following successful output I cannot find my mails in the ticket list afterwards. There are currently two tickets in the list / account test is successful and I can check the tickets manually via webmail.

btw. /admin/system/email-polling seems to work while /api/system/email-polling doesn't

POST /admin/system/email-polling?token=mQQba7gOz9o6AHiWMQbx HTTP/1.1
Content-Length: 0
Host: xxxxx.de
Content-Type: application/json

HTTP/1.1 200 OK
nickbe commented 5 years ago

Is the senders mail adress checked against the registered user database?

cklabautermann commented 5 years ago

I managed to do a POST request via curl:

curl --data "token=mytoken" http://servername/api/system/email-polling

this curl fetches the emails in the imap inbox and files them in "New Tickets". You can only see them if your user is member of any department.

Next I will try to add my curl command to crontab to fetch emails regularly.

nickbe commented 5 years ago

No error here, but also no mails. This is the output i get from the curl command - no idea what's happening here... only the index.php is returned back.

<!doctype html>
<html class="no-js" lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <title>OpenSupports</title>

        <link rel="stylesheet" href="https://XXXXXXXXX.TLD/css/main.css">
        <link rel="stylesheet" href="https://XXXXXXXXX.TLD/ai/custom.css">
        <link rel="icon" type="image/x-icon" href="https://XXXXXXXXX.TLD/images/icon.png">
    </head>
    <body>
        <div id="app"></div>

        <script>
            opensupports_version = '4.4.0';
            root = "https://XXXXXXXXX.TLD";
            apiRoot = 'https://XXXXXXXXX.TLD/api';
            globalIndexPath = "";
            showLogs = false;
        </script>
                <script src="https://XXXXXXXXX.TLD/js/main.js"></script>
    </body>
</html>
cklabautermann commented 5 years ago

Did you define departments? Did you add your staff member user to any departments? Are you logged in with this user?

My curl command returns only

{"status":"success","data":null}

nickbe commented 5 years ago

Yes, I have several departments and the current user is logged in and has access to all these departments. The user who did send the mails is even in the user list with the same mail adress.

nickbe commented 5 years ago

can you post a list of all your installed PHP extensions?

cklabautermann commented 5 years ago

it´s an ubuntu 18.04 server:

apt-cache search php | grep "^php7" php7.2 - server-side, HTML-embedded scripting language (metapackage) php7.2-cgi - server-side, HTML-embedded scripting language (CGI binary) php7.2-cli - command-line interpreter for the PHP scripting language php7.2-common - documentation, examples and common module for PHP php7.2-curl - CURL module for PHP php7.2-dev - Files for PHP7.2 module development php7.2-gd - GD module for PHP php7.2-gmp - GMP module for PHP php7.2-json - JSON module for PHP php7.2-ldap - LDAP module for PHP php7.2-mysql - MySQL module for PHP php7.2-odbc - ODBC module for PHP php7.2-opcache - Zend OpCache module for PHP php7.2-pgsql - PostgreSQL module for PHP php7.2-pspell - pspell module for PHP php7.2-readline - readline module for PHP php7.2-recode - recode module for PHP php7.2-snmp - SNMP module for PHP php7.2-sqlite3 - SQLite3 module for PHP php7.2-tidy - tidy module for PHP php7.2-xml - DOM, SimpleXML, WDDX, XML, and XSL module for PHP php7.2-xmlrpc - XMLRPC-EPI module for PHP php7.1-mapi - transitional package for the rename of php7.1-mapi to php-mapi php7.2-bcmath - Bcmath module for PHP php7.2-bz2 - bzip2 module for PHP php7.2-dba - DBA module for PHP php7.2-enchant - Enchant module for PHP php7.2-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary) php7.2-imap - IMAP module for PHP php7.2-interbase - Interbase module for PHP php7.2-intl - Internationalisation module for PHP php7.2-mbstring - MBSTRING module for PHP php7.2-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary) php7.2-soap - SOAP module for PHP php7.2-sybase - Sybase module for PHP php7.2-xsl - XSL module for PHP (dummy) php7.2-zip - Zip module for PHP php7cc - command line tool to detect PHP 7 incompatible code

cklabautermann commented 5 years ago

I thought that php7.2-imap should be installed although it is not in the list of requirements...

nickbe commented 5 years ago

Let me compare this to my own server (Ubuntu 18.x as well) - so far so good.

cklabautermann commented 5 years ago

I will leave for weekend now - the lamp environment has been installed via tasksel - that´s the reason for the tons of modules installed :-) good luck!

nickbe commented 5 years ago

PHP is identical to mine. Last thing that comes to my mind is maybe the PHP.ini In case you have no sensitive information in it please share it....

cklabautermann commented 5 years ago

At the moment the ini is server default.

Am 15.03.2019 16:50 schrieb Nick notifications@github.com:

PHP is identical to mine. Last thing that comes to my mind is maybe the PHP.ini In case you have no sensitive information in it please share it....

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/opensupports/opensupports/issues/487#issuecomment-473339024, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYAmZjCO3v8qQgiP3GEJ0CqK1LcOmCTfks5vW8EZgaJpZM4bmmam.


manroland Goss web systems GmbH | Managing Director: Alexander Wassermann Registered Office: Augsburg | Trade Register: AG Augsburg | HRB-No.: 32609 | VAT: DE815764857

Confidentiality note: This message and any attached documents may contain confidential or proprietary information of manroland|Goss. These materials are intended only for the use of the intended recipient. If you are not the intended recipient of this transmission, you are hereby notified that any distribution, disclosure, printing, copying, storage, modification or the taking of any action in reliance upon this transmission is strictly prohibited. Delivery of this message to any person other than the intended recipient shall not compromise or waive such confidentiality, privilege or exemption from disclosure as to this communication. If you have received this communication in error, please immediately notify the sender and delete the message from your system. All liability for viruses is excluded to the fullest extent permitted by law.


nickbe commented 5 years ago

@cklabautermann - Augsburg und Klabautermann - da sitzt wieder mal einer mit ähnlichem Humor ganz in der Nähe :) Danke schon mal für die Hilfe. Weiss der Geier warum dass hier nicht will. Schönes Wochenende erst mal !!!

cklabautermann commented 5 years ago

@cklabautermann - Augsburg und Klabautermann - da sitzt wieder mal einer mit ähnlichem Humor ganz in der Nähe :) Danke schon mal für die Hilfe. Weiss der Geier warum dass hier nicht will. Schönes Wochenende erst mal !!!

Man gibt sich Mühe :-) Gern geschehen. Ich bin jetzt auf ein anderes System geswitcht, das hat auch mehr Features und ist besser gepflegt, auch wenn es nicht so hybsch aussieht: osTicket -> https://osticket.com/.

SunnyTeater commented 5 years ago

@nickbe did you get your bug fixed? Have the same problem at the moment..

nickbe commented 5 years ago

Not yet I'm afraid

SunnyTeater commented 5 years ago

Ah crap.. That new IMAP feature is nice but a shame at the same time.

I'm not a programmer or a pro on thinks like that.. "create a hook or a POST" is a taff challenge for me if I don't have anything that could help me..