Hello,

We have installed Piler 1.3.10 and we cannot get imap importing (Lotus
Domino server) from GUI. Here is what we have been able to trackdown so far:

1 - In read_folder_list we had to decode to utf-8  the case for the tupple
type. A type missmatch error would occur otherwise:

        elif isinstance(folder, type(())):
            folder = re.sub(r'\{\d+\}$', '', folder[0].decode('utf-8')) +
folder[1].decode('utf-8')

2 - Domino's Imap server returns a backslash the field separator:

[b'(\\Noinferiors \\HasNoChildren) "\\\\" Inbox', b'(\\Noinferiors
\\HasNoChildren) "\\\\" Trash', b'(\\HasNoChildren) "\\\\" Drafts',
b'(\\HasNoChildren) "\\\\" Sent']

Which does not match against the exiting regexp in read_folder_list in
imapfetch.py. This is fixed adding the backslash to the regexp:  f =
re.split(r' \"[\/\.\\]+\" ', folder)

3 - We are using python 2.7.5 under Centos 7.9.2009 which seens to have a
bug in imaplib's _checkquote(), which prevents folder names with special
characters from being correctly escaped making imapfetch.py to fail. We
fixed this by using a  sane _checkquote() version from a previous imaplib.
Maybe there is a cleaner solution ...

    result.append(_checkquote(conn, f[1]))

4 - In process_folder, empty emails will fail when trying to write to disk.
This is fixed by checking for a tupple:

        for num in data[0].split():
            rc, data = conn.fetch(num, '(RFC822)')
            if opts['verbose']:
                print(rc, num)
            if isinstance(data[0], tuple):
                opts['counter'] += 1
                with open("{}.eml".format(opts['counter']), "wb") as f:
                    f.write(data[0][1])

We could make it work with these changes, but pilerimport -T does not seem
to mark the fields 'updated' or 'finished' in the import table, so
subsequent executions of import.sh starts the whole process again (failing
the import due to duplicates).

Hope this helps to fix the issues.

Regards

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Reply via email to