User tools

Website tools


multi import

Multi-import

      SMTP| | +----v-------+ | | | MILTER | MAILGW1 | +--------+ +------------------+ | | | | | | | +----v-------+ | | |CLIENT1| | | | | | | +------->| BENNO |--------| | | | | | +----v-------+ | | |CLIENT2| | | | | | | | | MAILGW2 | +--------+ +------------------+ | | | MILTER +------------+

Double import

If emails are imported from several different source systems, there is a risk that an email will be imported multiple times or incorrectly.

In this example, two clients are configured on the Benno system. Each client is configured so that all emails to and from their domain are archived in Benno.

Each client has their own mail gateway through which they receive and send emails. Benno's connection is established via MILTER on both mail gateways.

Falls Mandant1 eine E-Mail an Mandant2 schickt, läuft diese über beide Mailgateways und wird von beiden MILTERn an Benno MailArchiv übertragen. Beim Versand von MAILGW1 an MAILGW2 wurden der Mail dabei von den SMTP-Servern zusätzliche Header hinzugefügt, so daß sich die Checksummen der E-Mails unterscheiden. Die Mail wird folglich in jedem der beiden Mandanten doppelt importiert.

Incorrect import

Another problem arises if the email is accepted by MAILGW1, for example, but forwarding to MAILGW2 fails. In this case, it must be ensured that the email was imported only by Client1, but not by Client2.

configuration

Die oben beschriebenen Probleme beim Setup mit mehreren Import-Quellen wird vermieden, wenn der zu importierenden E-Mail die Information über das Quellsystem mitgegeben wird und dieses als Import-Kriterium in der Container-Konfiguration (und damit beim Mandanten) festgelegt wird.

import

The transfer from the source system to the Benno MailArchiv import interface offers the option to set the header X-BENNO-GW. For example, MAILGW1 or MAILGW2. Depending on the import tool, the header can be configured accordingly.

MILTER

The MILTER daemon sets the header to the value specified in the configuration file /etc/default/benno-milter

MILTERARGS="-x CANDANT1"

Alternativ ist eine Konfiguration bei der Übertragung der Mails per SMTP mit benno-milter2smtp möglich. Hier wird der Kommandozeilenparameter -x MANDANT1 im Cron-Job gesetzt.

benno-exchange

Hier kann der Paramameter ebenfalls als -x MANDANT1 per Kommandozeile übergeben, oder in der Konfigurationsdatei mit dem Parameter extraheader_value = MANDANT1 festgelegt werden.

benno imap

The tool benno-imapimport sets the header with -x MANDANT1 or in the configuration file extraheader = X-BENNO-GW: MANDANT1.

benno.xml

directorywatcher

Im „“ wird der Header X-BENNO-GW in <senderheaders /> und in <secretheaders /> aufgeführt. Damit wird der Wert dieses Headers in der Container-Konfiguration als Kriterium für „sender“ betrachtet. Die Einstufung als Secretheader bewirkt, daß der Header nicht in der E-Mail angezeigt wird.

        <directorywatcher directory="/srv/benno/inboxes/mx1" pattern=".*.eml">
            <mailfile>
               <senderheaders>
                  <name>X-REAL-MAILFROM</name>
                  <name>X-BENNO-GW</name>
                  <name>From</name>
               </senderheaders>
               <recipientheaders>
                  <name>X-REAL-RCPTTO</name>
                  <name>BCC</name>
                  <name>To</name>
                  <name>Cc</name>
               </recipientheaders>
               <secretheaders>
                  <name>X-REAL-MAILFROM</name>
                  <name>X-REAL-RCPTTO</name>
                  <name>X-BENNO-GW</name>
                  <name>BCC</name>
               </secretheaders>
            </mailfile>

container

The value of X-BENNO-GW can be specified as an additional or exclusive criterion for assigning a container to the container in the container criteria.

Import source for a client

If the import source (MILTER, benno-exchange) only imports a single client, specifying the X-BENNO-GW header is sufficient for assignment. If additional domains are later assigned to the client, the configuration does not need to be changed here.

<simplecontainer>
  <identifier>Mandant1</identifier>
  <conditions>
    <domain sender="true">MAILGW1</domain>
  </conditions>
  ...

Import source for multiple clients

In this case, the value of X-BENNO-GW and the client's domain must be taken into account.

<simplecontainer>
  <identifier>Mandant1</identifier>
  <conditions>
    <and>
      <domain sender="true">MAILGW2</domain>
      <or>
        <domain sender="true" recipient="true" from="true" to="true" cc="true">mandant2.de</domain>
        <domain sender="true" recipient="true" from="true" to="true" cc="true">mandant2.com</domain>
      </or>
    </and>
  </conditions>
  ...
multi-import.txt Last modified: 2018/12/20 14:54 by lwsystems