verp addressing with bcc not working

Issue #915 closed
Martin Nadvornik created an issue

Hi Janos,

I have already posted this in #335, because I thought it fits there. But as that issue is already closed I thought it would be better to open a new issue.

It seems that at least in 1.3.4 there is an issue with verp addressing. A mail to several BCC receipients is only stored for the first receipient and the subsequent mails piler receives for the other receipients are rejected because they are duplicate.

I sent a mail to the following receipients: from: test1@XXXX.local to: test1@XXXX.local bcc: test2@XXXX.local, test3@XXXX.local

Mail log from piler looks like this:

Jun  1 18:25:09 piler-test piler-smtp[2535]: connected from 10.253.57.114:60690 on descriptor 6 (active connections:1)
Jun  1 18:25:09 piler-test piler-smtp[2535]: received: Y05TL0XP261NOJ4B, from=test1@XXXX.local, size=1760, client=10.253.57.114
Jun  1 18:25:09 piler-test piler-smtp[2535]: disconnected from 10.253.57.114 on descriptor 6 (0 active connections)
Jun  1 18:25:09 piler-test piler-smtp[2535]: connected from 10.253.57.114:60704 on descriptor 6 (active connections:1)
Jun  1 18:25:09 piler-test piler[2547]: 9/Y05TL0XP261NOJ4B: 400000005b11736f1cd81dfc00ffedef1516, size=1802/888, attachments=0, reference=, message-id=<765b69baf7aff678bb258d76daba3393@XXXX.local>, retention=2557, folder=0, delay=0.0
214, status=stored
Jun  1 18:25:09 piler-test piler-smtp[2535]: received: YQ0BUN6LL32I6V8R, from=test1@XXXX.local, size=1760, client=10.253.57.114
Jun  1 18:25:09 piler-test piler-smtp[2535]: disconnected from 10.253.57.114 on descriptor 6 (0 active connections)
Jun  1 18:25:09 piler-test piler-smtp[2535]: connected from 10.253.57.114:60706 on descriptor 6 (active connections:1)
Jun  1 18:25:09 piler-test piler-smtp[2535]: received: YFBZG832L18R8Q1C, from=test1@XXXX.local, size=1760, client=10.253.57.114
Jun  1 18:25:10 piler-test piler[2547]: 9/YQ0BUN6LL32I6V8R: discarding: duplicate message, id: 5, message-id: <765b69baf7aff678bb258d76daba3393@XXXX.local>
Jun  1 18:25:10 piler-test piler[2547]: 9/YQ0BUN6LL32I6V8R: 400000005b1173701e2746c400410545cdd9, size=1802/0, attachments=0, reference=, message-id=<765b69baf7aff678bb258d76daba3393@XXXX.local>, retention=0, folder=0, delay=0.0291,
status=duplicate
Jun  1 18:25:10 piler-test piler[2547]: 9/YFBZG832L18R8Q1C: discarding: duplicate message, id: 5, message-id: <765b69baf7aff678bb258d76daba3393@XXXX.local>
Jun  1 18:25:10 piler-test piler[2547]: 9/YFBZG832L18R8Q1C: 400000005b1173701fe36de4000b333fa27a, size=1802/0, attachments=0, reference=, message-id=<765b69baf7aff678bb258d76daba3393@XXXX.local>, retention=0, folder=0, delay=0.0042,
status=duplicate

So the message is only stored and visible to the first receipient:

$ pilerget 400000005b1173701e2746c400410545cdd9

X-Piler-Envelope-To: test1@XXXX.local
Received: from iredmail-test.XXXX.local (localhost [127.0.0.1])
        by iredmail-test.XXXX.local (Postfix) with ESMTP id 9107E361389
        for <archive+test1=XXXX.local@piler-test.XXXX.local>; Fri,  1 Jun 2018 18:25:09 +0200 (CEST)
