mail archiving bug or feature?

Discussion in 'General' started by nulledp, Jul 27, 2018.

  1. nulledp

    nulledp New Member

    Hello to everyone

    I'm trying to do full mail archiving and i think my server behave strange.

    For example:
    I have
    - domain1
    and mailboxes
    - [email protected]
    - [email protected]
    - [email protected]

    Inside [email protected] and [email protected] I set up [email protected] as "Send copy to" and "Send outgoing BCC to"
    [email protected] receiving 3 identical email to INBOX when mailbox1 sends email to mailbox2
    But when [email protected] sends email to not localdomain - everything works fine.

    Then I added line to like this to avoid double messages but it doesn't work.
    smtps     inet  n       -       -       -       -       smtpd
      -o receive_override_options=no_address_mapping
    Please anyone give me any suggestions?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This is what happens when you send an email from a to b where both are local domains in the setup you made:

    1) There is the original mail which will go from A into mailbox b.
    2) You configured outgoing bcc, so during sending, a copy is sent to the archive.
    3) As you configured incoming copy, another copy of the mail is sent to the archive during receiving.

    Sending and receiving are two different actions and as you configured your system to create a copy during send and another during receiving, you must end up with 3 copies of this email on your server.

    Postfix can not deduplicate the email as the send copy to is done by dovecot and not postfix.
  3. nulledp

    nulledp New Member

    A -> B send = 1st mail in archive
    B received mail from A = 2nd mail in archive
    where is from 3rd email in archive?

    I can't understand a logic
    excuse me

    is there some mechanism or trick to kill duplicates in [email protected] ?
    is it possible to modify logic to kill duplicate mail if sender and receiver are local domain mailboxes?
  4. nulledp

    nulledp New Member

    Please mark thread as SOLVED probably it will help someone.

    In file /etc/postfix/ I changed line:
    sender_bcc_maps = proxy:mysql:/etc/postfix/
    sender_bcc_maps = hash:/etc/postfix/sender_bcc
    and added line:
    recipient_bcc_maps = hash:/etc/postfix/recipient_bcc
    and created two files with text inside:
    after that reindex hash files
    postmap /etc/postfix/recipient_bcc
    postmap /etc/postfix/sender_bcc
    and restart services or reboot server:
    systemctl restart dovecot postfix
  5. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    Personally, i would add this to postfix cleanup-service.
    cleanup   unix  n       -       -       -       0       cleanup
      -o sender_bcc_maps=hash:/etc/postfix/archive_maps
      -o recipient_bcc_maps=hash:/etc/postfix/archive_maps
    @domain [email protected]
    Jesse Norell likes this.

Share This Page