Solved

sendmail virtaul domain with database

Posted on 1997-08-22
6
258 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

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,…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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…
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