Loading ...
Sorry, an error occurred while loading the content.

Re: email tracking from postfix log file

Expand Messages
  • postfix
    As perl contains the most complete regular expression implementation, you may as well go into the perl tutorial for regular expressions:
    Message 1 of 12 , Jun 1, 2011
    • 0 Attachment
      As perl contains the most complete regular expression implementation,
      you may as well go into the perl tutorial for regular expressions:

      http://perldoc.perl.org/index-tutorials.html

      suomi

      On 2011-06-01 10:31, kshitij mali wrote:
      > Thank u ralf
      > Can u please give me link for learn regular experssion
      > all alway get complex reqirement to track the postfix log more oftenly
      > which will help
      > me .
      > for example 1. how many email got dilver from one intenal user for
      > certain domain in last 5 hrs
      > 2. how many email got deliver from one user to
      > external domains for last 3 week
      > etc
      > Regards,
      > Kshitij
      >
      > On Wed, Jun 1, 2011 at 1:27 PM, Ralf Hildebrandt
      > <Ralf.Hildebrandt@... <mailto:Ralf.Hildebrandt@...>> wrote:
      >
      > * kshitij mali <foreplayboy@... <mailto:foreplayboy@...>>:
      > > I want to list email send to the domain gmail.com
      > <http://gmail.com/> how to achive it
      > >
      > >
      > > cat /var/log/maillog | grep -i cleanup | egrep 'to=<*@...
      > <http://gmail.com/>'
      > >
      > > where * = all user of gmail.com <http://gmail.com/> domain i think
      > >
      > > is the above reular expression is correct ?
      >
      > No.
      >
      > egrep 'postfix/cleanup.*to=<.*@... <http://gmail.com/>>'
      > /var/log/maillog
      >
      > --
      > Ralf Hildebrandt
      > Geschäftsbereich IT | Abteilung Netzwerk
      > Charité - Universitätsmedizin Berlin
      > Campus Benjamin Franklin
      > Hindenburgdamm 30 | D-12203 Berlin
      > Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
      > ralf.hildebrandt@... <mailto:ralf.hildebrandt@...> |
      > http://www.charite.de <http://www.charite.de/>
      >
      >
    • Duane Hill
      ... I also use: http://www.regular-expressions.info/ -- Duane
      Message 2 of 12 , Jun 1, 2011
      • 0 Attachment
        Wednesday, June 1, 2011, 3:33:41 AM, Ralf wrote:

        > * kshitij mali <foreplayboy@...>:
        >> Thank u ralf
        >>
        >> Can u please give me link for learn regular experssion

        > The best book is:
        > http://oreilly.com/catalog/9780596002893
        > (IMHO of course)

        I also use:

        http://www.regular-expressions.info/

        --
        Duane
      • kshitij mali
        Hi , how to trace email from particular domain i want to trace all log from yahoo.com cat /var/log/maillog | egrep -i from=
        Message 3 of 12 , Feb 9, 2012
        • 0 Attachment
          Hi ,

          how to trace email from particular domain i want to trace all log from yahoo.com

          cat /var/log/maillog | egrep -i 'from=<*@yahoo.com'

          the above commad is not working properly pls some help me with regular expression


          Regards
          kshitij

          On Wed, Jun 1, 2011 at 6:07 PM, Duane Hill <duane@...> wrote:
          Wednesday, June 1, 2011, 3:33:41 AM, Ralf wrote:

          > * kshitij mali <foreplayboy@...>:
          >> Thank u ralf
          >>
          >> Can u please give me link for learn regular experssion

          > The best book is:
          > http://oreilly.com/catalog/9780596002893
          > (IMHO of course)

          I also use:

           http://www.regular-expressions.info/

          --
           Duane


        • Ralf Hildebrandt
          ... cat /var/log/maillog | egrep -i from= -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin
          Message 4 of 12 , Feb 9, 2012
          • 0 Attachment
            * kshitij mali <foreplayboy@...>:
            > Hi ,
            >
            > how to trace email from particular domain i want to trace all log from
            > yahoo.com
            >
            > cat /var/log/maillog | egrep -i 'from=<*@...'

            cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>'

            --
            Ralf Hildebrandt
            Geschäftsbereich IT | Abteilung Netzwerk
            Charité - Universitätsmedizin Berlin
            Campus Benjamin Franklin
            Hindenburgdamm 30 | D-12203 Berlin
            Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
            ralf.hildebrandt@... | http://www.charite.de
          • Tom Kinghorn
            ... Why waste processing cycles, just use egrep instead of using cat first. egrep -i from= /var/log/maillog
            Message 5 of 12 , Feb 9, 2012
            • 0 Attachment
              On 10/02/2012 09:28, Ralf Hildebrandt wrote:
              > * kshitij mali<foreplayboy@...>:
              > cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>'
              >
              Why waste processing cycles, just use egrep instead of using cat first.

              egrep -i 'from=<.*@yahoo\.com>' /var/log/maillog
            • Ralf Hildebrandt
              ... Yeah, but I wanted to make my change easy to spot. -- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin
              Message 6 of 12 , Feb 9, 2012
              • 0 Attachment
                * Tom Kinghorn <thomas.kinghorn@...>:
                > On 10/02/2012 09:28, Ralf Hildebrandt wrote:
                > >* kshitij mali<foreplayboy@...>:
                > >cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>'
                > >
                > Why waste processing cycles, just use egrep instead of using cat first.
                >
                > egrep -i 'from=<.*@yahoo\.com>' /var/log/maillog

                Yeah, but I wanted to make my change easy to spot.

                --
                Ralf Hildebrandt
                Geschäftsbereich IT | Abteilung Netzwerk
                Charité - Universitätsmedizin Berlin
                Campus Benjamin Franklin
                Hindenburgdamm 30 | D-12203 Berlin
                Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
                ralf.hildebrandt@... | http://www.charite.de
              • kshitij mali
                hi Ralf , Thanks for help me . with the below expression its is showing me the logs for both from=
                Message 7 of 12 , Feb 10, 2012
                • 0 Attachment
                  hi Ralf ,

                  Thanks for help me .

                  with the below expression its is showing me the logs for both "from=< " and "to=<" logs what i wanted was only
                  match the expression from each like only from=<anythinghere@...> lines

                  i know this will be tricky i m to trying to solve this expression if u can then pls help.

                  Regards,
                  Kshitij Mali

                  On Fri, Feb 10, 2012 at 12:58 PM, Ralf Hildebrandt <Ralf.Hildebrandt@...> wrote:
                  * kshitij mali <foreplayboy@...>:
                  > Hi ,
                  >
                  > how to trace email from particular domain i want to trace all log from
                  > yahoo.com
                  >
                  > cat /var/log/maillog | egrep -i 'from=<*@yahoo.com'

                  cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>'

                  --
                  Ralf Hildebrandt
                   Geschäftsbereich IT | Abteilung Netzwerk
                   Charité - Universitätsmedizin Berlin
                   Campus Benjamin Franklin
                   Hindenburgdamm 30 | D-12203 Berlin
                   Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
                   ralf.hildebrandt@... | http://www.charite.de


                • Noel Jones
                  (perpetuating the useless use of cat and the hopelessly muddled top posting) cat /var/log/maillog | egrep -i from= .*to= -- Noel Jones
                  Message 8 of 12 , Feb 11, 2012
                  • 0 Attachment
                    (perpetuating the useless use of cat and the hopelessly muddled top
                    posting)

                    cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>.*to='


                    -- Noel Jones

                    On 2/11/2012 1:42 AM, kshitij mali wrote:
                    > hi Ralf ,
                    >
                    > Thanks for help me .
                    >
                    > with the below expression its is showing me the logs for both
                    > "from=< " and "to=<" logs what i wanted was only
                    > match the expression from each like only
                    > from=<anythinghere@... <mailto:anythinghere@...>> lines
                    >
                    > i know this will be tricky i m to trying to solve this expression if
                    > u can then pls help.
                    >
                    > Regards,
                    > Kshitij Mali
                    >
                    > On Fri, Feb 10, 2012 at 12:58 PM, Ralf Hildebrandt
                    > <Ralf.Hildebrandt@... <mailto:Ralf.Hildebrandt@...>>
                    > wrote:
                    >
                    > * kshitij mali <foreplayboy@...
                    > <mailto:foreplayboy@...>>:
                    > > Hi ,
                    > >
                    > > how to trace email from particular domain i want to trace all
                    > log from
                    > > yahoo.com <http://yahoo.com>
                    > >
                    > > cat /var/log/maillog | egrep -i 'from=<*@...
                    > <http://yahoo.com>'
                    >
                    > cat /var/log/maillog | egrep -i 'from=<.*@yahoo\.com>'
                    >
                    > --
                    > Ralf Hildebrandt
                    > Geschäftsbereich IT | Abteilung Netzwerk
                    > Charité - Universitätsmedizin Berlin
                    > Campus Benjamin Franklin
                    > Hindenburgdamm 30 | D-12203 Berlin
                    > Tel. +49 30 450 570 155 <tel:%2B49%2030%20450%20570%20155> |
                    > Fax: +49 30 450 570 962 <tel:%2B49%2030%20450%20570%20962>
                    > ralf.hildebrandt@...
                    > <mailto:ralf.hildebrandt@...> | http://www.charite.de
                    >
                    >
                  Your message has been successfully submitted and would be delivered to recipients shortly.