# Virtual Mailhosting

## Fraggle

First, let me say I have gone through the FAQ on this, and I think it is WAY to complicated for what I need. This is what I want to do....

Have user mailboxes without having a matching UID.

I already have IMAP working fine, this is all basically for use within squirrelmail (which I already have working)

I would also like to add LDAP capability with this (I have never done this).

Any good ideas on how to do it? There just seems like there would be an easier way to do this than the FAQ.

On a side note, any plans for having an ebuild for samba-tng?

Thanks! I love gentoo, and am running from stage-1 with NO problems.

Paul

----------

## brain

I run a small webhosting business and I found the best solution for me was vpopmail & qmail.   Adding/removing domains and users is super easy, and it doesn't require having user's accounts in Linux, like you stated.

Start with qmail, get it working, then add vpopmail on top.  It takes some tweaking to get it to work--but it runs like a champ when you've got it there.

If you do decide to go this route, be sure you understand how qmail works--it's actually very simple compared to sendmail.   Check out the excellent book "The qmail handbook" by Dave Sill.

----------

## Fraggle

Any good solutions with postfix?

----------

## kashani

 *Fraggle wrote:*   

> Any good solutions with postfix?

 

Either this or last month's Linux Journal ha 4-6 page article on doing just that. 

kashani

----------

## Fraggle

Must be on last month's cause I have this month's and no beans.

----------

## elfarto

I'd use qmail + CourierIMAP + Vmailmgrd, there is plenty of documentation on that setup and qmail pays off heavily as opposed to sendmail and postfix

----------

## mglauche

postfix2 + sasl2 + cyrus is also a very good choice for virtual hosting, it may require a bit more reading in the beginning, but its very fast and flexible solution  :Smile: 

----------

## Fraggle

Hmmm, really sounds like qmail may be the way to go...

----------

## digitalnick

i use qmail vmailmgr and courier to accomplish what yoru wanting. tho whoud be nice to find a good howto on vpopmail

if you need help setting up qmail vmailmgr and courier just let me know ive done it a few times in the last few weeks and only run into minor problems each time i set it up agian ... almost have it down to a science  :Wink: 

brain: any good links for vpopmail setup ? or are ya gonna write one  :Very Happy: 

----------

## Fraggle

thanks, I may take you up on that when I move to qmail. Is going from postfix to qmail difficult? Should I just unmerge postfix and emerge qmail ? This is more or less production email...

I am already using postfix + courierimap + squirrelmail...Works wonderfully, just need virtual users....You would think this would be easy to do!!!!!

----------

## digitalnick

no its not hard since they both use maildir ... depending on how many users you have you can just move soem folders around and it can be done relativly quickly.

just shoot me an email or im me and we can talk about it off board 

aim: digitalnick2722

email nianderson_NOSPAM_@digitalnick.homelinux.com

----------

## tgoodaire

Perhaps this will help you:

http://weblogs.userland.com/qube/stories/storyReader$692

----------

## Fraggle

 *tgoodaire wrote:*   

> Perhaps this will help you:
> 
> http://weblogs.userland.com/qube/stories/storyReader$692

 

Ok, I just went through it, and I totally understand how to have virtual domains....but how about having postfix handle users that aren't local users....For instance....

a customer named jorge wants an email address. I don't want to give him a local account, but I want to be able to send jorge@mexican.com.  Mexican.com is a real domain, with real users, but if I don't want jorge to have an account on the box, but still be able to receive email how would I do that? Add him as a user and just give him /bin/false?

----------

## tgoodaire

It looks to me that a line like this:

```

jorge@mexican.com jorge@hisrealdomain.com

```

should work for you.

You could try setting up a test.

```

testing@mexican.com anaccountthatyouhave@adomain.com

```

And see if it goes through. If it doesn't check the mail logs to see why.

----------

## Fraggle

 *tgoodaire wrote:*   

> It looks to me that a line like this:
> 
> ```
> 
> jorge@mexican.com jorge@hisrealdomain.com
> ...

 

jorge doesn't have a real domain? his real domain would be mexican.com...I just don't want to give him a shell account...You get what I am saying?

Like in exchange...you can add a user, but he doesn't have to have a login in a windows box...

----------

## tgoodaire

jorge@hisrealdomain.com refers to whatever his real email address is.

This line:

```

jorge@mexican.com jorge@hisrealdomain.com 

```

says that an email addressed to jorge@mexican.com should be delivered to jorge@hisrealdomain.com. jorge doesn't need a shell account on your box for this to work.

----------

## puddpunk

Yes, Give him an account and lock it (set shell as /bin/false and perhaps mess about with PAM settings).

----------

## tgoodaire

Ok. I misunderstood what you were trying to do. You'll want to give him a nologin account.

```

jarge:x:405:100:jarge:/dev/null:/bin/false

```

in /etc/passwd should do the trick.

----------

## TerminalAddict

becasue of security issues with /bin/false

I use this : denysh

```

#include <unistd.h>

        /* denysh

         *

         *      Deny a user shell access.  Intended for use as

         *      the "shell" for POP mail, FTP only and other users

         *      who are supposed to be restricted to non interactive

         *      use of the system.

         *

         *      Usage:  using vipw you can replace the "shell" field

         *      of any user's account record in the /etc/passwd with

         *      the full path to this binary.  You can also add this

         *      to /etc/shells and (as root) use the chsh command to

         *      apply this (no need to edit /etc/passwd if that bothers

         *      you).

         *

         *  compile with:

         *                   gcc -static -o denysh denysh.c

         *

         *  to prevent any chance for shared library (LD_PRELOAD)

         *  exploits

         */

int main () {

  char *message= "Access Denied:  Your account is not"

                " permitted interactive login!\n";

  write (STDERR_FILENO, message, strlen(message));

  exit(1);

}

```

----------

## green_buddy

 *tgoodaire wrote:*   

> Perhaps this will help you:
> 
> http://weblogs.userland.com/qube/stories/storyReader$692

 

This is great, but how does it work with my current mail aliases in /etc/mail/aliases?

My situation for this is very similar... currently using postfix/courier-imap.  I basically want www@foo.com and www@foobar.com to go to different places.  For instace, I want www@foo.com to be forwarded to green@foo.com, but I want www@foobar.com to go to it's own virtual directory where there is no actual www user on the machine without a normal user account, just a mailuser account.  I'm assuming that courier-imap handles the virtual mail user for www@foobar.com.  I currently have www@foo.com forwarding to green@foo.com but without the virtual_maps as specified in the link above.  I'm not much of a mail guru... can anyone tell!?!  :Wink: 

Anyway, if someone could help me organize my thinking that'd be extremely helpful!

Thanks,

-green

----------

## Fraggle

I guess I will be writting a php plugin for squirrel mail that will create users for me giving /bin/false or whatever....for mail... Should not be too hard at all...

----------

