• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

limit outgoing mail to own domain

hugosnel

Basic Pleskian
Hello,
I need to limit outgoing mail to own domain for certain users.
I have found some articles conc this subject but would like to have more input!!
Anyone?

ps where can I find the file limit outgoing sendmail.cf? is it a general or user dependent file??
 
Merci!
I know most of this fonctionallity of Plesk but I mean like for my domain.com:
Xxx@mydomain has right to send to everywhere
Yyy&mydomain.com may ONLY send to mydomain.com
It seems to be a standard function in ms exchange!
Hugo
 
Looks promising, it will take some study and time ...
I will report back .
Merci encore!
Anybody else ?
 
/etc/postfix/main.cf:
smtpd_recipient_restrictions =
...
check_sender_access hash:/etc/postfix/restricted_senders
...other stuff...

smtpd_restriction_classes = local_only
local_only =
check_recipient_access hash:/etc/postfix/local_domains, reject

/etc/postfix/restricted_senders:
foo@domain local_only
bar@domain local_only

/etc/postfix/local_domains:
this.domain OK matches this.domain and subdomains
that.domain OK matches that.domain and subdomains


Specify dbm instead of hash if your system uses dbm files instead of db files. To find out what map types Postfix supports, use the command postconf -m.

So as I uderstand it:
1 I edit main.cf and add the 2 code lines at their correct place
2 I create two files /etc/postfix/restricted_senders & /etc/postfix/local_domains
These two files are just plain text file, what are their rights?

TIA,
Hugo
 
Seems OK, if you can test it before on a dev env. it would be the best. Don't forget to postmap your files.

Let us know how it goes!
 
Please assist me a bit more:
what will be the syntaxis of
makemap file_type file_name < file_name with
for the file /etc/postfix/restricted_senders ?
 
Just to be clear, try this in a dev env before. I'm not responsable for anything that happens if there's an issue.

What I use is: postmap /path/to/your/file (ex: postmap /etc/postfix/restricted_senders)

Please let us know how it goes.
 
Back
Top