Difference between revisions of "Fetchmail"

From YobiWiki
Jump to navigation Jump to search
m
m
Line 20: Line 20:
 
su fetchmail -c "fetchmail -f /etc/fetchmailrc -v -v -N"
 
su fetchmail -c "fetchmail -f /etc/fetchmailrc -v -v -N"
   
==Fetchyahoo==
+
==Troubleshooting==
  +
Lorsqu'on rencontre une erreur du style:
  +
9 messages pour acount_name dans mail.teledisnet.be (47569 octets).
  +
fetchmail: erreur protocole client/serveur durant la réception de mail.teledisnet.be
  +
fetchmail: État de la requête=4 (PROTOCOLE)
  +
  +
Un fetchmail -v donne :
  +
fetchmail: POP3> TOP 1 99999999
  +
fetchmail: POP3< -ERR No more than 0 lines can be retrieved with TOP command
  +
fetchmail: No more than 0 lines can be retrieved with TOP command
  +
  +
l'histoire c'est que le provider en question ici teledisnet n'accepte plus la commande TOP 1 999999 et il faut donc forcer fetchmail à utiliser la commande RETR
  +
  +
Il suffit simplement d'ajouter dans le fichier ~/.fetchmailrc le mot fetchall en fin de la dernière ligne
  +
  +
Exemple :
  +
  +
poll mail.teledisnet.be with proto POP3
  +
user 'acount_name' there with password 'XXXXXXXX' is 'dorian' here fetchall
  +
  +
==Installation de Fetchyahoo==
 
apt-get install fetchyahoo
 
apt-get install fetchyahoo
 
andrea@olympe:~$ cp /usr/share/doc/fetchyahoo/examples/fetchyahoorc ~/.fetchyahoorc
 
andrea@olympe:~$ cp /usr/share/doc/fetchyahoo/examples/fetchyahoorc ~/.fetchyahoorc

Revision as of 01:15, 25 November 2006

Installation de Fetchmail

apt-get install fetchmail

installer un fichier /etc/fetchmailrc comme celui-ci:

fetchmailrc

Exemple de /etc/fetchmailrc:

set postmaster "fetchmail"
set nobouncemail
set no spambounce
set properties ""
set daemon 120

poll courriel.latribu.com with proto IMAP
       user 'xxxx.xxxx@latribu.com' there with password 'xxxx' is 'phil' here fetchall
poll mail.hellea.be with proto IMAP and with interval 5
       user 'xxxx' there with password 'xxxx' is 'phil' here fetchall ssl sslfingerprint  "24:96:59:5C:A2:D0:60:14:FA:CD:66:32:40:CC:CA:1D"

Pour avoir les sslfingerprints:

su fetchmail -c "fetchmail -f /etc/fetchmailrc -v -v -N"

Troubleshooting

Lorsqu'on rencontre une erreur du style:

9 messages pour acount_name dans mail.teledisnet.be (47569 octets).
fetchmail: erreur protocole client/serveur durant la réception de mail.teledisnet.be
fetchmail: État de la requête=4 (PROTOCOLE)

Un fetchmail -v donne :

fetchmail: POP3> TOP 1 99999999
fetchmail: POP3< -ERR No more than 0 lines can be retrieved with TOP command
fetchmail: No more than 0 lines can be retrieved with TOP command

l'histoire c'est que le provider en question ici teledisnet n'accepte plus la commande TOP 1 999999 et il faut donc forcer fetchmail à utiliser la commande RETR

Il suffit simplement d'ajouter dans le fichier ~/.fetchmailrc le mot fetchall en fin de la dernière ligne

Exemple :

poll mail.teledisnet.be with proto POP3
user 'acount_name' there with password 'XXXXXXXX' is 'dorian' here fetchall

Installation de Fetchyahoo

apt-get install fetchyahoo
andrea@olympe:~$ cp /usr/share/doc/fetchyahoo/examples/fetchyahoorc ~/.fetchyahoorc
andrea@olympe:~$ echo "0,15,30,45 6-23 * * * /usr/bin/fetchyahoo"|crontab -u andrea -

Édition d'une copie de /usr/share/doc/fetchyahoo/examples/fetchyahoorc dans ~/.fetchyahoorc

fetchyahoorc

Username et password évidemment

username = yahoo_user_name
password = XXXXXXXX

On choisit de délivrer dans un Maildir (veiller à finir la ligne par le "/" !!)

use-spool = 1
spool = /home/andrea/Maildir/.Yahoo/
spool-mode = append

Ou alors on délivre via procmail:

use-spool = 1
spool = procmail
spool-mode = pipe

Théoriquement on peut reprendre jusquà 100 messages mais on a déjà eu une erreur à 97 alors autant rester safe

max-messages = 80

On le lancera depuis un cron donc on évite d'avoir un output en temps normal

quiet = 1

On vide le répertoire Bulk qui ne contient jamais rien d'intéressant...

empty-bulk = 1

Il semble plus sûr de se déconnecter après coup.

logout = 1