Solved

Virtual domains and POP

Posted on 1998-06-10
6
274 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

687 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