Solved

sendmail virtaul domain with database

Posted on 1997-08-22
6
245 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

815 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

11 Experts available now in Live!

Get 1:1 Help Now