doc:appunti:linux:sa:imap
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:sa:imap [2021/03/08 18:44] – [offlineimap] niccolo | doc:appunti:linux:sa:imap [2024/03/20 17:48] – niccolo | ||
---|---|---|---|
Line 41: | Line 41: | ||
a6 OK FETCH completed. | a6 OK FETCH completed. | ||
a7 LOGOUT | a7 LOGOUT | ||
+ | </ | ||
+ | |||
+ | Some IMAP servers present all the folders as subfolders of the INBOX: | ||
+ | |||
+ | < | ||
+ | a3 LIST "" | ||
+ | * LIST (\HasNoChildren) | ||
+ | * LIST (\HasNoChildren) | ||
+ | * LIST (\HasNoChildren) | ||
+ | * LIST (\Marked \HasChildren) " | ||
+ | a4 CREATE INBOX.Archive | ||
+ | a5 LIST "" | ||
+ | </ | ||
+ | |||
+ | For other IMAP servers, the folders are outside the INBOX: | ||
+ | |||
+ | < | ||
+ | a3 LIST "" | ||
+ | * LIST (\HasNoChildren) | ||
+ | * LIST (\HasNoChildren \Drafts) | ||
+ | * LIST (\HasNoChildren \UnMarked \Sent) " | ||
+ | * LIST (\HasNoChildren \Trash) | ||
+ | * LIST (\HasNoChildren) | ||
+ | a4 CREATE Archive | ||
</ | </ | ||
Line 49: | Line 73: | ||
Sincronizza una cartella su server **IMAP remoto** con una **Maildir locale** oppure un altro **server IMAP**. Sembra il programma più flessibile e semplice da utilizzare rispetto a **isync**, **mailsync**, | Sincronizza una cartella su server **IMAP remoto** con una **Maildir locale** oppure un altro **server IMAP**. Sembra il programma più flessibile e semplice da utilizzare rispetto a **isync**, **mailsync**, | ||
- | La versione | + | **ATTENZIONE** :!: Le versioni |
+ | |||
+ | **ATTENZIONE** :!: La versione | ||
- | **ATTENZIONE** :!: Il programma | + | **ATTENZIONE** :!: Il programma |
Pertanto, prima di iniziare la sincronizzazione, | Pertanto, prima di iniziare la sincronizzazione, | ||
Line 78: | Line 104: | ||
remotepass = MySecret | remotepass = MySecret | ||
createfolders = False | createfolders = False | ||
- | sslcacertfile = / | + | sslcacertfile = / |
+ | ssl_version = tls1_2 | ||
+ | # If you don't want IMAPS on port 993, you can use STARTTLS on port 143. | ||
+ | #ssl = no | ||
+ | #starttls = yes | ||
[Repository Localhost] | [Repository Localhost] | ||
Line 84: | Line 114: | ||
localfolders = / | localfolders = / | ||
</ | </ | ||
+ | |||
+ | Per impostazione predefinita offlineimap tenta una connessione **SSL** su porta **993/ | ||
+ | |||
+ | < | ||
+ | offlineimap.error.OfflineImapError: | ||
+ | You must configure at least something, otherwise having SSL helps nothing. | ||
+ | </ | ||
+ | |||
+ | Per vedere quale Certification Authority deve essere usata è necessario recuperare il certificato SSL dal server remoto, ad esempio con il comando: | ||
+ | |||
+ | < | ||
+ | openssl s_client -showcerts -connect mail.example.org: | ||
+ | </ | ||
+ | |||
+ | Quindi si ispeziona la **certificate chain** alla ricerca di **O**rganization e **C**ommon **N**ame con valori del tipo: | ||
+ | |||
+ | * O = Actalis S.p.A., CN = Actalis Organization Validated Server CA G3 | ||
+ | * O = Let's Encrypt, CN = R3 | ||
+ | |||
+ | Avendo installato il pacchetto **ca-certificates**, | ||
+ | |||
+ | < | ||
+ | [SSL: DH_KEY_TOO_SMALL] dh key too small (_ssl.c: | ||
+ | </ | ||
+ | |||
+ | Questo significa che il server utilizza una versione debole di SSL, vulnerabile ad attacchi del tipo //Factoring RSA Export Keys// poiché usa una chiave Diffie-Hellman più corta di 768 byte. In questo caso, se non possiamo correggere il server, è necessario aggiungere l' | ||
+ | |||
+ | Se si desidera utilizzare una connessione con STARTTLS su porta 143, è necessario aggiungere le opzioni '' | ||
Si esegue il programma in modalità **%%--info%%**, | Si esegue il programma in modalità **%%--info%%**, | ||
Line 141: | Line 199: | ||
remoteuser = username1 | remoteuser = username1 | ||
remotepass = MySecret1 | remotepass = MySecret1 | ||
+ | createfolders = False | ||
sslcacertfile = / | sslcacertfile = / | ||
Line 181: | Line 240: | ||
Si capisce che i due server IMAP utilizzano una struttura diversa: il primo ha il prefisso '' | Si capisce che i due server IMAP utilizzano una struttura diversa: il primo ha il prefisso '' | ||
- | === Altro === | + | === Sincronizzazione |
- | Creare un file di configurazione **'' | + | La sincronizzazione avviene semplicemente eseguendo il comando con l' |
- | + | ||
- | < | + | |
- | [general] | + | |
- | accounts = Test | + | |
- | + | ||
- | [Account Test] | + | |
- | localrepository = Local | + | |
- | remoterepository = Remote | + | |
- | + | ||
- | [Repository Local] | + | |
- | type = Maildir | + | |
- | localfolders = / | + | |
- | # If the remote IMAP is a Lotus Domino, remove the **'' | + | |
- | #nametrans = lambda foldername: re.sub('^\.*', '', | + | |
- | + | ||
- | [Repository Remote] | + | |
- | type = IMAP | + | |
- | # Remote server is Courier-IMAP, strip the " | + | |
- | nametrans = lambda foldername: re.sub(' | + | |
- | # Remote server is Lotus Domino, add an " | + | |
- | #nametrans = lambda foldername: ' | + | |
- | remotehost = mail.host1.it | + | |
- | remoteuser = user1 | + | |
- | remotepass = password1 | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | + | ||
- | quindi eseguire | + | |
< | < | ||
- | offlineimap -1 -c offlineimap.conf -d imap, | + | offlineimap -1 -c offlineimap-imap-imap.conf -d imap, |
</ | </ | ||
* Lo stato della sincronizzazione viene scritto in **'' | * Lo stato della sincronizzazione viene scritto in **'' | ||
* La '' | * La '' | ||
- | * L' | + | * Potrebbe essere necessario specificare l' |
- | * L' | + | |
- | * La versione | + | === Soluzione problemi === |
- | * Con la versione **6.5.4** i messaggi importati hanno **mode 0755**, usare la versione **6.5.5**. | + | |
+ | Vedere | ||
==== isync ==== | ==== isync ==== |
doc/appunti/linux/sa/imap.txt · Last modified: 2024/03/21 12:56 by niccolo