Allow sending email only when the sender is the same of the authenticated user or have some allowed identities

,

Hi,

I would like to configure Nethserver NG 7.x to allows to send mails only if the sender ("From: ") is the same of the autenticated user or he/she have some allowed identities.

I tried with this article:

https://superuser.com/questions/1037395/how-can-i-prevent-that-an-user-sends-mail-like-another-user-on-postfix

that it’s seems to do what I want, but I can’t make it work.

The identities may be differents from the user’s email domain.

Example:

my account in the server is saitobenkei@domain.tld and I want to be allow to send mails from my account only if in the "From: " field I put saitobenkei@domain.tld (my e-mail address) or some identities as pippo@domain.tld, saitobenkei@anotherdomain.tld, othermail@newdomain.tld (these are only identity that I allowed to use wit my account).

Some clue/help?

Thankyou.