Solved

Virtual domains and POP

Posted on 1998-06-10
6
270 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
Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Mailserver setup & redundancy 2 75
Guacamole and browser performance 1 124
Unexpected End of File 11 54
Understanding ping command in Ubuntu 5 28
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

679 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