Replace subject with recipient localpart for one domain

2020-08-27 Thread John Schmerold
My Postfix server handles message for a dozen domains, for one of these domains, I want the subject replaced with the recipient's local part, so something like this, but put in a format that Postfix understands: # domain3.com is the one recipient domain we want affected by this rule # $recipien

Re: "max_use=1" does not work at a situation

2020-08-27 Thread Wietse Venema
kawakami: > Hi all, > > Setting "max_use=1" on /etc/master.cf, but the same process ID was > assigned to different connections(postfix/smtpd process) at particular > situation. SHOW LOGS.

Preventing domain impresonation

2020-08-27 Thread Marek Kozlowski
:-) Let's assume my hostname is 'sth.mydomain.tld' The following configuration: #- smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_sender_access hash:/etc

Re: Replace subject with recipient localpart for one domain

2020-08-27 Thread John Schmerold
On 8/27/2020 5:58 AM, Gregory Heytings wrote: My Postfix server handles message for a dozen domains, for one of these domains, I want the subject replaced with the recipient's local part, so something like this, but put in a format that Postfix understands: # domain3.com is the one recipi

Re: Preventing domain impresonation

2020-08-27 Thread Jaroslaw Rafa
Dnia 27.08.2020 o godz. 14:30:21 Marek Kozlowski pisze: > The following configuration: > > #- > smtpd_recipient_restrictions = > permit_mynetworks, > permit_sasl_authenticated, > reject_unauth_destination, > check_sender

Re: Preventing domain impresonation

