Procmail Regex

Discussion in 'Computer Support' started by Indo Geek, May 11, 2007.

  1. Indo Geek

    Indo Geek Guest

    Hi All,

    Right now I have a global account which reside in my ISP's server, and
    I twice a day get all my emails using fetchmail + cron and delivered
    them to each mailbox using procmail.

    Right now I'm using an abundant rules to check agains 'To' and
    'Received' header from incoming mails as shown below

    ====================
    :0
    * ^To:.+a@domain\.com
    !

    :0
    * ^Received:.+a@domain\.com
    !

    :0
    * ^To:.+a@domain\.com
    !

    :0
    * ^Received:.+a@domain\.com
    !

    ..
    ..
    ..
    ..
    ====================

    This rule is very inefficient. As I create new user, I have to add two
    additional rule entry. Is there any regex alternative to my problem ?

    Thanks,

    Dino
     
    Indo Geek, May 11, 2007
    #1
    1. Advertising

  2. Indo Geek

    Indo Geek Guest

    Sorry,

    Wrongly typed my rules. The problem is specified below. Please advice.

    Regards,

    Feris

    On May 11, 12:12 pm, Indo Geek <> wrote:
    > Hi All,
    >
    > Right now I have a global account which reside in my ISP's server, and
    > I twice a day get all my emails using fetchmail + cron and delivered
    > them to each mailbox using procmail.
    >
    > Right now I'm using an abundant rules to check agains 'To' and
    > 'Received' header from incoming mails as shown below
    >
    > ====================
    > :0
    > * ^To:.+a@domain\.com
    > !
    >
    > :0
    > * ^Received:.+a@domain\.com
    > !
    >
    > :0
    > * ^To:.+b@domain\.com
    > !
    >
    > :0
    > * ^Received:.+b@domain\.com
    > !
    >
    > .
    > .
    > .
    > .
    > ====================
    >
    > This rule is very inefficient. As I create new user, I have to add two
    > additional rule entry. Is there any regex alternative to my problem ?
    >
    > Thanks,
    >
    > Dino
     
    Indo Geek, May 11, 2007
    #2
    1. Advertising

  3. Indo Geek

    why? Guest

    On 10 May 2007 22:19:49 -0700, Indo Geek wrote:

    >Sorry,
    >
    >Wrongly typed my rules. The problem is specified below. Please advice.


    Not knowing the procmail syntax (you seen to however) I would start with
    www.google.com and the subject of your mesage -

    procmail regex

    Web Results 1 - 10 of about 454,000 for procmail regex. (0.18 seconds)

    Regular Expressions - Procmail Mail Filtering Syntax
    To summarize, all of the above are "magic" characters or "operators" in
    procmail's regular expression language which have special meaning. ...
    www.perlcode.org/tutorials/procmail/regular_expressions.pod - 18k -
    Cached - Similar pages

    perlcode.org - proctut: procmail tutorials
    Procmail regular expression basics, including the dot character, and
    quantifiers, including the question mark, asterisk, and plus sign. ...
    www.perlcode.org/tutorials/procmail/proctut/ - 6k - Cached - Similar
    pages
    [ More results from www.perlcode.org ]

    Procmail Tutorial
    Make sure you put the "*" in front of each regex. One thing the procmail
    man pages tell you to do is use From:.* as your expression to search for
    a sender. ...
    http://pegasus.rutgers.edu/~elflord/unix/procmail.html - 13k - Cached -
    Similar pages

    Procmail How-To Page
    This comprises most of the special characters that Procmail uses in
    regular expressions. There are a few others, but the manual pages for
    egrep and ...
    http://userpages.umbc.edu/~ian/procmail.html - 23k - Cached - Similar
    pages

    Is it really a regex or procmail issue needing 2 lines?

    :0
    * ^To:.+b@domain\.com
    !

    :0
    * ^Received:.+b@domain\.com
    !

    If it's just the To and Received, or is it something else you want to
    shorten you didn't say?

    To|Received

    Then I read the info on the 1st link below, or as it says the procmailrc
    manpage - which you did read already, mayne not even the many online
    procmail pages?

    de|abc Either the sequence `de' or `abc'.

    After that you may want to - TtRr or some flag to ignore case anyway.


    >Regards,
    >
    >Feris
    >
    >On May 11, 12:12 pm, Indo Geek <> wrote:
    >> Hi All,
    >>
    >> Right now I have a global account which reside in my ISP's server, and
    >> I twice a day get all my emails using fetchmail + cron and delivered
    >> them to each mailbox using procmail.
    >>
    >> Right now I'm using an abundant rules to check agains 'To' and
    >> 'Received' header from incoming mails as shown below
    >>
    >> ====================
    >> :0
    >> * ^To:.+a@domain\.com
    >> !
    >>
    >> :0


    <snip>

    Me
     
    why?, May 11, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ConTactMe

    matches regex?

    ConTactMe, Dec 15, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    2,727
    Livewire
    Dec 15, 2003
  2. Replies:
    0
    Views:
    466
  3. Shane

    Procmail

    Shane, Jan 13, 2006, in forum: NZ Computing
    Replies:
    2
    Views:
    564
    Shane
    Jan 14, 2006
  4. Bob Larter is Lionel Lauer - Look it up.

    Re: Colour recovery [Was: Regex and more! [Was: Crossword puzzle]]

    Bob Larter is Lionel Lauer - Look it up., Nov 11, 2009, in forum: Digital Photography
    Replies:
    4
    Views:
    497
    Bob Larter
    Nov 11, 2009
  5. Rob
    Replies:
    2
    Views:
    835
    Igor Mamuzić aka Pseto
    Aug 2, 2010
Loading...

Share This Page