Outils pour utilisateurs

Outils du site


tips:fetchmail:marquage

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tips:fetchmail:marquage [2006/12/12 20:10] – créée naztips:fetchmail:marquage [2007/04/27 19:03] (Version actuelle) naz
Ligne 1: Ligne 1:
 +Comment faire pour distinguer de quel compte provient un mail si on utilise [[http://catb.org/~esr/fetchmail/|fetchmail]] pour relever plusieurs comptes :
 +
 +  * [[http://www-inf.int-evry.fr/~olberger/oldblog/040629.html|Olivier Berger]] propose dans son blog du 29/06/2004 d'utiliser l'option ''tracepolls'' de [[http://catb.org/~esr/fetchmail/|fetchmail]] :\\
 +
 +> If you use fetchmail with multiple mail sources / accounts polled, it may be handful to distinguish between these different sources for filtering in your email reader.
 +> To do this, you may use fetchmail's option "tracepolls" like in :
 +> <code>
 +poll imap.provider.domain with proto IMAP and options tracepolls
 +user 'mailaccount' there is 'you' here ssl
 +</code>
 +> It then adds a header of the form :
 +
 +> <code>Received: from fetchmail.provider.domain [192.168.0.1]
 +by localhost with IMAP (fetchmail-5.9.11 polling imap.provider.domain account mailaccount)
 +for you@localhost (single-drop); Tue, 29 Jun 2004 14:25:49 +0200 (CEST)
 +</code>
 +> You may then filter it with procmail/formail in order to add a specific header that your email reader will be able to identify more easily. For example, you may add a "X-fetchmailtracepoll" header. Excerpt from .procmailrc :
 +> <code>
 +:0fhw
 +* ^received: .*fetchmail-.* polling imap.provider.domain account mailaccount
 +| formail -I "X-fetchmailtracepoll: provider"
 +</code>
 +> Then all you have to do is declare a filter on the "X-fetchmailtracepoll: provider" header in the mail client. 
 +
 +===== Mon cas =====
 +
 +Avec ma conf, je veux filtrer directement au delivery avec sieve donc j'utilise bien la directive de fetchmail ''and options tracepolls''
 +et mon filtre sieve donne ça : <code sieve>require "fileinto";
 +
 +if header :contains "received" ["polling pop.myaccount.tld account myaccount"] {
 +  fileinto "myaccount-folder";
 +}
 +</code>