Applicable to:
- Plesk for Linux
Symptoms
-
When the mail service is enabled for a domain (i.e. example.com), the following email accounts are set up in Postfix by default:
postmap -s /var/spool/postfix/plesk/virtual | grep @example1.com
anonymous@example.com anonymous@localhost.localdomain
drweb@example.com drweb@localhost.localdomain
kluser@example.com kluser@localhost.localdomain
postmaster@example.com postmaster@localhost.localdomain
root@example.com root@localhost.localdomain
mailer-daemon@example.com mailer-daemon@localhost.localdomain -
If an email message is sent to one of those email accounts (e.g. root@example.com), it gets forwarded to the email address that is set under the Plesk Administrator's Profile.
Cause
This behavior is by design: In the following output, it can be seen that all emails sent to the accounts mentioned (for example root@localhost.localdomain) are forwarded to Plesk Administrator email address (for example pleskadmin@example.com):
postmap -s /var/spool/postfix/plesk/aliases
drweb pleskadmin@example.com
kluser pleskadmin@example.com
postmaster pleskadmin@example.com
root pleskadmin@example.com
anonymous pleskadmin@example.com
drweb-daemon pleskadmin@example.com
ailer-daemon pleskadmin@example.com
mailman pleskadmin@example.com
Resolution
To change this behavior:
-
Connect to the server via SSH;
-
Modify
/etc/aliases
file to forward all messages from desired accounts to another mailbox (for example john.doe@example.com).For instance, for the account root@localhost.localdomain, add the following line into the
/etc/aliases
file:root: john.doe@example.com
-
Run the following command:
# postalias /etc/aliases
-
Verify that the setting applied:
# postmap -s /etc/aliases | grep root
Note: This will not affect accounts created in Plesk with the name root@domainname.com, but if the mailbox does not exist then the message will be forwarded to john.doe@example.com instead of the Plesk Administrator email address.