Solved

sendmail virtaul domain with database

Posted on 1997-08-22
6
255 Views
Last Modified: 2013-12-15
I am setting up a virtual domain but still not work at this stage, the following is what I've done.
1 Edit a text file, /etc/mbt, looks like :
    info@client1.com          user1@my.net
    info@client2.com          user2@my.net
    info@client3.com          user3@my.net

2 Use the command :
    makemap dbm mbt < mbt
   and get two files mbt.dir and mbt.pag

3 Add a line in the "local info" section of the file /etc/sendmail.cf :
    kmbt /etc/mbt

4 Add the following rules in R98
    # Use mailboxtable-database:
          R$+ < @ $+ . >      $: $1 < @ $2 > .
          R$+ < @ $+ > $*      $: $(mbt $1@$2 $: $1 < @ $2 > $3 $)
          R$+ < @ $+ > $*      $: $(mbt $2 $: $1 < @ $2 > $3 $)
          RERROR $*            $#error $: $1
          R$+ < @ $+ > .      $: $1 < @ $2 . >

5 Test the rule set 98 with :
   98 info@client1.com
             or
   0 info@client1.com
It cannot rewrite the address to user1@my.net. The output is the same as input.

Then I test if the database works with the following steps
6 Delete the rules add to S98 in step 4
7 Add a rule
   R$+         $:  $(mbt  info@client1.com $)

8 Test the S98 with
    98 info@client1.com

The S98 still not rewrite the input address. But what I expect is no matter the input address is, it will be rewritten  and use the value of the key "info@client1.com" of the database mbt as output address.

I have tried to use other method that  do not use database, such as add some rules in S2, it works but rather troublesome.

I am using linux kernel v.2.0.29 and the sendmail version is BSD sendmail 8.7.5

Thank you for your attention.
Regards
Wong

0
Comment
Question by:wongmf
[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
  • 3
  • 3
6 Comments
 
LVL 2

Accepted Solution

by:
aleshka earned 100 total points
ID: 1629282
The solution is more simple: first of all you can find it on www.seendmail.org, but in a few words, you shoulld do the following:

1. Create the /etc/mbt database in the same manner as you do.
2. Instead of all those rules, add one string into you /etc/sendmail.cf:

  Kvirtuser dbm /etc/mbt

Thats all. Hope this will help.

NOTE: This works fine with sendmail-8.8.5-4, and maay be you'll need to upgrade it :(
0
 

Author Comment

by:wongmf
ID: 1629283
Thanks for your reply, but it doesn't work in my system at this moment. Could you tell me how can test the sendmail.cf file to see if the rewriting rule is alright.
Regards
Wong
0
 
LVL 2

Expert Comment

by:aleshka
ID: 1629284
I remember that it was take me whole hours to set it up :). All stuff helped me do so, is located at: http://www.sendmail.org/virtual-hosting.html

Also, I can send you my sendmail.cf, if you want.

PS: Values in your mbt file (before makemap) ,ust be separated by TABs.

Best wishes :)

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:wongmf
ID: 1629285
Please send me your sendmail.cf. Thanks a lot.
Rgds
Wong
0
 
LVL 2

Expert Comment

by:aleshka
ID: 1629286
You email ? :)))
0
 

Author Comment

by:wongmf
ID: 1629287
Sorry, I forgot it. It is :
          wongmf@confer.net.hk
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

742 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