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

Postfix and archiving

Expand Messages
  • Ritesh Nadhani
    Hi We have a postfix server running without any problem. Now for an internal application we need to store (backup) all the incoming and outgoing mails to a
    Message 1 of 10 , May 31, 2007
    • 0 Attachment
      Hi

      We have a postfix server running without any problem. Now for an
      internal application we need to store (backup) all the incoming and
      outgoing mails to a MySQL database.

      A similar solution is given at
      http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
      only works if all the mails are stored in the MySQL database.

      What I want is that all the emails are stored in normal mailboxes but
      after storing them, postfix calls one of our application with the
      actual email that we can parse and insert it to the database.

      Thus what we basically want is that after sending/receiving mail
      Postfix calls another process with the email passed as parameter that
      we can use for further purposes.

      Any pointers on the same would be appreciated?

      --
      Ritesh
      http://www.riteshn.com
    • Evan Platt
      ... Couldn t you use a procmail recipe, or am I missing something?
      Message 2 of 10 , May 31, 2007
      • 0 Attachment
        At 07:16 PM 5/31/2007, Ritesh Nadhani wrote:
        >Hi
        >
        >We have a postfix server running without any problem. Now for an
        >internal application we need to store (backup) all the incoming and
        >outgoing mails to a MySQL database.
        >
        >A similar solution is given at
        >http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
        >only works if all the mails are stored in the MySQL database.
        >
        >What I want is that all the emails are stored in normal mailboxes but
        >after storing them, postfix calls one of our application with the
        >actual email that we can parse and insert it to the database.
        >
        >Thus what we basically want is that after sending/receiving mail
        >Postfix calls another process with the email passed as parameter that
        >we can use for further purposes.
        >
        >Any pointers on the same would be appreciated?

        Couldn't you use a procmail recipe, or am I missing something?
      • Evan Platt
        Please post replies to the group. There s a good starter guide to procmail at http://userpages.umbc.edu/~ian/procmail.html . AFAIK, and someone will I m sure
        Message 3 of 10 , May 31, 2007
        • 0 Attachment
          Please post replies to the group.

          There's a good starter guide to procmail at
          http://userpages.umbc.edu/~ian/procmail.html .

          AFAIK, and someone will I'm sure correct me if I'm wrong, but postfix
          can't do any of what you're looking to do, but you might be able to
          create something with procmail.

          At 08:12 PM 5/31/2007, Ritesh Nadhani wrote:
          >Well, I have never used procmail before so I dont know.
          >
          >Do you have any links that I could read to do something like this?
          >
          >On 5/31/07, Evan Platt <evan@...> wrote:
          >>At 07:16 PM 5/31/2007, Ritesh Nadhani wrote:
          >> >Hi
          >> >
          >> >We have a postfix server running without any problem. Now for an
          >> >internal application we need to store (backup) all the incoming and
          >> >outgoing mails to a MySQL database.
          >> >
          >> >A similar solution is given at
          >> >http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
          >> >only works if all the mails are stored in the MySQL database.
          >> >
          >> >What I want is that all the emails are stored in normal mailboxes but
          >> >after storing them, postfix calls one of our application with the
          >> >actual email that we can parse and insert it to the database.
          >> >
          >> >Thus what we basically want is that after sending/receiving mail
          >> >Postfix calls another process with the email passed as parameter that
          >> >we can use for further purposes.
          >> >
          >> >Any pointers on the same would be appreciated?
          >>
          >>Couldn't you use a procmail recipe, or am I missing something?
          >>
          >
          >
          >--
          >Ritesh
          >http://www.riteshn.com
        • Ritesh Nadhani
          Ooops...sorry about just replying to you. I should press reply-all .... my bad. Yeah, I know that postfix cant do it but it can be done using procmail. I will
          Message 4 of 10 , May 31, 2007
          • 0 Attachment
            Ooops...sorry about just replying to you. I should press reply-all .... my bad.

            Yeah, I know that postfix cant do it but it can be done using
            procmail. I will read up the link that you provided.

            Thanks for your help again.

            On 5/31/07, Evan Platt <evan@...> wrote:
            > Please post replies to the group.
            >
            > There's a good starter guide to procmail at
            > http://userpages.umbc.edu/~ian/procmail.html .
            >
            > AFAIK, and someone will I'm sure correct me if I'm wrong, but postfix
            > can't do any of what you're looking to do, but you might be able to
            > create something with procmail.
            >
            > At 08:12 PM 5/31/2007, Ritesh Nadhani wrote:
            > >Well, I have never used procmail before so I dont know.
            > >
            > >Do you have any links that I could read to do something like this?
            > >
            > >On 5/31/07, Evan Platt <evan@...> wrote:
            > >>At 07:16 PM 5/31/2007, Ritesh Nadhani wrote:
            > >> >Hi
            > >> >
            > >> >We have a postfix server running without any problem. Now for an
            > >> >internal application we need to store (backup) all the incoming and
            > >> >outgoing mails to a MySQL database.
            > >> >
            > >> >A similar solution is given at
            > >> >http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
            > >> >only works if all the mails are stored in the MySQL database.
            > >> >
            > >> >What I want is that all the emails are stored in normal mailboxes but
            > >> >after storing them, postfix calls one of our application with the
            > >> >actual email that we can parse and insert it to the database.
            > >> >
            > >> >Thus what we basically want is that after sending/receiving mail
            > >> >Postfix calls another process with the email passed as parameter that
            > >> >we can use for further purposes.
            > >> >
            > >> >Any pointers on the same would be appreciated?
            > >>
            > >>Couldn't you use a procmail recipe, or am I missing something?
            > >>
            > >
            > >
            > >--
            > >Ritesh
            > >http://www.riteshn.com
            >
            >


            --
            Ritesh
            http://www.riteshn.com
          • mouss
            ... - use recipient_bcc_maps to copy mail to $user@dbmail.domain.example (search the archives for how to save the recipient using pcre. the idea is someting
            Message 5 of 10 , Jun 1, 2007
            • 0 Attachment
              Ritesh Nadhani wrote:
              > Hi
              >
              > We have a postfix server running without any problem. Now for an
              > internal application we need to store (backup) all the incoming and
              > outgoing mails to a MySQL database.
              >
              > A similar solution is given at
              > http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
              > only works if all the mails are stored in the MySQL database.
              >
              > What I want is that all the emails are stored in normal mailboxes but
              > after storing them, postfix calls one of our application with the
              > actual email that we can parse and insert it to the database.
              >
              > Thus what we basically want is that after sending/receiving mail
              > Postfix calls another process with the email passed as parameter that
              > we can use for further purposes.
              >
              > Any pointers on the same would be appreciated?
              >


              - use recipient_bcc_maps to copy mail to $user@...
              (search the archives for how to "save" the recipient using pcre. the
              idea is someting like "/(.)@domain\.example$/
              $1@..." ),
              - then use a dbmail transport to deliver mail for the
              dbmail.domain.example to dbmail.
              - configure dbmail to listen on another port so that you can still use
              your other pop/imap server.
            • Juraj Sakala
              ... Hi, try directive always_bcc Regards Juraj
              Message 6 of 10 , Jun 1, 2007
              • 0 Attachment
                On Friday 01 June 2007 06:35, Ritesh Nadhani wrote:
                > Ooops...sorry about just replying to you. I should press reply-all .... my
                > bad.
                >
                > Yeah, I know that postfix cant do it but it can be done using
                > procmail. I will read up the link that you provided.
                >
                > Thanks for your help again.
                >
                > On 5/31/07, Evan Platt <evan@...> wrote:
                > > Please post replies to the group.
                > >
                > > There's a good starter guide to procmail at
                > > http://userpages.umbc.edu/~ian/procmail.html .
                > >
                > > AFAIK, and someone will I'm sure correct me if I'm wrong, but postfix
                > > can't do any of what you're looking to do, but you might be able to
                > > create something with procmail.
                > >
                > > At 08:12 PM 5/31/2007, Ritesh Nadhani wrote:
                > > >Well, I have never used procmail before so I dont know.
                > > >
                > > >Do you have any links that I could read to do something like this?
                > > >
                > > >On 5/31/07, Evan Platt <evan@...> wrote:
                > > >>At 07:16 PM 5/31/2007, Ritesh Nadhani wrote:
                > > >> >Hi
                > > >> >
                > > >> >We have a postfix server running without any problem. Now for an
                > > >> >internal application we need to store (backup) all the incoming and
                > > >> >outgoing mails to a MySQL database.
                > > >> >
                > > >> >A similar solution is given at
                > > >> >http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
                > > >> >only works if all the mails are stored in the MySQL database.
                > > >> >
                > > >> >What I want is that all the emails are stored in normal mailboxes but
                > > >> >after storing them, postfix calls one of our application with the
                > > >> >actual email that we can parse and insert it to the database.
                > > >> >
                > > >> >Thus what we basically want is that after sending/receiving mail
                > > >> >Postfix calls another process with the email passed as parameter that
                > > >> >we can use for further purposes.
                > > >> >
                > > >> >Any pointers on the same would be appreciated?
                > > >>
                > > >>Couldn't you use a procmail recipe, or am I missing something?
                > > >
                > > >--
                > > >Ritesh
                > > >http://www.riteshn.com
                Hi,

                try directive always_bcc

                Regards
                Juraj
              • Mark Martinec
                Ritesh, ... One possibility is to use amavisd-new in a normal content filtering setup, enabling archive quarantine to SQL, and disabling all checks which are
                Message 7 of 10 , Jun 1, 2007
                • 0 Attachment
                  Ritesh,

                  > We have a postfix server running without any problem. Now for an
                  > internal application we need to store (backup) all the incoming and
                  > outgoing mails to a MySQL database.

                  One possibility is to use amavisd-new in a normal content filtering
                  setup, enabling archive quarantine to SQL, and disabling all checks
                  which are not needed. It stores unmodified mail to a table 'quarantine',
                  (chopped to $sql_quarantine_chunksize_max sizes if desired, enabling
                  storage of arbitrary size mail regardless of SQL limitations), and
                  it stores envelope data (sender, recipients, etc) to table 'msgs' and
                  associates. See README_FILES/README.sql* for details.

                  The following is a complete amavisd.conf file needed for such a setup.
                  It assumes SQL database is PostgreSQL (but can also work with MySQL),
                  and assumes the version of amavisd-new is the most recent (2.5.1) :

                  =================
                  use strict;

                  # disable all checks if they are not needed
                  $bypass_decode_parts = 1;
                  @bypass_virus_checks_maps = (1);
                  @bypass_spam_checks_maps = (1);
                  @bypass_header_checks_maps = (1);
                  @bypass_banned_checks_maps = (1);
                  @banned_filename_maps = ();

                  $max_servers = 10;

                  $log_level = 0; # verbosity 0..5
                  $log_recip_templ = undef; # disable by-recipient level-0 log entries
                  $syslog_facility = 'mail'; # Syslog facility as a string
                  $syslog_priority = 'debug'; # Syslog base (minimal) priority as a string
                  $DO_SYSLOG = 1; # log via syslogd (preferred)

                  @local_domains_maps = ([ '.example.com' ]); # list of all local domains

                  $inet_socket_port = 10024; # listen on this local TCP port(s)
                  $forward_method = 'smtp:[127.0.0.1]:10025'; # forward to MTA

                  $daemon_user = 'vscan';
                  $daemon_group = 'vscan';

                  @storage_sql_dsn =
                  ([ 'DBI:Pg:database=mail_log', 'vscan', 'hj9hXXXaa' ]);

                  $archive_quarantine_method = 'sql:';

                  =================


                  It would also be posible to disable mail forwarding from amavisd
                  back to MTA:
                  $forward_method = undef;
                  but in this case Postfix needs to be configured to feed a COPY of
                  each mail to amavisd, as it would not be comming back.

                  Mark
                • Gerard Seibert
                  ... Procmail is a resource hound, not to mention it has a nasty rule fall through habit. I would recommend staying as far away from that beast as possible.
                  Message 8 of 10 , Jun 1, 2007
                  • 0 Attachment
                    On Thursday May 31, 2007 at 10:38:51 (PM) Evan Platt wrote:


                    > >We have a postfix server running without any problem. Now for an
                    > >internal application we need to store (backup) all the incoming and
                    > >outgoing mails to a MySQL database.
                    > >
                    > >A similar solution is given at
                    > >http://www.dbmail.org/dokuwiki/doku.php?id=archiving-howto but this
                    > >only works if all the mails are stored in the MySQL database.
                    > >
                    > >What I want is that all the emails are stored in normal mailboxes but
                    > >after storing them, postfix calls one of our application with the
                    > >actual email that we can parse and insert it to the database.
                    > >
                    > >Thus what we basically want is that after sending/receiving mail
                    > >Postfix calls another process with the email passed as parameter that
                    > >we can use for further purposes.
                    > >
                    > >Any pointers on the same would be appreciated?
                    >
                    > Couldn't you use a procmail recipe, or am I missing something?

                    Procmail is a resource hound, not to mention it has a nasty rule 'fall
                    through' habit. I would recommend staying as far away from that beast as
                    possible.

                    --
                    Gerard
                  • Wietse Venema
                    ... ~user/.forward: username, |/command/of/database See man 8 local section SYSTEM-WIDE AND USER-LEVEL ALIASING . Wietse
                    Message 9 of 10 , Jun 1, 2007
                    • 0 Attachment
                      > >> >What I want is that all the emails are stored in normal mailboxes but
                      > >> >after storing them, postfix calls one of our application with the
                      > >> >actual email that we can parse and insert it to the database.
                      > >> >
                      > >> >Thus what we basically want is that after sending/receiving mail
                      > >> >Postfix calls another process with the email passed as parameter that
                      > >> >we can use for further purposes.

                      ~user/.forward:
                      username, "|/command/of/database"

                      See "man 8 local" section "SYSTEM-WIDE AND USER-LEVEL ALIASING".

                      Wietse
                    • Ritesh Nadhani
                      Thank you for all the replied. I will use this weekend to look up all the solutions provided by all. ... -- Ritesh http://www.riteshn.com
                      Message 10 of 10 , Jun 1, 2007
                      • 0 Attachment
                        Thank you for all the replied. I will use this weekend to look up all
                        the solutions provided by all.

                        On 6/1/07, Wietse Venema <wietse@...> wrote:
                        > > >> >What I want is that all the emails are stored in normal mailboxes but
                        > > >> >after storing them, postfix calls one of our application with the
                        > > >> >actual email that we can parse and insert it to the database.
                        > > >> >
                        > > >> >Thus what we basically want is that after sending/receiving mail
                        > > >> >Postfix calls another process with the email passed as parameter that
                        > > >> >we can use for further purposes.
                        >
                        > ~user/.forward:
                        > username, "|/command/of/database"
                        >
                        > See "man 8 local" section "SYSTEM-WIDE AND USER-LEVEL ALIASING".
                        >
                        > Wietse
                        >


                        --
                        Ritesh
                        http://www.riteshn.com
                      Your message has been successfully submitted and would be delivered to recipients shortly.