How to debug IMAP login

Issue #732 invalid
Alessandro created an issue

Hi guys, i'm trying to log via IMAP server, i've setted the config.php part as follow:

$config['ENABLE_IMAP_AUTH'] = 1;
$config['RESTORE_OVER_IMAP'] = 1;
$config['IMAP_HOST'] = 'imap.*******.**';
$config['IMAP_PORT'] = 143; // 993;
$config['IMAP_SSL'] = false; //true;

as you can see i've already tried to disable SSL, in both ways didn't work. In config-site.php there are nothing useful i think. I'm not able to find error neither in mail.err, mail.log, syslog How can i find some info about it? thank you, Alessandro

Comments (24)

  1. KP Basu

    vi /var/www/piler/config-site.php $config['ENABLE_IMAP_AUTH'] = 1; $config['IMAP_HOST'] = '192.168.30.171'; $config['IMAP_PORT'] = 993; $config['IMAP_SSL'] = true;

    THEN,

    su – piler pilerimport -i 192.168.30.171 -u <userid> -p <password> -P 993 sh /usr/local/libexec/piler/indexer.delta.sh sh /usr/local/libexec/piler/indexer.main.sh

  2. KP Basu

    vi /var/www/piler/config-site.php $config['ENABLE_IMAP_AUTH'] = 1; $config['IMAP_HOST'] = '192.168.30.171'; $config['IMAP_PORT'] = 993; $config['IMAP_SSL'] = true;

    THEN,

    su – piler pilerimport -i 192.168.30.171 -u <userid> -p <password> -P 993 sh /usr/local/libexec/piler/indexer.delta.sh sh /usr/local/libexec/piler/indexer.main.sh

  3. KP Basu

    vi /var/www/piler/config-site.php

    $config['ENABLE_IMAP_AUTH'] = 1;

    $config['IMAP_HOST'] = '192.168.30.171';

    $config['IMAP_PORT'] = 993;

    $config['IMAP_SSL'] = true;

    THEN,

    su – piler

    pilerimport -i 192.168.30.171 -u kp@tislabstech.com -p redhat -P 993

    sh /usr/local/libexec/piler/indexer.delta.sh

    sh /usr/local/libexec/piler/indexer.main.sh

  4. Janos SUTO repo owner

    First, check if your imap server supports plain text logins. Then check if you have @ in the username you use to login.

  5. Alessandro reporter

    change your HOST with servername/server ip and userid & password

    of course,

    check if your imap server supports plain text logins.

    yes, it does

    Then check if you have @ in the username you use to login. yep.

    may be i misunderstood how it works, i thought that the user is created at first login from GUI. from your answers now i suppose user it's created at first pilerimport execution, is it correct?

  6. Alessandro reporter

    what do the last 2 rows do?

    sh /usr/local/libexec/piler/indexer.delta.sh

    sh /usr/local/libexec/piler/indexer.main.sh

  7. Janos SUTO repo owner

    They index messages.

    "may be i misunderstood how it works, i thought that the user is created at first login from GUI. from your answers now i suppose user it's created at first pilerimport execution, is it correct?"

    No, not correct. Both the piler daemon and the pilerimport utility merely archive emails. They are not aware of any users or accounts. On the other hand, the GUI authenticates users by forwarding the login credentials to the configured auth backend (ie. ad, ldap, imap, ...), then figures out what email addresses and aliases the given account has, and applies a filter to prevent the user to see any emails not his own.

    To debug the imap authentication run ngrep to check the imap session between the piler host and the imap server. Verify that the login is actually successful.

  8. Alessandro reporter

    Yeah, pretty simplier! Today it's working..

    but.. this is the output from the indexers:

    root@cloud:~# sh /usr/local/libexec/piler/indexer.delta.sh
    /usr/local/libexec/piler/indexer.delta.sh: 18: /usr/local/libexec/piler/indexer.             delta.sh: function: not found
    /usr/local/libexec/piler/indexer.delta.sh: 20: /usr/local/libexec/piler/indexer.             delta.sh: Syntax error: "}" unexpected
    root@cloud:~# sh /usr/local/libexec/piler/indexer.main.sh
    /usr/local/libexec/piler/indexer.main.sh: 15: /usr/local/libexec/piler/indexer.main.sh: function: not found
    /usr/local/libexec/piler/indexer.main.sh: 17: /usr/local/libexec/piler/indexer.main.sh: Syntax error: "}" unexpected
    

    Is there some place to define where to find the needed library or function? thank you, Alessandro

  9. Janos SUTO repo owner

    Why do you run with sh ...? It's executable, run it as /usr/local/libexec/piler/indexer.delta.sh Btw. why are you running them as root? You shouldn't, let the piler user run it, from the crontab. You are messing the permissions.

  10. Alessandro reporter

    yep, you're right, i executed it right now as piler user, i don't know if it worked (i had no output back)

    this is the log in syslog:

    Oct  6 09:26:06 cloud piler-webui[4649]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('( @(subject,body)  verifiche ) &  (@from ------X------X--------X-- | @to  ------X------X--------X--) ') ORDER BY `sent` DESC LIMIT 0,1000 OPTION max_matches=1000' in 0.04 s, 0 hits, 29633 total found
    

    it's retrieving 29633 mails but none is returned in GUI

  11. Janos SUTO repo owner

    Just as I explained in the other topic, your sphinx installation is outdated. The docs says install 2.2.x, but you very likely have 2.0.x. Please do as the documentation says.

  12. Alessandro reporter

    ok, you were right (of course).. i've updated sphinx, now but it returns 0 rows, what have i to do? i suppose to have to rebuild indexes, but how? have i to remove old entries? and reimport all the mails? let me know please, anyway, thank you a lot for the support! Alessandro

    thi is the syslog:

    Oct  7 12:18:16 cloud piler-webui[4964]: sphinx query: 'SELECT id FROM main1,dailydelta1 WHERE        MATCH('( @(subject,body)  verifica ) &  (@from ------X------X--------X--| @to ------X------X--------X--) ') ORDER BY `sent` DESC LIMIT 0,1000 OPTION max_matches=1000' in 0.00 s, 0 hits, 0 total found
    
    Oct  7 12:36:05 cloud piler-webui[16152]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('( @(subject,body)  verifica ) &  (@from  ------X------X--------X-- | @to  ------X------X--------X--) ') ORDER BY `sent` DESC LIMIT 0,1000 OPTION max_matches=1000' in 0.00 s, 0 hits, 0 total found
    

    the first log was made without the delta1 index count, the second with.

  13. Janos SUTO repo owner

    Check how many entries you have in sphinx. If none or don't know, then reindex is a safe bet.

  14. Alessandro reporter

    how can i check in sphinx? I've checked in mysql table "metadata" and there are 292101 rows (all the mail previously imported)

    so can you tell me the exact commands to reindex them? i already tried: indexer.main.sh indexer.delta.sh also indexer --all and the following is the output:

    root@cloud:~# indexer --all
    Sphinx 2.2.11-id64-release (95ae9a6)
    Copyright (c) 2001-2016, Andrew Aksyonoff
    Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
    
    using config file '/etc/sphinxsearch/sphinx.conf'...
    indexing index 'test1'...
    ERROR: index 'test1': sql_query: Table 'piler.documents' doesn't exist (DSN=mysql://piler:***@localhost:3306/piler).
    total 0 docs, 0 bytes
    total 0.002 sec, 0 bytes/sec, 0.00 docs/sec
    indexing index 'test1stemmed'...
    ERROR: index 'test1stemmed': sql_query: Table 'piler.documents' doesn't exist (DSN=mysql://piler:***@localhost:3306/piler).
    total 0 docs, 0 bytes
    total 0.000 sec, 0 bytes/sec, 0.00 docs/sec
    skipping non-plain index 'dist1'...
    skipping non-plain index 'rt'...
    total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
    total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
    
  15. eXtremeSHOK

    @dirtydozen666 what do you think this means ?

    ERROR: index 'test1stemmed': sql_query: Table 'piler.documents' doesn't exist (DSN=mysql://piler:***@localhost:3306/piler).
    

    hint" Table 'piler.documents' doesn't exist

  16. Alessandro reporter

    of course i saw it and of course i know what it means. but i don't know how the schema of table is, how to recreate it and above all why it's not been created as all otehrs table! tnx

  17. Janos SUTO repo owner

    The indexer tries to use the default config, however it's not the piler shipped sphinx.conf. I suggest that please read the documentation, even the faq to get familiar with the concepts, how piler uses the mysql database, sphinxsearch, what indexer --all and reindex are for, etc. Then if you still have questions, let me know, and I'll help.

  18. Alessandro reporter

    thank you Janos, i'll do, i appreciate a lot your work, and i try to solve my problem by myself but, at beginning it's not quite easy to have a clear road map to follow... so it can end in too many question.. Alessandro

  19. Janos SUTO repo owner

    Any questions still unclear after reading the docs are welcome. I consider them as signs to improve the docs.

  20. Log in to comment