?
Solved

Virtual domains and POP

Posted on 1998-06-10
6
Medium Priority
?
278 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
[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
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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Accepted Solution

by:
danielfonseca earned 300 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

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

770 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