Re: Learning procmail



Paul Michael Reilly wrote:
Justin Willmert <justin@xxxxxxxxxx> writes:

> Paul Michael Reilly wrote:
> > I have begun the process of learning how to use procmail to filter
> > incoming mail messages. I see that Fedora embeds procmail into the
> > sendmail configuration files. What I would like to do is either find
> > some kind of tutorial or some mechanism that I can use to bootstrap my
> > knowledge by doing something and seeing some result, most likely in a
> > log file (and eventually in a mail buffer). Any suggestions?
> >
> > Thanks
> >
> > -pmr
> >
> > > I use procmail to filter this mailing list into its own IMAP folder. If > you are using IMAP, I'd be happy to send you my configuration files. > It's a really simple filter and you should get results immediately (due > to the high traffic volume this list gets).

Certainly. I am using IMAP and the idea of putting the Fedora messages
(and others) into their own folders sounds like a winner to me.

Thanks,

-pmr

This is a section of my ~/.procmailrc file:

# Filter Fedora List Messages
:0
* ^TO_fedora-list@xxxxxxxxxx
.INBOX.fedora-list/

First line is a comment. The second gives parameter information to procmail (look in procmail's man page to see the different options available. I mostly only ever use :0 though). The next line is the rule and says if a mail header begins with a "TO" type header (To, cc, bcc, etc.) with fedora-list@xxxxxxxxxx in the list of addresses, that this rule matches (is true). Then the next line is which mail folder it should move it to. In this instance, my Dovecot server separates folders with a period, so an Inbox subdirectory is INBOX.fedora-list. The trailing slash signals that I'm using mail folders and not mail boxes.

I'm not a procmail expert, so if I've gotten any explanation wrong, I'd be happy if someone corrected me, but I just know that this works to sort my mail.

If you don't already know how to write regex expressions, take the time to learn them. I didn't understand them at first, but once I understood them, I find myself wishing many more tools let me use regex expressions. Procmail uses regex matching rules, so you can theoretically create some very complex rules.

Have fun,
Justin

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: [SLE] Copy spool mail files?
    ... Knowing next to nil about imap, this is as close as I can come: ... Postfix is a mail transfer agent which handles SMTP ... Procmail is used to actually deliver the email, ... SpamAssassin is a spam email filter. ...
    (SuSE)
  • Re: procmail recipe for a given message body
    ... Some of you experienced with procmail hopefully can help me out ... to filter these messages out. ... recipe for that. ... filter messages based on regular expression matches on the "body" ...
    (comp.unix.bsd.freebsd.misc)
  • Re: netiquette: CCing on lists
    ... > charity of the mailing list posters to ca= ter to their reply whims. ... the duplicate check filter can be found in the ... > procmail-lib Debian package, or I can mail a copy to you offlist. ... this, I don't receive the dupes through my spool, so procmail won't do ...
    (Debian-User)
  • Re: Question about Kmail filters
    ... server a copy of the downloaded mail. ... I would like to set up a filter that: ... You setup fetchmail to fetch the mail for your from the pop account (if you have other mailboxes, you can let it to fetch them all) and deliver the mail to procmail for local delivery. ...
    (comp.windows.x.kde)
  • Re: Learning procmail
    ... # Filter Fedora List Messages ... and says if a mail header begins with a "TO" type header (To, cc, bcc, ... I'm not a procmail expert, so if I've gotten any explanation wrong, I'd ... so it doesn't get caught by the filter - allowing me to see it ...
    (Fedora)