Authentication-Results: iredmail-test.XXXX.local (amavisd-new); dkim=pass
        reason="pass (just generated, assumed good)" header.d=XXXX.local
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=XXXX.local;
         h=user-agent:message-id:subject:subject:to:from:from:date:date
        :content-transfer-encoding:content-type:content-type
        :mime-version; s=dkim; t=1527870309; x=1530462310; bh=3g7dCsSnBa
        /3DzRzTpCh0KHYt2q+S7U/Pqk0vBBbOxc=; b=sYBhGRqcp7QvSxiXGbb1VvzT0p
        WsyNUSN+O+D+uRG16OoL+cA8YUUpe5EmDZS7avm+7vo8RNNEEF4ES32jcVdFoFcK
        a3yvGwq4xt8TwPGtkiTuJEkEmSkqB4+vUV/oVz/7g7qt8nDUU57Watf70SOTAhYp
        DTnXsQTTmr5XJGy8U=
X-Virus-Scanned: Debian amavisd-new at iredmail-test.XXXX.local
Received: from iredmail-test.XXXX.local ([127.0.0.1])
        by iredmail-test.XXXX.local (iredmail-test.XXXX.local [127.0.0.1]) (amavisd-new, port 10026)
        with ESMTP id hX6RPvz-Kian
        for <archive+test1=XXXX.local@piler-test.XXXX.local>;
        Fri,  1 Jun 2018 18:25:09 +0200 (CEST)
Received: from _ (localhost [127.0.0.1])
        by iredmail-test.XXXX.local (Postfix) with ESMTPSA id 6234E361386;
        Fri,  1 Jun 2018 18:25:09 +0200 (CEST)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 01 Jun 2018 18:25:09 +0200
From: test1@XXXX.local
To: test1 <test1@XXXX.local>
Subject: test2
Message-ID: <765b69baf7aff678bb258d76daba3393@XXXX.local>
X-Sender: test1@XXXX.local
User-Agent: Roundcube Webmail

test2

The other receipients are not added to the rcpt table:

MariaDB [piler]> select * from metadata where piler_id='400000005b11736f1cd81dfc00ffedef1516';
+----+----------------------+----------------+---------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
| id | from                 | fromdomain     | subject | spam | arrived    | sent       | retained   | deleted | size | hlen | direction | attachments | piler_id                             | message_id                                        | reference | digest                                                           | bodydigest                                                       | vcode                                                            |
+----+----------------------+----------------+---------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
|  5 | test1@XXXX.local | XXXX.local | test2   |    0 | 1527870309 | 1527870309 | 1748795109 |       0 | 1802 | 1795 |         0 |           0 | 400000005b11736f1cd81dfc00ffedef1516 | <765b69baf7aff678bb258d76daba3393@XXXX.local> |           | 30940484efd4924374bd3e044112038d54f895d4372064d54edae9b4ebaef8b3 | de0edd0ac4a705aff70f34734e90a1d0a1d8b76abe4bb53f3ea934bc105b3b17 | 46c94a890ea89ea8b4f2a77073a86d3e1787d082708b6f8a0942c11762809935 |
+----+----------------------+----------------+---------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
1 row in set (0.00 sec)


MariaDB [piler]> select * from rcpt;
+----+----------------------------------+----------------+
| id | to                               | todomain       |
+----+----------------------------------+----------------+
|  2 | test2@XXXX.local             | XXXX.local |
|  3 | test1@XXXX.local             | XXXX.local |
|  4 | test1@XXXX.local             | XXXX.local |
|  5 | test1@XXXX.local             | XXXX.local |
|  1 | undisclosed-recipients@no.domain | no.domain      |
+----+----------------------------------+----------------+
5 rows in set (0.00 sec)

This is my piler.conf on a freshly installed piler instance with version 1.3.4:

