The qmail-taps-extended patch by Inter7 (extension by Michai Secasiu) provides the ability to save each email which flows through the system. You could decide to log only the messages which have the From or To address set to a local account.
You just have to create a new control file /var/qmail/control/taps which contains a regex style list of addresses to tap and the email address of where you want the copy sent to.
Examples:
if you only want to log the messages with the From address @domain.com you would set the configuration like this:
F:.*@domain.com:copy@example.com
If you want to log only those with the To address @domain.com
T:.*@domain.com:copy@example.com
if you want the same behavior as the original Inter7's patch:
A:.*@domain.com:copy@example.com
Comments
Duplicate e-mails
Violeta Madjarova July 8, 2024 09:41 CET
Hi Roberto and THANK YOU for your great work to guide, document and support your Qmail distribution!
I have installed your Qmail release v2024.02.06.
I am using qmail taps feature to log mail sent from user1 to another mailbox in the same localdomain:
When user1 sends mail to somebody of the @localdomain.com, we receive it 2 times in backup@localdomain.com.
When user1 sends mail to @outsidedomain.com, we receive it 1 times.
And the second experiment:
When user1 sends mail to somebody of the @localdomain2.com, we receive it 2 times in backup@localdomain2.com.
When user1 sends mail to somebody of the @localdomain.com or @outsidedomain.com, we receive it 1 times in backup@localdomail2.com.
I saw similar comments for the qmail-taps-extended pach. The qmail-tap patch didn’t have this problem.
Reply | Permalink
Duplicate e-mails
Roberto Puzzanghera Violeta Madjarova July 8, 2024 17:46 CET
Hi Violeta,
I cannot reproduce the issue here in neither situation you mentioned. I don't know if it's intentional, but if I use a control/taps with spaces like in your example it won't copy the emails
I'm testing like this
or even
Reply | Permalink
Duplicate e-mails
Anonymous Roberto Puzzanghera July 9, 2024 09:48 CET
Hi Roberto,
There are no spaces in my real taps control file.
You can reproduce the issue if in your taps:
F:user1@localdomain.com:backup@localdomain2.com
user1@localdomain.com sends message to user2@localdomain2.com
Then backup@localdomain2.com receives 2 identical messages from user1@localdomain.com (duplicates).
In summary: the issue appears when the receiver and backup-box are in the same domain.
Reply | Permalink
Duplicate e-mails
Roberto Puzzanghera Anonymous July 9, 2024 11:33 CET
I would check the .qmail-default and the backup-box .qmail file if it exists
Reply | Permalink
Duplicate e-mails
Violeta Madjarova Roberto Puzzanghera July 10, 2024 20:06 CET
Hello Roberto,
Thanks for your efforts for resolving of my problem. Your advice was correct. The problem was in my .qmail file:
The receiver (user2@localdomain2.com) has .qmail file to anotherbox@localgomain2.com and this was the reason for the delivering of two identical messages. There is a clear log in /var/log/qmail/send for that.
Once again thank you for your time and support!
Reply | Permalink
Duplicate e-mails
Roberto Puzzanghera Anonymous July 9, 2024 09:53 CET
Hi Violeta,
this is actually the test I did. I receive only one backup message, as expected
Reply | Permalink
Duplicate e-mails
Iulian Stan April 24, 2019 07:09 CET
I just installed this patch and unfortunately i am getting duplicate e-mails when the e-mail taps is sending an email locally and remote as well.
I am missing something or this would be the normal behavior?
To be more exactly: sender x@domain.com is sending emails towards y@domain.com and z@anotherdomaina.com.
If I am using F:x@domain.com:k@randomdomain.com I am getting duplicate email in k@randomdomain.com
Reply | Permalink
Duplicate e-mails
Roberto Puzzanghera Iulian Stan April 24, 2019 19:06 CET
yes the expected behaviour is to get a copy of each email with x@domain.com in the From field forwarded to k@randomdomain.com
Reply | Permalink