choccarlm
asked on
Virtusertable
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?
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?
ASKER
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
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
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-compan y.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.
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.
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.
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.
ASKER
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
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'll take your word for it then!!
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 ::)
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 ::)
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.
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.
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.
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.
Yeah, I know from having made the mistake of having duplicate keys that as far back as 8.9 you'll get an error.
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.