archive_emails_not_having_message_id=0
archive_only_mydomains=0
backlog=20
cipher_list=ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
clamd_socket=/tmp/clamd
default_retention_days=2557
enable_chunking=0
enable_cjk=0
enable_folders=0
encrypt_messages=1
extract_attachments=1
extra_to_field=X-Envelope-To:
helper_timeout=20
hostid=piler-test.XXXX.local
listen_addr=0.0.0.0
listen_port=25
max_requests_per_child=1000
memcached_servers=127.0.0.1
memcached_to_db_interval=900
memcached_ttl=86400
min_message_size=100
min_word_len=1
mmap_dedup_test=0
mysqlhost=127.0.0.1
mysqlport=3306
mysql_connect_timeout=2
mysqldb=piler
mysqlpwd=XXXXXXXXXX
mysqlsocket=/var/run/mysqld/mysqld.sock
mysqluser=piler
number_of_worker_processes=10
pemfile=/usr/local/etc/piler/piler.pem
pidfile=/var/run/piler/piler.pid
piler_header_field=X-piler-id:
process_rcpt_to_addresses=1
server_id=0
spam_header_line=
syslog_recipients=0
tls_enable=0
tweak_sent_time_offset=0
update_counters_to_memcached=0
username=piler
verbosity=1
workdir=/var/piler/tmp
mysqlcharset=utf8
queuedir=/var/piler/store

The test message I sent to piler comes from a freshly installed iredmail server using a bcc_map config I took from one of the comments in this thread

#/etc/postfix/bcc_map
#
/^([^+]+).*@(.*)$/      archive+$1=$2@piler-test.XXXX.local

I am trying to use verp adressing because I hope to solve the bcc reveal problem. Please note, that this issue is important for me because of privacy concerns and I am also willing to pay for your support if necessary. In that case just send me a contact info so we can discuss the expected price and necessary steps.

Kind Regards, Martin

