copy of mails with specific From-field

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

copy of mails with specific From-field

ceddie
Hello,

how can I put copies of outgoing mails with specific From-fields in the
outgoing-folder of a specific user?

Best regards
Cedric



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Jaroslaw Rafa
Dnia 27.09.2019 o godz. 13:20:48 Cedric Freiberger pisze:
>
> how can I put copies of outgoing mails with specific From-fields in the
> outgoing-folder of a specific user?

By "outgoing folder", you mean "Sent" folder?

It depends if you have real system users or some virtual mailboxes, because
probably a different method of actually inserting message into user's "Sent"
folder will be required in both cases.

I have done it for system users, if it's your case, I can describe it here.
--
Regards,
   Jaroslaw Rafa
   [hidden email]
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Bill Cole-3
In reply to this post by ceddie
On 27 Sep 2019, at 7:20, Cedric Freiberger wrote:

> Hello,
>
> how can I put copies of outgoing mails with specific From-fields in
> the
> outgoing-folder of a specific user?

That depends on how your users send mail and what you use to manage user
mailstores.

Generally speaking, that would be something done by an IMAP server
component like Dovecot's "pigeonhole" sieve implementation or a delivery
agent like procmail, NOT by Postfix.

--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Jaroslaw Rafa
Dnia 27.09.2019 o godz. 08:56:01 Bill Cole pisze:
>
> Generally speaking, that would be something done by an IMAP server
> component like Dovecot's "pigeonhole" sieve implementation or a
> delivery agent like procmail, NOT by Postfix.

It *can* be done using Postfix only, at least in some cases. I did it for
real system users using Maildirs to store mail. This solution can probably be
adapted to virtual mailboxes as well (in fact, it uses configuration for
virtual mailboxes, but delivers to real system mailboxes), but I haven't
tried it (also have no setup to try on :)).
--
Regards,
   Jaroslaw Rafa
   [hidden email]
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

ceddie

I'll try to be more precise:

We use "/^Sender:/ IGNORE" in smtp_header_checks to remove the sender-field in outgoing mails.

We also use the file sender_bcc to get copies of outgoing mails for specific sender. As far as we know, the sender_bcc uses the sender-field if present.

It seems like the sender_bcc is applied before the smtp_header_checks.

How can we get a bcc to the sender according to the from-field?

On 9/27/19 3:07 PM, Jaroslaw Rafa wrote:
Dnia 27.09.2019 o godz. 08:56:01 Bill Cole pisze:
Generally speaking, that would be something done by an IMAP server
component like Dovecot's "pigeonhole" sieve implementation or a
delivery agent like procmail, NOT by Postfix.
It *can* be done using Postfix only, at least in some cases. I did it for
real system users using Maildirs to store mail. This solution can probably be
adapted to virtual mailboxes as well (in fact, it uses configuration for
virtual mailboxes, but delivers to real system mailboxes), but I haven't
tried it (also have no setup to try on :)).
-- 
Cedric Freiberger
IT-Administration

Rheinwerk Verlag GmbH | Rheinwerkallee 4 | 53227 Bonn
Telefon +49 228 42150-709 | Fax +49 228 42150-77
E-Mail [hidden email]
www.rheinwerk-verlag.de 

Amtsgericht Bonn, HRB 8363
Geschäftsführer: Stephan A. Effertz, Judith Stevens-Lemoine, Tomas Wehren

❕  KKON – Die erste Rheinwerk Konferenz für Kotlin | März 2020 in Köln | Jetzt Tickets sichern! ❕

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Wietse Venema
Cedric Freiberger:
> We also use the file *sender_bcc *to get copies of outgoing mails for
> specific sender. As far as we know, the sender_bcc uses the sender-field
> if present.

sender_bcc_maps does not look at any message header, therefore
deleting that header has no effect on sender_bcc_maps.

> *How can we get a bcc to the sender according to the from-field?*

If you must, header_checks supports a BCC action (Postfix >= 3.0).
http://www.postfix.org/header_checks.5.html

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Jaroslaw Rafa
In reply to this post by ceddie
Dnia 27.09.2019 o godz. 15:18:59 Cedric Freiberger pisze:

> I'll try to be more precise:
>
> We use "/^Sender:/ IGNORE" in *smtp_header_checks *to remove the
> sender-field in outgoing mails.
>
> We also use the file *sender_bcc *to get copies of outgoing mails for
> specific sender. As far as we know, the sender_bcc uses the sender-field
> if present.
>
> It seems like the sender_bcc is applied before the smtp_header_checks.
>
> *How can we get a bcc to the sender according to the from-field?*

So I can't help with that. I only use sender_bcc (actually sender_bcc_maps,
to be precise) and don't mess with headers.
--
Regards,
   Jaroslaw Rafa
   [hidden email]
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Miles Fidelman
In reply to this post by ceddie
On 9/27/19 7:20 AM, Cedric Freiberger wrote:

> Hello,
>
> how can I put copies of outgoing mails with specific From-fields in the
> outgoing-folder of a specific user?

Big fan of procmail.  Or something that handles seive.  Or just sorting
rules in a good mail client.

Miles Fidelman


--
In theory, there is no difference between theory and practice.
In practice, there is.  .... Yogi Berra

Theory is when you know everything but nothing works.
Practice is when everything works but no one knows why.
In our lab, theory and practice are combined:
nothing works and no one knows why.  ... unknown

Reply | Threaded
Open this post in threaded view
|

Re: copy of mails with specific From-field

Matus UHLAR - fantomas
>On 9/27/19 7:20 AM, Cedric Freiberger wrote:
>>how can I put copies of outgoing mails with specific From-fields in the
>>outgoing-folder of a specific user?

On 27.09.19 10:44, Miles Fidelman wrote:
>Big fan of procmail.  Or something that handles seive.  Or just
>sorting rules in a good mail client.

either requires outgoing mail to be processes with procmail, which is not
done by default.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
   One OS to rule them all, One OS to find them,
One OS to bring them all and into darkness bind them