2020-08-27 Thread Bill Cole
On 27 Aug 2020, at 9:26, Jaroslaw Rafa wrote: What does "check_sender_access" do in smtpd_recipient_restrictions ? According to documentation, you can have "check_recipient_access" there, but not "check_sender_access". Incorrect. From `man 5 postconf`: smtpd_recipient_restrictions (defau

Re: Feature suggestion: hook support for specific events?

2020-08-27 Thread Steffen Nurpmeso
Wietse Venema wrote in <4bcnlx0tr4zj...@spike.porcupine.org>: |Steffen Nurpmeso: |> Wietse Venema wrote in |> <4bcgr00pr0zj...@spike.porcupine.org>: |>|Steffen Nurpmeso: |>|> It would be great if a hook could be called for such events. Even |>|> a simple fork+detach+exec+forget approach wo

Re: Preventing domain impresonation

2020-08-27 Thread Rainer Ruprechtsberger
Hi, we utilize something along these lines. And yes: the forwarding problem needs to be addressed. in main.cf: smtpd_sender_restrictions = permit_mynetworks, reject_non_fqdn_sender, reject_authenticated_sender_login_mismatch, permit_sasl_authenticated, chec

Re: Replace subject with recipient localpart for one domain

2020-08-27 Thread Gregory Heytings
My Postfix server handles message for a dozen domains, for one of these domains, I want the subject replaced with the recipient's local part, so something like this, but put in a format that Postfix understands: # domain3.com is the one recipient domain we want affected by this rule # $rec

Re: Replace subject with recipient localpart for one domain

2020-08-27 Thread Bill Cole
On 27 Aug 2020, at 8:43, John Schmerold wrote: On 8/27/2020 5:58 AM, Gregory Heytings wrote: My Postfix server handles message for a dozen domains, for one of these domains, I want the subject replaced with the recipient's local part, so something like this, but put in a format that Postfi

Re: One Domain to Remote Email Gateway

2020-08-27 Thread Greg Sims
I did not get this solution started in the proper direction -- sorry. I believe the following solution is closer: main.cf: sender_dependent_relayhost_maps = regexp:/etc/postfix/sender_relay.regexp sender_relay.regexp: /@raystedman\.org$/ [smtp-relay.gmail.com] This should relay email wher

Re: One Domain to Remote Email Gateway

2020-08-27 Thread Wietse Venema
Greg Sims: > I did not get this solution started in the proper direction -- sorry. > I believe the following solution is closer: > > main.cf: > > sender_dependent_relayhost_maps = regexp:/etc/postfix/sender_relay.regexp > > sender_relay.regexp: > > /@raystedman\.org$/ [smtp-relay.gmail.com

Re: Feature suggestion: hook support for specific events?

2020-08-27 Thread Wietse Venema
Steffen Nurpmeso: > Wietse Venema wrote in > <4bcnlx0tr4zj...@spike.porcupine.org>: > |Steffen Nurpmeso: > |> Wietse Venema wrote in > |> <4bcgr00pr0zj...@spike.porcupine.org>: > |>|Steffen Nurpmeso: > |>|> It would be great if a hook could be called for such events. Even > |>|> a simple f

Re: Feature suggestion: hook support for specific events?

2020-08-27 Thread Steffen Nurpmeso
Wietse Venema wrote in <4bcx7t0nfyzj...@spike.porcupine.org>: |Steffen Nurpmeso: |> Wietse Venema wrote in |> <4bcnlx0tr4zj...@spike.porcupine.org>: |>|Steffen Nurpmeso: |>|> Wietse Venema wrote in |>|> <4bcgr00pr0zj...@spike.porcupine.org>: |>|>|Steffen Nurpmeso: |>|>|> It would be grea

Re: Replace subject with recipient localpart for one domain

2020-08-27 Thread John Schmerold
On 8/27/2020 3:26 PM, Gregory Heytings wrote: For cases like the one you have in mind, it is necessary to use a milter. Thank you for saving me some head scratching.  It wouldn't be the end of the world to spin up an Exim VM (its system_filtering is capable of this black magic), but would p

Re: Replace subject with recipient localpart for one domain

2020-08-27 Thread Gregory Heytings
For cases like the one you have in mind, it is necessary to use a milter. Thank you for saving me some head scratching.  It wouldn't be the end of the world to spin up an Exim VM (its system_filtering is capable of this black magic), but would prefer staying in Postfix. Do you have a milte

Re: Preventing domain impresonation

2020-08-27 Thread Viktor Dukhovni
On Thu, Aug 27, 2020 at 02:30:21PM +0200, Marek Kozlowski wrote: > #- > smtpd_recipient_restrictions = > permit_mynetworks, > permit_sasl_authenticated, > reject_unauth_destination, > check_sender_access hash:/etc/

.forward, vacation, and bashslash username support

2020-08-27 Thread Dominic Lai
Hi, Recently I have created a postfix driven (CentOS 8) mail server with dovecot-lda as local delivery agent. We have a few number of users who make use of vacation program (when they are on leave) so that upon activation, a .forward file is made under the home directory as: \username, "|/usr/bi

Re: Preventing domain impresonation

2020-08-27 Thread Bill Cole
On 27 Aug 2020, at 8:30, Marek Kozlowski wrote: :-) Let's assume my hostname is 'sth.mydomain.tld' The following configuration: #- smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Viktor Dukhovni
On Fri, Aug 28, 2020 at 02:04:36AM +, Dominic Lai wrote: > Recently I have created a postfix driven (CentOS 8) > mail server with dovecot-lda as local delivery > agent. You should explain what you mean by that in detail. > We have a few number of users who make use > of vacation program (whe

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Bill Cole
On 27 Aug 2020, at 22:04, Dominic Lai wrote: Hi, Recently I have created a postfix driven (CentOS 8) mail server with dovecot-lda as local delivery agent. We have a few number of users who make use of vacation program (when they are on leave) so that upon activation, a .forward file is made un

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Viktor Dukhovni
On Thu, Aug 27, 2020 at 11:31:29PM -0400, Bill Cole wrote: > No "historical discussion" is as definitive as the current Postfix > aliases man page: > >Lines in per-user .forward files have the same syntax as the >right-hand side of aliases(5) entries. > > Nowhere in that page is any sor

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Dominic Lai
Hi, On 28/8/2020 11:25 am, Viktor Dukhovni wrote: > On Fri, Aug 28, 2020 at 02:04:36AM +, Dominic Lai wrote: >> We have a few number of users who make use >> of vacation program (when they are on leave) so >> that upon activation, a .forward file is made >> under the home directory as: >> >> \

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Viktor Dukhovni
On Fri, Aug 28, 2020 at 03:42:20AM +, Dominic Lai wrote: > Aug 28 10:11:36 postfix-server postfix/local[3915542]: 2D8F33028D88: > to=, relay=local, > delay=0.06, delays=0.05/0/0/0.01, dsn=5.4.6, status=bounced (mail > forwarding loop for usern...@postfix-server.mydomain.com) > > When I look

Re: .forward, vacation, and bashslash username support

2020-08-27 Thread Dominic Lai
Yes, thanks for your suggestion. I tried it and it works. I kept on thinking that it would work if I just set: mydestination = postfix-server.mydomain.com $myhostname would work (I have set myhostname=postfix-server.mydomain.com). It turns out that I also need to set myorigin, and also need to

Re: "max_use=1" does not work at a situation

2020-08-27 Thread kawakami
On 2020/08/27 20:54, Wietse Venema wrote: kawakami: Hi all, Setting "max_use=1" on /etc/master.cf, but the same process ID was assigned to different connections(postfix/smtpd process) at particular situation. SHOW LOGS. Thank you for your reply. Here are the logs I picked out: Aug 3 15: