sendmail virtual user table

EQ Admin

EQ Forum Admin
Staff member
Hello,

There is a lot of flexibility available with the sendmail virtusertable.

The file is typically located at /etc/mail/virtusertable

The following are some examples of how to use this feature in sendmail.

A tab should be used to separate the two sides of each line in the virtusertable file.

bob@your-comapny.com bob

E-mail for bob@your-comapny.com will deliver to the local account bob.

bob@your-company.com error:nouser No such user here

E-mail to bob@your-company.com will be permanently rejected with the error "No such user here"


E-mail for bob@your-comapny.com will be forwarded to bob@another-company.com

@your-company.org %1@your-comapny.com

This creates a domain alias resulting in mail from bob@your-comapny.org forwarding to bob@your-company.com


@your-company.com bob

All remaining e-mail to @your-company.com will be delivered to the local account bob. This is also known as a catchall account. These are generally a bad idea since they can be abused and flooded with e-mail if the domain is subjected to a dictionary attack. I do not recommend using a catchall unless absolutely necessary.

@your-comapny.com error:5.1.1:550 No such user.

E-mail to usernames at your company that do not exist will be permanently rejected.

This is much better than creating a catchall account like in the above example.

When you make changes to your virtusertable file you need to rebuild the table from the source file.

# cd /etc/mail
# makemap hash virtusertable < virtusertable

You do -not- need to restart sending after making changes to the virtusertable.
 
Top