Solved

Virtual domains and POP

Posted on 1998-06-10
6
265 Views
Last Modified: 2013-11-18
Hello,
I am trying to set up virtual domains on my linux box. So far, everything was ok (IP Aliasing, etc) but i have some troubles with POP/SMTP.
What i want :
Imagine 2 virtual domains : vh1.org and vh2.org
The directories are /home/vh1org for vh1.org and /home/vh2.org and of course they are in the /etc/passwd.
Each user of the domain ONLY use POP service (they cannot connect). I don't want them in the main /etc/passwd.
The same POP account must exist ex: jo@vh1.org and jo@vh2.org
The directory and POP accounts are located in the /home/virtual_domain/pop
ex: jo@vh1.org receives his mail in /home/vh1org/pop/jo ...
The POP server must be able to read in this directory by looking at the domain or IP requested ...
The virtusertable by sendmail needs an entry (like jo-vh1org) in the /etc/passwd for each user of each virtual domain. I would prefer another solution.
How can i do that ?
Can someone help me to give me some solutions ?
Thank you very much
Vikie
0
Comment
Question by:viki
6 Comments
 

Expert Comment

by:kwiky
ID: 1584479
Let me try to sum it up:
You need entries in /etc/passwd but you don't want to allow the users to get a shell.

Possible solution: create the necessary entries in /etc/passwd but change their shell to /bin/false (instead of the usual /bin/bash) so they can't login. Alternatively, just lock those accounts by putting an "*" (w/o the quotes) as the first password character.
 
0
 

Author Comment

by:viki
ID: 1584480
Not exactly.
The users of a virtual domain must not appear in the /etc/passwd. They are somewhere else in another config file with the home directory of the domain it has to put in.
I made this with QMAIL by modifying the source code of vcheckpassord (it gets the IP of the requested domain, read the config POP file for this IP) but i would like to do it with sendmail+another POP server.
The reason is that the webmaster of the virtual domain can add or remove POP accounts with a HTML page, and i'd like to avoid my /etc/passwd modified by CGI scripts...
Only an domain has an entry in the /etc/passwd.
Am i clear ?
Vikie
0
 

Author Comment

by:viki
ID: 1584481
Adjusted points to 150
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Accepted Solution

by:
danielfonseca earned 150 total points
ID: 1584482
Ok.. what you want is domainaliases within sendmail I think.

Try this:

Edit /etc/sendmail.cf and add this directive

# Domain table (adding domains)
Kdomainalias btree /etc/domainalias.db

Add the virtual domains to your Cw record... probably already there, like:
Cwvh1.org
Cwvh2.org

Then, add/change this ruleset

###################################################################
###  Ruleset 98 -- local part of ruleset zero (can be null)     ###
###################################################################

S98

R$+ < $+ . >            $1 < $2 >
R$+ < $+ >              $: < > $(domainalias $1$2 $)
R< > $+ @ $*            $: < $1 > $(domainalias * @ $2 $)
R< $+ > * $*            $: < > $1 $2
R < $+ > $+             $: < > $2
R< > $*                 $: $>3 $1

Then all you have is make a domainalias file in /etc with each account and resective forwarding like:
joe@vh1.org      thismail@here
joe@vh2.org      thisother@there

IT's the only way to have the same login in a same machine with virtual domains account for different mailboxes.

Then you have to update the DB every time the /etc/domainaliases file changes with this:

makemap btree /etc/domainalias.db < /etc/domainalias

Whenever you want to add a virtual pop just append the record to the /etc/domainalias file and re-run the makemap command.

You can always check where the mail is going to be delivered by:
sendmail -v -bv user@host

You have all this and more in the Virtual Web HOWTO
probably /usr/doc/faq/howto/mini/Virtual-Web.gz for you, no?

Hope this works for you, and the points for me :-)

Daniel Fonseca
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1584483
keep in mind that some sendmail implementation accept domainaliases only at one Cw in sendmail.cf, like:

Cwvh1.org vh2.org


danielfonseca, you remember the swearing ... ;-)
0
 

Author Comment

by:viki
ID: 1584484
Hello,
Thank for your answers, i have no time to test it for the moment.(a ton of work ;-)) but, can you teel me what the syntax is to activate ruleset 98 with M4
Thank you
Viki

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

760 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

27 Experts available now in Live!

Get 1:1 Help Now