[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Steffen Nurpmeso via Postfix-users
Wietse Venema via Postfix-users wrote in
 <4tpcly5z0dzj...@spike.porcupine.org>:
 |Steffen Nurpmeso via Postfix-users:
 |> Steffen Nurpmeso wrote in
 |>  <20240305004501.fwAHTulV@steffen%sdaoden.eu>:
 |>|Wietse Venema via Postfix-users wrote in
 |>| <4tpc280nhvzj...@spike.porcupine.org>:
 |>||Steffen Nurpmeso via Postfix-users:
 |>||> Is it possible to escape braces in resource files?
 |>  ...
 |>||What happens when you specify 
 |>||
 |>|| --milter-macro-sign {daemon_name},sigm
 |>|
 |>|That was where i was coming from:
 |>|
 |>|  Daemon postfix restart
 |>|  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in \
 |>|  "{daemon_name$},sign"
 |>  ...
 |> 
 |> And in the log (sorry for the time, s
 |> 
 |>   Mar  5 01:44:05 (none) postfix/postfix-script[4006]: starting the \
 |>   Postfix mail system
 |>   Mar  5 01:44:05 (none) postfix/master[4008]: fatal: /etc/postfix-lmdb/m\
 |>   aster.cf: line 114: syntax error after '}' in "{daemon_name$},sign"
 |>   Mar  5 01:44:06 (none) postfix/master[4007]: fatal: daemon initializati\
 |>   on failure -- see logs for details
 |>   Mar  5 01:44:07 (none) postfix/postfix-script[4021]: fatal: mail \
 |>   system startup failed
 |
 |I think that for now you'll have to put those commands in a script.

Ok by me.  Good night from Germany!

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Wietse Venema via Postfix-users
Steffen Nurpmeso via Postfix-users:
> Steffen Nurpmeso wrote in
>  <20240305004501.fwAHTulV@steffen%sdaoden.eu>:
>  |Wietse Venema via Postfix-users wrote in
>  | <4tpc280nhvzj...@spike.porcupine.org>:
>  ||Steffen Nurpmeso via Postfix-users:
>  ||> Is it possible to escape braces in resource files?
>  ...
>  ||What happens when you specify 
>  ||
>  || --milter-macro-sign {daemon_name},sigm
>  |
>  |That was where i was coming from:
>  |
>  |  Daemon postfix restart
>  |  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in \
>  |  "{daemon_name$},sign"
>  ...
> 
> And in the log (sorry for the time, s
> 
>   Mar  5 01:44:05 (none) postfix/postfix-script[4006]: starting the Postfix 
> mail system
>   Mar  5 01:44:05 (none) postfix/master[4008]: fatal: 
> /etc/postfix-lmdb/master.cf: line 114: syntax error after '}' in 
> "{daemon_name$},sign"
>   Mar  5 01:44:06 (none) postfix/master[4007]: fatal: daemon initialization 
> failure -- see logs for details
>   Mar  5 01:44:07 (none) postfix/postfix-script[4021]: fatal: mail system 
> startup failed

I think that for now you'll have to put those commands in a script.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Steffen Nurpmeso via Postfix-users
Steffen Nurpmeso wrote in
 <20240305004501.fwAHTulV@steffen%sdaoden.eu>:
 |Wietse Venema via Postfix-users wrote in
 | <4tpc280nhvzj...@spike.porcupine.org>:
 ||Steffen Nurpmeso via Postfix-users:
 ||> Is it possible to escape braces in resource files?
 ...
 ||What happens when you specify 
 ||
 || --milter-macro-sign {daemon_name},sigm
 |
 |That was where i was coming from:
 |
 |  Daemon postfix restart
 |  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in \
 |  "{daemon_name$},sign"
 ...

And in the log (sorry for the time, s

  Mar  5 01:44:05 (none) postfix/postfix-script[4006]: starting the Postfix 
mail system
  Mar  5 01:44:05 (none) postfix/master[4008]: fatal: 
/etc/postfix-lmdb/master.cf: line 114: syntax error after '}' in 
"{daemon_name$},sign"
  Mar  5 01:44:06 (none) postfix/master[4007]: fatal: daemon initialization 
failure -- see logs for details
  Mar  5 01:44:07 (none) postfix/postfix-script[4021]: fatal: mail system 
startup failed

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Steffen Nurpmeso via Postfix-users
Wietse Venema via Postfix-users wrote in
 <4tpc280nhvzj...@spike.porcupine.org>:
 |Steffen Nurpmeso via Postfix-users:
 |> Hello.
 |> 
 |> Is it possible to escape braces in resource files?
 |> I am currently testing an hm early beta of my thing and did
 |> 
 |>   lb = {
 |>   rb = }
 |> 
 |> in main.cf to be able to say
 |> 
 |>   dkim-sign unix - n n - - spawn
 |> user=_postfix_xlocal argv=/tmp/s-dkim-sign
 |> --milter-macro-sign ${lb}daemon_name${rb},sign
 |
 |What happens when you specify 
 |
 | --milter-macro-sign {daemon_name},sigm

That was where i was coming from:

  Daemon postfix restart
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  postfix/postfix-script: stopping the Postfix mail system
stop $?: 0
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  /usr/sbin/postconf: warning: master.cf: syntax error after '}' in 
"{daemon_name$},sign"
  postfix/postfix-script: starting the Postfix mail system
  postfix/postfix-script: fatal: mail system startup failed

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Wietse Venema via Postfix-users
Steffen Nurpmeso via Postfix-users:
> Hello.
> 
> Is it possible to escape braces in resource files?
> I am currently testing an hm early beta of my thing and did
> 
>   lb = {
>   rb = }
> 
> in main.cf to be able to say
> 
>   dkim-sign unix - n n - - spawn
> user=_postfix_xlocal argv=/tmp/s-dkim-sign
> --milter-macro-sign ${lb}daemon_name${rb},sign

What happens when you specify 

 --milter-macro-sign {daemon_name},sigm

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Wietse Venema via Postfix-users
Steffen Nurpmeso via Postfix-users:
> Hello.
> 
> Is it possible to escape braces in resource files?
> I am currently testing an hm early beta of my thing and did
> 
>   lb = {
>   rb = }

No, Don't do that.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Escaping of braces {} in configuration (master(5))

2024-03-04 Thread Steffen Nurpmeso via Postfix-users
Hello.

Is it possible to escape braces in resource files?
I am currently testing an hm early beta of my thing and did

  lb = {
  rb = }

in main.cf to be able to say

  dkim-sign unix - n n - - spawn
user=_postfix_xlocal argv=/tmp/s-dkim-sign
--milter-macro-sign ${lb}daemon_name${rb},sign
--key rsa-sha256,rsa,/tmp/pri-rsa.pem
--key ed25519-sha256,ed,/tmp/pri-ed25519.pem
--verbose --verbose

in master.cf, but i get dozens of

  /usr/sbin/postconf: warning: /etc/postfix-lmdb/main.cf: unused parameter: lb={
  /usr/sbin/postconf: warning: /etc/postfix-lmdb/main.cf: unused parameter: rb=}

at startup.  If i say \{daemon_name\} it works, but the
backslashes are passed literally, too, ditto double quotation
marks.  I mean in the end i want a resource file, but i think
i ask after stumbling, and having found nothing in postconf(5) and
master(5).

Thanks and Ciao!

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: A functional lightweight reverse alias?

2024-03-04 Thread Ralph Seichter via Postfix-users
* mattpr via Postfix-users:

> Adding email aliases to an email client doesn't make sense because
> there are just too many and I wouldn't want to have to pick one.

Pick one what? Pick an alias, I presume, or pick a mail client (MUA)?

> Last count I had ~2500 records in my password manager (not all
> emails/logins...but most).

Not a problem, it just requires a setup which scales. I use a large
number of aliases myself, easily in the three digit numbers. Whenever I
need a fresh alias, I simply add it to my LDAP server. That only takes
seconds. Postfix and Dovecot are both configured to perform LDAP
lookups, so neither of them need to be touched.

As for MUAs: It was already mentioned that Thunderbird supports multiple
identities for multiple accounts (n:m relationship). When composing
replies, TB will automatically pick the correct account-identity-pair,
but if an identity is used very rarely, it is also possible to change
the From-Header manually on an ad-hoc basis. One /can/ add identities,
but one doesn't have to; a brief manual override suffices.

Additionally, I use Notmuch (https://notmuchmail.org) for mailing lists,
which offers even greater flexibility. The complete message header is
pre-generated and available for any modification I desire right there in
my text editor.

All this works fine for me, and it has proven both robust and flexible
enuough for my personal needs over the course of many years. Your
mileage may vary.

-Ralph
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: A functional lightweight reverse alias?

2024-03-04 Thread Bill Cole via Postfix-users

On 2024-03-02 at 04:45:53 UTC-0500 (Sat, 2 Mar 2024 10:45:53 +0100)
Gerben Wierda via Postfix-users 
is rumored to have said:

Aliases are nice, to receive mail. But when you reply, the address 
behind the alias is exposed.


To prevent that I need to create full mailboxes, which requires a lot 
of administration  in dovecot, postfix.


Suppose
- I am m...@mydomain.tld
- At evilcompany.com they know be by my alias 
meatevilcomp...@mydomain.tld

- I am mailing with marketingt...@evilcompany.com

Is there a way to create a lightweight 'reverse alias' for a specific 
target. E.g., suppose my alias is


meatevilcompany:me

then have a mail from m...@mydomain.tld to marketingt...@evilcompany.com 
turn into a reply from meatevilcomp...@mydomain.tld to 
marketingt...@evilcompany.com, but only for 
marketingt...@evilcompany.com or for @evilcompany.com?


There is a commonly-used header that supports MUAs handling this: 
X-Original-To


Postfix will add that to mail it is delivering locally by default. It 
also adds  a Delivered-To header with the final result of aliasing.


Some MUAs (I think this included TBird but I have not used it regularly 
in many years) can be configured to recognize those and compose replies 
as being "From: " the X-Original-To address, using the Delivered-To to 
figure out what account the reply should use for determining outbound 
server & auth.


This seems like it is much more suited to the MUA rather than a MTA/MSA. 
I don't think I want something on the server responsible for rewriting 
headers to keep their original content confidential when the user's MUA 
could have just written the proper public address there in the first 
place. I've been working with mailing lists this way for years on 
Eudora, Mulberry, TBird, and now MailMate. I reply to a message with an 
X-Original-To header and the MUA uses that address to compose and send 
the message.


--
Bill Cole
b...@scconsult.com or billc...@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: A functional lightweight reverse alias?

2024-03-04 Thread mattpr via Postfix-users


Matus UHLAR - fantomas via Postfix-users  wrote:
> 
> Mozilla supports multiple identities on the same mailbox, even using 
> different sending server/mailbox. 
> So, with mozilla you can have the same result with both alias and mailbox.
> However, this may not apply to other clients, where separate account may be 
> needed.


Adding email aliases to an email client doesn't make sense because there are 
just too many and I wouldn't want to have to pick one.  Last count I had ~2500 
records in my password manager (not all emails/logins...but most).

I'm also someone that uses a catch-all in order to give out unique email to 
every website I have to give my email to. Enables me to see who is selling my 
address and then blackhole specific addresses if they start getting a bunch of 
spam.  Don't get me started on hashed emails as the new 
advertising/cross-device IDs.

I've also thought about the outgoing problem as well.  In addition to revealing 
my real email, it also causes problems when "clever" companies are using my 
From address as some sort of awesome security check ("please write us from your 
registered account email, because this proves it is really you").

I haven't implemented it yet, but my plan was the following...

- incoming milter to build record of From/Reply-to (evil company) to To 
addresses (my aliases).  This milter would just store this in a db (memcached 
or redis).
- outgoing milter - looks at the To address, does a lookup in the db and then 
re-writes the sender

Having the pair of milters solves (sorta) the "which alias to reply from" 
problem based on recency.

There are a lot of edge cases here that would require some thought...

- what happens when you reply-all and there are multiple To addresses?  Which 
one should be used for the lookup?  You may have received email from multiple 
of them in the past at different aliases.  I guess you could avoid batch 
delivery and send to each of them individually with different alias.  But what 
about the ones that don't yet have an alias...what alias do you use?
- what happens if a given company has multiple emails for you and you reply to 
an older email?  likely you use the most recently stored alias mapping which 
may not reflect the alias that was used on the mail you actually replied to.

A more robust solution would be an email client that supported this by parsing 
the original email headers (from evil company) and adding a header on the reply 
that could be used (and stripped) by a milter to deterministically reply with 
the right alias.  But if you want to use off-the-shelf email clients and have 
this also work from your phone and computer, etc...not going to be a realistic 
option.

So then I start thinking about caching message IDs and doing it on that level 
rather than cached From/Reply-To addresses...but then the database gets much 
bigger...but if you don't often reply to old email, you could dispose of 
records based on recency and just accept not hiding your email if you reply to 
emails older than X days.

Another thought...what about email that you send (support@evilcompany) where 
you don't have a relationship with them yet (nothing in db)?  Outgoing milter 
could theoretically generate an alias for you based on company domain or 
something and store it in the db so you use the same one in future 
communication.

What about on a domain level rather than on an email@domain level?  Exceptions 
for gmail, proton, etc?

I'm also not totally sold on any of these approaches, so happy if someone has a 
clever idea.




___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: A functional lightweight reverse alias?

2024-03-04 Thread Matus UHLAR - fantomas via Postfix-users

On 3 Mar 2024, at 19:24, Matus UHLAR - fantomas via Postfix-users 
 wrote:

The question was if there is other solution for this.


On 04.03.24 11:52, Gerben Wierda via Postfix-users wrote:
Indeed.  If I use an alias in /etc/aliases, mail from X to that alias gets 
delivered to my original mailbox.  If I reply, it gets sent from that 
original mailbox (canonicals included).  So, I was looking for a way to 
reply such that the one (X) who sent to the alias would get reply from 
that alias, but only the one that sent to that alias.  I’m OK with 
generalising to ‘all mail to X’.  I think Wietse’s milter suggestion might 
do the trick, but I also think this will be too complex for me having not 
enough daily practice with creating milters.


Mozilla supports multiple identities on the same mailbox, even using 
different sending server/mailbox. 


So, with mozilla you can have the same result with both alias and mailbox.
However, this may not apply to other clients, where separate account may be 
needed.


So far I only know of ticketing systems like OTRS but that's far more than 
e-mail.


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; 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.
Linux IS user friendly, it's just selective who its friends are...
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: A functional lightweight reverse alias?

2024-03-04 Thread Gerben Wierda via Postfix-users


> On 3 Mar 2024, at 19:24, Matus UHLAR - fantomas via Postfix-users 
>  wrote:
> 
> The question was if there is other solution for this.

Indeed. If I use an alias in /etc/aliases, mail from X to that alias gets 
delivered to my original mailbox. If I reply, it gets sent from that original 
mailbox (canonicals included). So, I was looking for a way to reply such that 
the one (X) who sent to the alias would get reply from that alias, but only the 
one that sent to that alias. I’m OK with generalising to ‘all mail to X’. I 
think Wietse’s milter suggestion might do the trick, but I also think this will 
be too complex for me having not enough daily practice with creating milters.

Gerben Wierda (LinkedIn )
R Enterprise Architecture  (main site)
Book: Chess and the Art of Enterprise Architecture 
Book: Mastering ArchiMate 
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org