Actions
Feature #7660
openIMAP: import mails to DB, move / delete mails
Start date:
17.01.2019
Due date:
% Done:
0%
Estimated time:
Discuss:
Prio Planung:
Yes
Vote:
CR
Description
Es waere gut wenn QFQ auf Mails via IMAP zugreifen koennten.
- Sync als Daemon laufen lassen,
- Eingehende Mails automatisch in 'INSERT...' Statements verwandelt.
- Folder 'Inbox' und 'Sent' (falls via Mailprogramm versendet wurde kann so ein Thread aufgebaut werden).
- Mails nach 'done' verschieben.
- Neue Mail ablegen (eine Mail die gesendet wurde soll in den Send Folder)
- Wenn die Mails in der DB sind (ggfs.mit Attachment) koennen sie dort angezeigt.
PHP¶
- https://www.php-imap.com/ (incl. oauth2)
- https://github.com/barbushin/php-imap
- Doku um PHP IMAP selber zu implementieren: https://www.toptal.com/php/building-an-imap-email-client-with-php
Fuer Outlook / OAuth 2¶
- https://github.com/Webklex/php-imap/issues/264
- https://www.php-imap.com/examples/oauth
- https://github.com/Molnix-open-source/BouncedMailManager/blob/main/src/Clients/O365Client.php (ist gelistet als eines von 500 Projekten die php-imap nutzen)
- https://github.com/javanile/php-imap2
Python¶
- imaplib (https://docs.python.org/3/library/imaplib.html) * https://coderzcolumn.com/tutorials/python/imaplib-simple-guide-to-manage-mailboxes-using-python * https://coderslegacy.com/python/imap-read-emails-with-imaplib/
- https://imapclient.readthedocs.io/en/3.0.1/
Irgendwie machen mir die Posts den Eindruck als wenn imaplib nicht wirklich sinnvoll ist, wenn das Thema gegoodled wird kommen nur alte Posts zum vorschein.
- https://stackoverflow.com/questions/28776250/move-mail-in-imap-with-python-library
- https://stackoverflow.com/questions/2230037/how-to-fetch-an-email-body-using-imaplib-in-python
- https://stackoverflow.com/questions/25234862/how-to-copy-email-in-inbox-into-important-mailbox-with-imaplib
IMAP best practice¶
- https://www.atmail.com/blog/imap-101-manual-imap-sessions/
- https://www.atmail.com/blog/advanced-imap/ (u.a. UID und APPEND)
- https://www.atmail.com/blog/imap-commands/
- https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol
MAPI (exchange)¶
- https://www.phpflow.com/php/how-to-read-inbox-mails-from-exchange-server/
- https://www.phpflow.com/php/how-to-connect-exchange-server-with-php/
- https://github.com/hfig/MAPI
Outdated¶
Updated by Carsten Rose almost 5 years ago
- Target version changed from 141 to QFQCD19 - waere gut
Updated by Carsten Rose over 4 years ago
- Status changed from New to Some day maybe
Updated by Carsten Rose over 4 years ago
- Status changed from Some day maybe to New
Updated by Carsten Rose about 4 years ago
- Target version changed from QFQCD19 - waere gut to next6
Updated by Carsten Rose over 1 year ago
- Description updated (diff)
- Target version changed from next6 to 24.10.0
- Prio Planung set to Yes
Updated by Carsten Rose over 1 year ago
- Target version changed from 24.10.0 to 411
Updated by Carsten Rose 3 months ago
- Status changed from ToDo to In Progress
- Versuch mit https://www.php-imap.com/ anzufangen.
- php-imap scheint aktiv entwickelt zu werden.
Die aktuelle Version 5.5.0 kann noch nicht installiert werden, da PHP8.0 vorausgesetzt wird.Im aktuellen Docker Container und der zugeordnete gitlab runner hat noch PHP 7.4Die hoechste Version die mit PHP 7.4 arbeitet ist php-imap 4.1.2.Achtung: In php-imap Version 5.3 (https://github.com/Webklex/php-imap/blob/5.5.0/CHANGELOG.md#530---security-patch---2023-06-20) wurde ein CVE mit Score 9 gefixt. Bevor wir releasen sollte auf 5.5 aktualisiert werden.- Via nativem IMAP APPEND command koennen Mails angelegt werden - php-imap sollte man erweitern koennen.
- Evtl. kann ein Daemon Mode entwickelt werden der asynchron/parallel Anfragen versendet um mehr Speed rauszuholen.
- In der Doku scheinen nicht alle Funktionen beschrieben zu sein. D.h. im Quellcode schauen was es alles gibt.
Features¶
- Via Parameter Liste aller Folder ausgeben.
- In QFQ Config pro Account welche Folder gesynct werden sollen.
Verbesserungen php-imap:¶
- In der Doku:
- Link zur Konfigurariontsdatei imap.php
- Das Account Array beschreiben
- Tote Links fuer oauth2
- Angaben zur Performance (Zimbra, gmail, gmx, hotmail, outlook) - Vergleich mit Thunderbird, fetchmail.
- Features
APPEND (Mail anlegen)Folder->appendMessage- Asynchron/parallele Zugriffe
Updated by Carsten Rose 3 months ago
- Description updated (diff)
Nach einer ersten Durchsicht von php-imap
- + benotigt nicht das PHP IMAP Modul (soll buggy sein)
- - keine Moeglickeit gefunden Mails abzulegen. Bsp: es soll eine Mail versendet werden und diese soll im Sent Folder gespeichert werden.
Roadmap
- Aktuell noch nicht als Daemon, damit man gut im Debugger testen kann.
Konfiguration umbauen das diese in Files ist.- Grundsaetzlich werden es nicht viele Accounts sein die pro Tool zu konfigurieren sind.
- Mit Files muessen wir uns weniger Gedanken ueber ein UI oder Verschluesselung des Passworts machen.
Performance Tests- Viele Mails einlesen - falls das sehr langsam ist: auch einen Abgleich testen.
- Zimbra/php-imap: Mailbox mit 25 Mails braucht 2.2 Sekunden.
- Zahlen in eckigen Klammern sind die Anzahl
Start 0.000085 ClientManager 0.001426 account 0.001690 connect 0.026496 getFolders [10] 0.015041 $folder->messages()->all()->get(); - Drafts [5] 0.227234 $folder->messages()->all()->get(); - INBOX [6] 0.462225 $folder->messages()->all()->get(); - Sent [25] 2.249366
- oAuth2 testen (Outlook).
- IDLE implementieren.
Actions