Click to See Complete Forum and Search --> : qmail - multiple Maildir's without creating users


Chase
04-01-2002, 10:36 PM
I've been runnning qmail for quite a while now, and I know how to do quite a bit. My question is I would like to create pop3 "accounts" (Maildir) on my machine under multiple domains without creating actual users on my machine. How would I go about doing this?

For instance, I want to create user1@dom1.com, user2@dom1.com, user1@dom2.com, etc. But I don't want user accounts or shell access for any of them.

Any help would be great!

- Chase

SKoL
04-01-2002, 11:24 PM
it would be easier to use this script, and modify it to make the users shell /bin/false so they can't login (or just change it aftewords) ...its easier in the long run to acually give them a homedir (hence a user account) then try what you want..


#!/usr/bin/perl
#
# Wrapper for useradd and setquota
# Usage: newuseradd [username] [password] "[comment]"

use POSIX;

if ($ARGV[0] eq '' || $ARGV[1] eq '' || $ARGV[2] eq '') {
print "Usage: sxuseradd [username] [password] \"[comment]\"\n";
exit; }

$username = $ARGV[0];
$comment = $ARGV[2];

# Encrypt password
srand($$^time&$ENV{RANDOM});
$salt = seedchar().seedchar();
$password = crypt($ARGV[1],$salt);

system "/usr/sbin/useradd -g mailuser -c \"$comment\" -p $password $username";
system "/usr/sbin/setquota /home 0 10000 0 0 $username";

exit;

sub seedchar {
('a'..'z','A'..'Z','0'..'9','.','/')[rand(64)];
}


add the following command aliases to root's .bashrc file:


echo "alias useradd=/root/newuseradd" >> /root/.bashrc

/usr/sbin/groupadd mailuser

chmod 755 /root/newuseradd


So, now, every time you do an useradd, it will take care of the dir structure *Maildir*

Dagda
04-02-2002, 10:37 AM
To Create virtual users use Vmailmgr (http://www.vmailmgr.org)

Here is a great guide (http://www.dulug.duke.edu/~icon/qvcs-guide/)

freebsd
04-02-2002, 08:23 PM
>> it would be easier to use this script

But he doesn't want system account, making that nologin still doesn't change the fact that it's system account.

>> My question is I would like to create pop3 "accounts" (Maildir)

I do not understand what do you mean by pop3 accounts.

>> I want to create user1@dom1.com, user2@dom1.com, user1@dom2.com

Where (which account) should messages sent to them be redirected to?

And are you using vpopmail, vmailmgr, or just standard qmail with /home/user/Maildir setup?

SKoL
04-03-2002, 02:54 AM
Originally posted by SKoL:
[QB] ...its easier in the long run to acually..
QB]

..give them a real user account and just change their shell to /bin/false

Maybe that is clearer for you..

Chase
04-05-2002, 12:16 AM
freebsd, I'm just using the standard Maildir right now. Mail for users goes to /home/user/Maildir/new...

I would like to create NON system users. Right now, when people log in to the pop3 server, they retrieve mail from their Maildir's, because they are system users. I would like to know how I can create popable boxes without creating system users.

freebsd
04-05-2002, 10:21 AM
>> how I can create popable boxes without creating system users

You need to create at least ONE system user, so this user can handle all messages under his account. That's what vmailmgr and vpopmail are for, to make your life easier.

Another alternative, still, a stock qmail install can't do it, is to use database/LDAP so passwd is retrieved (not messages) from db/ldap.

iDxMan
04-05-2002, 08:33 PM
http://www.shupp.org/toaster/ http://matt.simerson.net/computing/mail/

I'm currently using matt's toaster setup on freebsd -- works like a dream.

-r