tanjimreza
To disable the Postfix root user from sending mail, you can configure it as follows:
Edit Postfix's main config file:
sudo vi /etc/postfix/main.cf
Add the smtpd_sender_restrictions parameter and make sure it is not commented (it does not start with #).
Add the following to the value of the smtpd_sender_restrictions parameter:
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access
Save and close the file.
Create and edit the /etc/postfix/sender_access file:
sudo vi /etc/postfix/sender_access
Add the following lines to the file:
root REJECT
This will deny the root user from sending mail.
Save and close the file.
Generate the sender_access.db file:
sudo postmap /etc/postfix/sender_access
Reload the Postfix configuration:
sudo systemctl reload postfix