Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Virtusertable

Posted on 2002-04-16
11
Medium Priority
?
489 Views
Last Modified: 2013-12-17
Hi,

Does the VUT need to be sorted into ascending order?

Im asking this because I have many instances of

me@domain.com user@mail.domain.com
@domain.com someone@mail.domain.com

Would it matter what entry went in to the table first?
0
Comment
Question by:choccarlm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 15

Expert Comment

by:samri
ID: 6944554
It does do the match from top to bottom.

More info on this website.
Section 18.3.6 /etc/mail/virtusertable
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sendmail.html

I think with the following map, the mail will always go "localjoe".
joe@yourdomain1.com             localjoe
joe@yourdomain1.com             joe@othercompany.com

I haven't got access at the moment to verify.

Some detail or virtual hosting.
http://www.sendmail.org/virtual-hosting.html

But it doesn't say anything about the sorting of entries makes a difference.

I personally does not really take the order seriously.  But surprisely, it does.

cheers.
0
 

Author Comment

by:choccarlm
ID: 6944599
Before I build the VUT, I have a file with all the email address's within it. I then sort this file, and build the VUT using the makemap hash command.

With this is mind, and what you just told me, what would be the best way to sort this file?

I currently use sort command.

Cheers
0
 
LVL 15

Expert Comment

by:samri
ID: 6946548
I think it should not matter which order, since "normally", there should be only one recepient for, for lets say the address joe@company.com -> joe_schmoe@the-real-company.com. Unless you need to have the mail adress to a virtual-user to be sent to two different (or more) real-user, it is best to use local alias file.  There is a note at http://www.sendmail.org/virtual-hosting.html
Sendmail Configuration, #1, Note2.

Other than that, sorting order really depends on personal approach.  If you are doing VirtualHosting for quite a number of clients, then splitting up the virtual-table text file by what VirtualDomain they belong to, and sort them by the virtual-user;

--domain-a.txt
a@domain-a.com         real-a@otherdomain.com
b@domain-a.com         real-b@otherdomain.com
etc...
z@domain-a.com         whomever@otherdomain.com

--domain-b.txt
a@domain-b.com         real-a@otherdomain2.com
b@domain-b.com         real-b@otherdomain1.com
etc.
etc.
z@domain-b.com         whomever@otherdomain-x.com

Prior to building the map, have a scripts to concatenate the file, or a simple "

# cat domain-a.txt domain-b.txt domain-x.txt > virtualusertable
# makemap ...

I would choose this option since it's easier to managed the list.  And if you make the file naming to conform to certan pattern, it's even easier to manage the list.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 40

Expert Comment

by:jlevie
ID: 6947758
It doesn't matter whether the catchall is before, after, or anywhere in the virtusertable file. The process of matching an email address to virtusertable is to first attempt a lookup of the recipient address. If that fails to return a "local address" a lookup will be attempted for the catchall. So an ordinary ascii sort on the LHS is fine.

samri,

The issue of duplicate addresses on the LHS doesn't arise because the virtusertable map is normally a hash. The key is the LHS of each line and a hash doesn't allow duplicate keys. So attempting to make the map will result in an error.
0
 

Author Comment

by:choccarlm
ID: 6947770
Does that mean that I dont have to sort the original file at all? Can I just make the db file straight from the text file, without any sorting?

Cheers
0
 
LVL 40

Accepted Solution

by:
jlevie earned 80 total points
ID: 6947782
Yep, it should work fine. There are advantages to sorting the list if you have a lot of domains and virtual users. It's a lot easier to mantain the list if all of the virtual addresses are grouped by domain.
0
 

Author Comment

by:choccarlm
ID: 6947789
I'll take your word for it then!!
0
 
LVL 15

Expert Comment

by:samri
ID: 6948051
jlevie, choccarlm

Gee.. I think I'll have to take your words for that too... (next time I'll test before typing..)

Somewhere on this page, it mentioned that the order will go from top to bottom:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sendmail.html

Are we looking at a false info here (beside my false claim ::)

0
 
LVL 40

Expert Comment

by:jlevie
ID: 6948425
Well, that was what I remembered seeing in the sendmail code some time back when I was looking to see how some of that stuff worked. And before my last comment I did a quick test of placing the catchall first to prove to myself that the statement was accurate.

I don't know where the info in the above URL comes from. It's possible that it might have been true as some point in the past and it might still be true if virtusertable isn't configured to be a database. But, since none of the Sendmail configurations or documentation suggests using anything except a DB for the map it seems safe to make the claim above.

Based on what I see, I'd have to say that it's a false statement.
0
 
LVL 15

Expert Comment

by:samri
ID: 6949436
Hmm.. I started to see some logic here...

Yep.. confirmed, at least on rh7.2, sendmail 8.11.2.

makemap: virtusertable.db: line 2: key samri: duplicate key
make: *** [virtusertable.db] Error

thanks a lot.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6949775
Yeah, I know from having made the mistake of having duplicate keys that as far back as 8.9 you'll get an error.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One-stop solution for Exchange Administrators to address all MS Exchange Server issues, which is known by the name of Stellar Exchange Toolkit.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question