Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

virtusertable file entries

Status
Not open for further replies.

stevenriz

IS-IT--Management
May 21, 2001
1,069
First of all, will the virtusertable file contain only email addresses that are NOT users of the server? In other words, will sendmail look at the passwd file before it looks at the virtusertable file? The server I am talking about is configured for virtual domains.

I understand that lines in this file won't let you reference other lines. So this will not work, correct? I am thinking anything sent to info@domain1.com will go to joseph and everything else will go to jack as long as there isn't a matching user on the system.

info@domain1.com joseph
@domain1.com jack

Thanks!!
Steve
 
You are correct. info@domain1.com will go to joseph and everything else for domain1.com will go to jack. This assumes that both joseph and jack have user accounts on your system. However I like to use the catch-all to return a message saying that this server doesn't allow spam because most spammers will send mail with every name in the would to every domain in the world. Here's an example of how I do that:

@mydomain.com error:nouser This server does not allow spam!

I have this for every domain I host on the mail server. That way nobody gets mail like bogus@mydomain.com.
 
If I read this right, "error" might be an email account on your server that has an autoreply set up on it???

well how do legitimate emails get through to the users? OR are you saying some spam might get through to the users and everything else gets a reply saying "we don't accept spam".... In other words, like you wrote, spammers send email to every possible name at every possible domain, obviously some become a legitimate email and sneak through...

Secondly, why bother returning an email to the spammers?? They probably don't accept emails anywyas... Just curious. Thanks for the reply!
Steve
 
No, in this case "error:nouser" works a lot like the error pages in http such as "page not found" or "server not found". In this case if a name is not specified then it defaults to the catch-all (@domain.com). The "error:nouser" tells the server that if no user is found then return the following text rather than the default "unknown user" or "user not found". It does not return the mail. It just rejects it with the specified message. I should also mention that there are more errors than "nouser". I just chose that one because it usually means that someone is sending an email to a user that doesn't exist. Keep in mind that this is just part of a spam blocking scheme I use.
 
great thanks RhythmAce. Now once I get the virtusertable file the way I want it, i understand I need to run the makemap command. What about newaliases? What is the correct syntax???

makemap -r hash virtusertable < virtusertable

or

makemap -r hash virtusertable.db < virtusertable
 
If it's compiled to use the db format (almost always is) then the second one is what you would use. You don't need to use the newaliases command unless you modified the alias database. I know it's a pain listing every user and virtual user especially if you have a lot of them but it cuts back on a lot of unwanted mail on your server. Not to mention, your spam filters will love the daylights out of you for cutting down on the amount of mail they have to sift through too.
 
cool, Now there are already some entried in the virtusertable.db file, is that what the -r switch will do? Will it save what's in there and note overwrite the file?
 
Ummm, I don't think that is how it works. I've never used it because I thought it was saying it was ok to replace a duplicate entry. Any way, if you have something in virtusertable.db and it is not in the current virtusertable, you can issue the following command to dump the current database then you can cut and past it into the new virtusertable.

makemap -u hash /etc/mail/virtusertable.db > /etc/mail/oldtable

This will dump the current database into a file called oldtable.
 
beautiful!! you rock, thanks and have a great weekend!!
Steve
 
Depending on which distro you use you may be able to have the *.db files regenerated with a single 'make' command. If you're using a distro supplied sendmail, look in /etc/mail to see if there's a Makefile. As an example, if you change the virtuser file, you need only run 'make' and it will detect that the file is different and will run the correct makemap command to regenerate the virtuser.db file.
 
Good point. It even remembers to restart sendmail for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top