Solved

sendmail virtaul domain with database

Posted on 1997-08-22
6
240 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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.

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" …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

929 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

13 Experts available now in Live!

Get 1:1 Help Now