Solved

sendmail virtaul domain with database

Posted on 1997-08-22
6
228 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
  • 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now