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

221201Re: Postfix and archiving

Expand Messages
  • Mark Martinec
    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
    • Show all 10 messages in this topic