Article ID: 119654, created on Jan 15, 2014, last review on Jan 19, 2015

  • Applies to:
  • Plesk Automation 11.1
  • Plesk Automation 11.5

Symptoms

I am trying to send a message via webmail, but I encounter the following error:

User unknown in virtual alias table

Or:

Could not send message to SMTP server. Check you have access to send messages via the server and that all To/CC/BCC addresses are valid\nError: SMTP Server rejected email. Returned:550 5.1.1 <admin@example.com>: Recipient address rejected: User unknown in virtual mailbox table

The Postfix database contains records about domains with mail hosting not from this server:

~# postmap -s /var/spool/postfix/plesk/virtual
admin@domain.tld    admin@localhost.localdomain

Cause

1) This issue may occur when the /var/spool/postfix/plesk/virtual file contains invalid/incorrect records about a domain. The format of this file should be:

    pattern address, address, ...

Where the pattern matches a mail address. For example:

    postmap -s /var/spool/postfix/plesk/virtual | grep domain.tld
    test@domain.tld test@domain.tld

2) Incorrect Postfix configuration on the webmail node (Management Node by default). Most likely, the mchk script was run and broke the Postfix configuration.

Resolution

  1. Check that the /var/spool/postfix/plesk/virtual file contains valid records. Try to search by domain name, for example:

    postmap -s /var/spool/postfix/plesk/virtual | grep domain.tld
    

You may see a record like:

    # postmap -s /var/spool/postfix/plesk/virtual | grep domain.tld
    .........
    domain.tld 1     

This means that mail redirection is not valid for domain.tld and the file should be corrected.

a. Create a backup of the /var/spool/postfix/plesk/virtual.db file.

b. Put the information from this file to another temporary file:

    # postmap -s /var/spool/postfix/plesk/virtual >/tmp/bkp/virtual

c. Delete the invalid record that was shown above:

    domain.tld 1   

    # vi /tmp/bkp/virtual

d. Create a new virtual.db file:

    # postmap /tmp/bkp/virtual

e. Copy the new virtual.db file to /var/spool/postfix/plesk

    # cp /tmp/bkp/virtual.db /var/spool/postfix/plesk

f. Check mail delivery.

Other case

If Postfix files are corrupted completely, or empty:

  1. Create a backup of the current configuration:

    ~# cp -Rp /var/spool/postfix/plesk /var/spool/postfix/plesk.backup
    
  2. Remove redundant records from the Postfix database:

    ~# cd /var/spool/postfix/plesk/
    
    ~# for db_file in virtual virtual_domains ; do
        ls -1 --color=never /var/qmail/mailnames > /tmp/domains.txt
        hostname -f >> /tmp/domains.txt
        postmap -s /var/spool/postfix/plesk/$db_file > /tmp/${db_file}_temp
        grep -f /tmp/domains.txt /tmp/${db_file}_temp > /tmp/$db_file
        postmap /tmp/$db_file
        mv /tmp/$db_file.db /var/spool/postfix/plesk/
       done
    

c1ecc6010feff26cb42d1d14a7881dd6 e0aff7830fa22f92062ee4db78133079 33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065

Email subscription for changes to this article
Save as PDF