Postfix

There's one way (till now) to integrate Spider with Postfix, more options will be offered in future release.

The Always BCC Approch

Spider Email Archiver has a builtin SMTP server that listens on port 25 by default, Postfix can be configured to forward a copy of all received and sent emails to this port with the always_bcc parameter.

  • REQUIRED: Add parameter always_bcc in Postfix config file /etc/postfix/main.cf, set its value to the Archiving Address.

    always_bcc = archive@archive.mydomain.com
    
  • REQUIRED: Update parameter transport_maps, insert a hash map file /etc/postfix/transport:

    transport_maps = hash:/etc/postfix/transport, ...
    
  • REQUIRED: Create (or edit existing) /etc/postfix/transport file, append transport for Spider server hostname archive.mydomain.com:

    Spider runs SMTP service on standard port 25 by default, if it's configured to run on a non-standard port, e.g. 1025, you must replace port 25 below by the real port number, e.g. smtp:[192.168.1.1]:1025.

    archive.mydomain.com smtp:[192.168.1.1]:25
    

    If you use host IP address as archiving domain name, it's required to add transport for host IP (Spider server) too. For example:

    # - IP address must be surrounded by [ and ].
    # - 192.168.1.1 is the IP address of Spider server.
    [192.168.1.1] smtp:[192.168.1.1]:25
    
  • REQUIRED: Run command:

    postmap hash:/etc/postfix/transport
    
  • OPTIONAL BUT HIGHLY RECOMMENDED: Update smtpd_recipient_restrictions to add a check_recipient_access rule to always prepend X-Envelope-To: header with the final delivery address:

    WARNING:

    • Spider collects final recipient addresses from X-Envelope-To: header, if it doesn't exist, To:, Cc:, Bcc: are used instead, this causes Spider considers email alias/forwarding addresses as a mailbox and counts in license.
    • If X-Envelope-To: is missing, Spider collects email addresses from From:, To:, Cc:, Bcc:, if none of them contain hosted email domain name, the message will be rejected (with error message Message does not contain any allowed email address). It may happen if you subscribe to some mailing list, the sender in From: is either mailing list or list member, but your address does not appear in To: or Cc: at all.
    smtpd_recipient_restrictions =
        ...
        reject_non_fqdn_recipient
        reject_unlisted_recipient
        check_recipient_access pcre:/etc/postfix/recipient_access.pcre
        ...
    

    Create file /etc/postfix/recipient_access.pcre with content below:

    /(.*)/  prepend X-Envelope-To: $1
    
  • OPTIONAL: If you choose to enable SMTP authentiction in Spider, you must configure Postfix to perform smtp authentiction.

    • Add or append below settings in Postfix config file /etc/postfix/main.cf:

      smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
      smtp_sasl_auth_enable = yes
      smtp_sasl_mechanism_filter = plain login
      smtp_sasl_security_options = noanonymous
      
    • Write the smtp username and password in /etc/postfix/sasl_password (Note: repleace user:password by the ones you set in Spider settings: SMTP Listener):

      archiving.mydomain.com user:password
      
    • Run shell commands:

      postmap hash:/etc/postfix/sasl_password
      
  • Restart postfix service to load modified config files:

    service postfix restart