Re: How to copy all outgoing mails based on sender definition

2021-06-08 Thread Edgar Pettijohn
Sorry for spamming the list, but noticed that part of the script was 
missing for some reason.


line 66 should be concluded with 


Edgar

On 6/8/21 4:31 PM, Edgar Pettijohn wrote:


On 6/7/21 6:52 PM, Edgar Pettijohn wrote:


On 6/7/21 6:35 PM, Thomas Bohl wrote:
So I have a list of users defined on a server and I want to copy 
all mails of users with a specific mail domain.


I don't think that is possible without writing a custom filter or mda.



Do you need a copy of all:

a) incoming mails

b) outgoing mails

c) all of the above


Edgar



Attached is a barely tested archive script.


filter archive proc-exec "/path/to/script.pl"

listen on egress port 587 auth  filter "archive"


Edgar






Re: How to copy all outgoing mails based on sender definition

2021-06-08 Thread Edgar Pettijohn


On 6/7/21 6:52 PM, Edgar Pettijohn wrote:


On 6/7/21 6:35 PM, Thomas Bohl wrote:
So I have a list of users defined on a server and I want to copy 
all mails of users with a specific mail domain.


I don't think that is possible without writing a custom filter or mda.



Do you need a copy of all:

a) incoming mails

b) outgoing mails

c) all of the above


Edgar



Attached is a barely tested archive script.


filter archive proc-exec "/path/to/script.pl"

listen on egress port 587 auth  filter "archive"


Edgar




filter-archive.pl
Description: Perl program


Re: How to copy all outgoing mails based on sender definition

2021-06-08 Thread Hagen Bauer

As a workaround I will use postfix as a "filter"

I created a seperate jail with postfix. This postfix configuration is very 
simple. Just relayhost, sender_bcc list and hostname.

Within opensmtp config I am forwarding all mails that are sent from users to 
this postfix. This postfix is using the sender_bcc list and forwarding all 
mails to the archive server and then relaying all mails back to opensmtpd.

This is certainly no solution for all organisational sizes but for me it should 
work. The configuration overhead is very low and I can combine the simplicity 
of opensmtpd with the function of postfix.



On Mon, Jun 07, 2021 at 08:52:39AM +0200, Hagen Bauer wrote:

is this really not possible or planed?

No way? I really like the way opensmtpd is configured and I would hate to move 
back to postfix but this is really critical

Any ideas or hints?

Regards
Hagen


Hi

Due to german laws all businesses are required to implement a long term archiv 
of business related mails. A majority of mail archiving software is integrated 
vie a simple mail forward of all mails.

In postfix this can be done via sender_bcc_maps / receiver_bcc_maps

I have found a way to forward all incoming mails based on the receiver but I am 
failing to find a way to do this for outgoing mails

So I have a list of users defined on a server and I want to copy all mails of 
users with a specific mail domain.

Any way to implement this in opensmtpd without routing all mails through 
postfix?

Regards

Hagen