Comments (14)

  1. Janos SUTO repo owner

    Try the following: apply the fix in https://bitbucket.org/jsuto/piler/commits/6c9b258343343df3c6b5a759aa9055d0c06040f8 (or simply get the complete file, overwrite src/parser.c with this one: https://bitbucket.org/jsuto/piler/raw/6c9b258343343df3c6b5a759aa9055d0c06040f8/src/parser.c)

    Then recompiler piler. If you have process_rcpt_to_addresses=1 in piler.conf, then piler-smtp adds the envelope recipients (most notably the bcc recipients) to the beginning of header of the message, eg.

    X-Piler-Envelope-To: bela@aaa.fu
    

    Note that the gui should strip this address when downloading, viewing the message, except for auditor users. So, try the fix, and let me know how it goes.

  2. Martin Nadvornik reporter

    Hi Janos, it got better but now the message is shown multiple times.

    I have sent a message from test1@XXXX.local to test2@XXXX.local with test3@XXXX.local in BCC. However when viewing the mails in piler by logging in with all three accounts or the auditor I always see that message three times. piler-test-duplicates.png Here are the headers of the three mails that are shown when logged in as test3@XXXX.local:

    Received: from iredmail-test.XXXX.local (localhost [127.0.0.1])
        by iredmail-test.XXXX.local (Postfix) with ESMTP id 16FF2361605
        for <archive+archive=piler-test.XXXX.local@piler-test.XXXX.local>; Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    X-Virus-Scanned: Debian amavisd-new at iredmail-test.XXXX.local
    Received: from iredmail-test.XXXX.local ([127.0.0.1])
        by iredmail-test.XXXX.local (iredmail-test.XXXX.local [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id nHi87BU7S_2B
        for <archive+archive=piler-test.XXXX.local@piler-test.XXXX.local>;
        Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    Received: by iredmail-test.XXXX.local (Postfix, from userid 115)
        id B4CFF361625; Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    Received: from _ (localhost [127.0.0.1])
     by iredmail-test.XXXX.local (Postfix) with ESMTPSA id 34C4E361605;
     Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=US-ASCII;
     format=flowed
    Content-Transfer-Encoding: 7bit
    Date: Fri, 08 Jun 2018 13:31:36 +0200
    From: test1@XXXX.local
    To: test2 <test2@XXXX.local>
    Subject: 20180608 test1
    Message-ID: <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local>
    X-Sender: test1@XXXX.local
    User-Agent: Roundcube Webmail
    
    X-Piler-Envelope-To: test2@XXXX.local
    Received: from iredmail-test.XXXX.local (localhost [127.0.0.1])
        by iredmail-test.XXXX.local (Postfix) with ESMTP id 2B4E1361605
        for <archive+test2=XXXX.local@piler-test.XXXX.local>; Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    X-Virus-Scanned: Debian amavisd-new at iredmail-test.XXXX.local
    Received: from iredmail-test.XXXX.local ([127.0.0.1])
        by iredmail-test.XXXX.local (iredmail-test.XXXX.local [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id kEjX88zC_t5Z
        for <archive+test2=XXXX.local@piler-test.XXXX.local>;
        Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    Received: by iredmail-test.XXXX.local (Postfix, from userid 115)
        id B4CFF361625; Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    Received: from _ (localhost [127.0.0.1])
     by iredmail-test.XXXX.local (Postfix) with ESMTPSA id 34C4E361605;
     Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=US-ASCII;
     format=flowed
    Content-Transfer-Encoding: 7bit
    Date: Fri, 08 Jun 2018 13:31:36 +0200
    From: test1@XXXX.local
    To: test2 <test2@XXXX.local>
    Subject: 20180608 test1
    Message-ID: <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local>
    X-Sender: test1@XXXX.local
    User-Agent: Roundcube Webmail
    
    Received: from iredmail-test.XXXX.local (localhost [127.0.0.1])
        by iredmail-test.XXXX.local (Postfix) with ESMTP id 454F9361605
        for <archive@piler-test.XXXX.local>; Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    X-Virus-Scanned: Debian amavisd-new at iredmail-test.XXXX.local
    Received: from iredmail-test.XXXX.local ([127.0.0.1])
        by iredmail-test.XXXX.local (iredmail-test.XXXX.local [127.0.0.1]) (amavisd-new, port 10024)
        with ESMTP id hmJtwndWFbb0 for <archive@piler-test.XXXX.local>;
        Fri,  8 Jun 2018 13:31:37 +0200 (CEST)
    Received: by iredmail-test.XXXX.local (Postfix, from userid 115)
        id B4CFF361625; Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    Received: from _ (localhost [127.0.0.1])
     by iredmail-test.XXXX.local (Postfix) with ESMTPSA id 34C4E361605;
     Fri,  8 Jun 2018 13:31:36 +0200 (CEST)
    MIME-Version: 1.0
    Content-Type: text/plain; charset=US-ASCII;
     format=flowed
    Content-Transfer-Encoding: 7bit
    Date: Fri, 08 Jun 2018 13:31:36 +0200
    From: test1@XXXX.local
    To: test2 <test2@XXXX.local>
    Subject: 20180608 test1
    Message-ID: <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local>
    X-Sender: test1@XXXX.local
    User-Agent: Roundcube Webmail
    

    The three messages have different piler IDs

    +----+----------------------+----------------+----------------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
    | id | from                 | fromdomain     | subject        | spam | arrived    | sent       | retained   | deleted | size | hlen | direction | attachments | piler_id                             | message_id                                        | reference | digest                                                           | bodydigest                                                       | vcode                                                            |
    +----+----------------------+----------------+----------------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
    | 62 | test1@XXXX.local | XXXX.local | 20180608 test1 |    0 | 1528457511 | 1528457496 | 1749382311 |       0 | 1295 | 1287 |         1 |           0 | 400000005b1a6931288675540094f0090663 | <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local> |           | 7536f092d4fce88254fd0b87eb36d4e55a9d94b14ccc0c29c73dd6ac33bbabde | 86f9e5b51d3b3ba6b03058ca87dda7cae9e4e3fe0e5bf6de59eb5d35030b34d4 | 93341dc8ac0b40cb7031042ca559b1983ea25e12f99f8fe2328faa01b511099a |
    | 63 | test1@XXXX.local | XXXX.local | 20180608 test1 |    0 | 1528457511 | 1528457496 | 1749382311 |       0 | 1381 | 1373 |         1 |           0 | 400000005b1a69312860f3c4000677dd109a | <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local> |           | 4c6701f898be94c07553dab0d1cb536ba3cc9425280cf7e451bc1e059b424c4b | 86f9e5b51d3b3ba6b03058ca87dda7cae9e4e3fe0e5bf6de59eb5d35030b34d4 | 265335f442dc557b4a120611b2ea603ffa68e5d25b166c9981ee16eddc0dc1f1 |
    | 64 | test1@XXXX.local | XXXX.local | 20180608 test1 |    0 | 1528457511 | 1528457496 | 1749382311 |       0 | 1365 | 1357 |         1 |           0 | 400000005b1a693128c850b400bfb3430b68 | <55d2eb4eb19dc05e44c65b483db8f5ad@XXXX.local> |           | d115f383ad631d5fdd3f7949ec936e4dbe541b6c3637b27f6b5720e677676e3d | 86f9e5b51d3b3ba6b03058ca87dda7cae9e4e3fe0e5bf6de59eb5d35030b34d4 | 542bbdb7f2f3c6108e0b5e82c02c327578ccc1ad48a950b64f3593cd6cb4480b |
    +----+----------------------+----------------+----------------+------+------------+------------+------------+---------+------+------+-----------+-------------+--------------------------------------+---------------------------------------------------+-----------+------------------------------------------------------------------+------------------------------------------------------------------+------------------------------------------------------------------+
    

    Also in the rcpt table there are now for all "three" mails all the receipients

    +----+----------------------+----------------+
    | id | to                   | todomain       |
    +----+----------------------+----------------+
    | 62 | test2@XXXX.local | XXXX.local |
    | 62 | test3@XXXX.local | XXXX.local |
    | 63 | test2@XXXX.local | XXXX.local |
    | 63 | test3@XXXX.local | XXXX.local |
    | 64 | test2@XXXX.local | XXXX.local |
    | 64 | test3@XXXX.local | XXXX.local |
    +----+----------------------+----------------+
    

    So they all got archived seperately. I think I read in #335 that the rcpt table is the one used to determine which receipients belong to a certain archived mail. As I wrote in my orginial post the bcc receipients did not get added to the rcpt table entry. After I applied your fix this seems to have changed - however with the side effect of the mail being archived multiple times. Shouldn't the archive flow be like this?:

    1. incoming mail from=test1@XXXX.local to=test2@XXXX.local. The mail piler got is addressed to archive+test2@XXXX.local. message id not known -> archived and test2@XXX.local added to rcpt table
    2. incoming mail from=test1@XXXX.local to=test2@XXXX.local. The mail piler got is addressed to archive+test3@XXXX.local. message is known -> not archived but test3@XXX.local added to rcpt table

    Thank's for your help!

  3. Janos SUTO repo owner

    OK, thanks for your feedback. Let me perform some additional debugging, and I'll come back to you.

  4. Martin Nadvornik reporter

    I just discovered it was my fault that the single mail showed up multiple times! I'm sorry for that! While testing around it seems that I accidentially left these setting in my postfix config:

    dovecot_destination_recipient_limit = 1
    mlmmj_destination_recipient_limit = 1
    smtp-amavis_destination_recipient_limit = 1
    

    I will conduct some further testing today and will report back if I detect something wrong

  5. Martin Nadvornik reporter

    Hi,

    I discovered that changing the recipient_limit config in Postfix leads to other issues and is not recommended. So changing them seems not to be a solution. Also I have tried to apply the fix to our productive archive but it did not have any effect. In contrast to my test system I did not even see the same effect that mails are beeing shown multiple times. So there must be different issues between my productive and test system. Would it be possible for you to provide with a known working Postfix and Piler config using verp addressing so I can compare wether I am missing anything or this is still a bug in Piler?

    Thanks!

  6. Janos SUTO repo owner

    Sorry for the delay, I was quite busy recently. I'll compile such a setup, and share my configs with you.

  7. Martin Nadvornik reporter

    Hi Janos, did you have any progress on this issue? We are currently using the always_bcc option without setting the X-Envelope-To header for our productive system so we do not leak the bcc receipients. But this is of course not an optimal solution as all BCC receipients don't see those mails in the piler gui. A working config with verp addressing would be highly appreciated

  8. Janos SUTO repo owner

    OK, I've setup the following: postfix with the following config in main.cf (the rest of the config is what the ubuntu postfix package ships by default):

    recipient_bcc_maps = pcre:/etc/postfix/bcc_map
    

    bcc_map:

    /(.*)@(.*)/      archive+$1=$2@yyy.acts.hu
    #/^([^+]+).*@(.*)$/     archive+$1=$2@yyy.acts.hu
    

    Note that I've tried both lines, and they both seem to work properly providing the following logs (for an email having two envelope recipients):

    Aug  7 19:45:08 d9e8f0734e32 postfix/smtp[1937]: 87F3D2A025C: to=<archive+bela=xxx.acts.hu@yyyy.acts.hu>, relay=yyy.acts.hu[1.2.3.4]:25, delay=0.14, delays=0.06/0.02/0.01/0.04, dsn=2.0.0, status=sent (250 OK <62EX0FD6I8VAWBQG>)
    Aug  7 19:45:08 d9e8f0734e32 postfix/smtp[1937]: 87F3D2A025C: to=<archive+sanyi=xxx.acts.hu@yyy.acts.hu>, relay=yyy.acts.hu[1.2.3.4]:25, delay=0.14, delays=0.06/0.02/0.01/0.04, dsn=2.0.0, status=sent (250 OK <62EX0FD6I8VAWBQG>)
    

    On the piler side I've got the following in the config:

    process_rcpt_to_addresses=1
    verbosity=5
    

    Providing the following log:

    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *EHLO d9e8f0734e32.cloud.online.net#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250-yyy.acts.hu#015#012250-PIPELINING#015#012250-STARTTLS#015#012250-CHUNKING#015#012250-SIZE#015#012250 8BITMIME#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *MAIL FROM:<aaa@aaa.fu> SIZE=29071#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *RCPT TO:<archive+bela=xxx.acts.hu@yyy.acts.hu>#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *RCPT TO:<archive+sanyi=xxx.acts.hu@yyy.acts.hu>#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *DATA#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 354 Send mail data; end it with <CRLF>.<CRLF>#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: received: Q9EK8GKZ3RRGGPKW, from=aaa@aaa.fu, size=29071, client=51.15.71.197, fd=6
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 OK <Q9EK8GKZ3RRGGPKW>#015
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: got on fd=6: *QUIT#015#012*
    Aug  7 19:43:42 56164ed1ef17 piler-smtp[447]: sent on fd=6: 221 yyy.acts.hu Goodbye#015
    Aug  7 19:43:42 56164ed1ef17 piler[567]: 1/Q9EK8GKZ3RRGGPKW: 400000005b69f6783720770400a58f87fcf4, size=29156/12224, attachments=2, reference=, message-id=<J7WIYISD65DTLQPLLTGELOZDIY5NZ3Y56L2DQX
    G6@aaa.fu>, retention=2557, folder=0, delay=0.0481, status=stored
    

    According to the mysql database it's a single email for two recipients:

    MariaDB [piler]> select id, piler_id, `from`, `to`, subject from v_messages where piler_id='400000005b69f6783720770400a58f87fcf4';
    +----+--------------------------------------+------------+-----------------------+----------------------+
    | id | piler_id                             | from       | to                    | subject              |
    +----+--------------------------------------+------------+-----------------------+----------------------+
    | 16 | 400000005b69f6783720770400a58f87fcf4 | aaa@aaa.fu | bela@xxxx.acts.hu  | This is test subject |
    | 16 | 400000005b69f6783720770400a58f87fcf4 | aaa@aaa.fu | sanyi@xxx.acts.hu | This is test subject |
    +----+--------------------------------------+------------+-----------------------+----------------------+
    2 rows in set (0.002 sec)
    

    So the bottomline is that, I believe it works properly.

  9. Janos SUTO repo owner

    Perhaps one more test is required. In the previous example postfix sent the email to both recipients in a single session having 2 recipients. But what about if the remote smtp server sends 2 emails for the 2 recipients? So I've sent the same email to bela@xxxx.acts.hu, then to sanyi@xxxx.acts.hu:

    The first session:

    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: got on fd=6: *MAIL FROM:<aaa@aaa.fu> SIZE=14020 BODY=8BITMIME#015#012*
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: got on fd=6: *RCPT TO:<archive+bela=xxx.acts.hu@yyy.acts.hu>#015#012*
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: got on fd=6: *DATA#015#012*
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: sent on fd=6: 354 Send mail data; end it with <CRLF>.<CRLF>#015
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: received: PFTIB9AV236BY6UB, from=aaa@aaa.fu, size=13995, client=51.15.71.197, fd=6
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 OK <PFTIB9AV236BY6UB>#015
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: got on fd=6: *QUIT#015#012*
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: sent on fd=6: 221 yyy.acts.hu Goodbye#015
    Aug  8 06:49:09 56164ed1ef17 piler-smtp[447]: disconnected from 1.2.3.4 on fd=6 (0 active connections)
    Aug  8 06:49:09 56164ed1ef17 piler[566]: 0/PFTIB9AV236BY6UB: 400000005b6a926f390f4acc00fff557f06c, size=14037/4352, attachments=0, reference=, message-id=<87170c95bbc06eec92d9bc277dd26188@localhost.localdomain>, retention=2557, folder=0, delay=0.0363, status=stored
    

    Then the 2nd email (note that it's the same email):

    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250-xxx.acts.hu#015#012250-PIPELINING#015#012250-STARTTLS#015#012250-CHUNKING#015#012250-SIZE#015#012250 8BITMIME#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: got on fd=6: *MAIL FROM:<aaa@aaa.fu> SIZE=14021 BODY=8BITMIME#015#012*
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: got on fd=6: *RCPT TO:<archive+sanyi=xxx.acts.hu@yyy.acts.hu>#015#012*
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 Ok#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: got on fd=6: *DATA#015#012*
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 354 Send mail data; end it with <CRLF>.<CRLF>#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: received: INCHUZ6EX3YOCZ3V, from=aaa@aaa.fu, size=13996, client=51.15.71.197, fd=6
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 250 OK <INCHUZ6EX3YOCZ3V>#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: got on fd=6: *QUIT#015#012*
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: sent on fd=6: 221 yyy.acts.hu Goodbye#015
    Aug  8 06:49:22 56164ed1ef17 piler-smtp[447]: disconnected from 1.2.3.4 on fd=6 (0 active connections)
    Aug  8 06:49:22 56164ed1ef17 piler[567]: 1/INCHUZ6EX3YOCZ3V: discarding: duplicate message, id: 20, message-id: <87170c95bbc06eec92d9bc277dd26188@localhost.localdomain>
    Aug  8 06:49:22 56164ed1ef17 piler[567]: 1/INCHUZ6EX3YOCZ3V: 400000005b6a927c39d91ec400faaaf31608, size=14039/0, attachments=0, reference=, message-id=<87170c95bbc06eec92d9bc277dd26188@localhost.localdomain>, retention=0, folder=0, delay=0.0126, status=duplicate
    

    Aha, it's a duplicate! However, when checking the piler database the extra 'bcc' address (ie. sanyi@xxx.acts.hu) is added to the rcpt list, so he's able to see the message even if he's not in the mail header at all.

    MariaDB [piler]> select id, piler_id, `from`, `to`, subject from v_messages where id=20;
    +----+--------------------------------------+--------------------+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
    | id | piler_id                             | from               | to                    | subject                                                                                                                       |
    +----+--------------------------------------+--------------------+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
    | 20 | 400000005b6a926f390f4acc00fff557f06c | hirlevel@gruppi.hu | someuser@acts.hu       | Phone Mate U8 bluetooth érintőkijelzős okosóra. |
    | 20 | 400000005b6a926f390f4acc00fff557f06c | hirlevel@gruppi.hu | bela@xxx.acts.hu  | Phone Mate U8 bluetooth érintőkijelzős okosóra.  |
    | 20 | 400000005b6a926f390f4acc00fff557f06c | hirlevel@gruppi.hu | sanyi@xxx.acts.hu | Phone Mate U8 bluetooth érintőkijelzős okosóra. |
    +----+--------------------------------------+--------------------+-----------------------+-------------------------------------------------------------------------------------------------------------------------------+
    3 rows in set (0.001 sec)
    

    So the conclusion is that it still works properly.

  10. Martin Nadvornik reporter

    Ok, thanks for the reply. I will test this again on a non productive system an let you know if it works for me when I set everything up just like you did.

  11. Log in to comment