2011/5/21 Raj Mathur (राज माथुर) <r...@linux-delhi.org>

> On Saturday 21 May 2011, Varad Gupta wrote:
> > > I'm trying to set up an IMAP server for virtual users with the
> > > following characteristics:
> > >
> > > - Server is handling multiple mail domains, say "foo.com" and
> > > "bar.com".
> > >
> > > - Mail for x...@foo.com gets delivered to system user x.foo.com; mail
> > > for x...@bar.com gets delivered to system user x.bar.com.
> > >
> > > Now is it possible to have an IMAP server handle logins of the form
> > > "x...@foo.com" and "x...@bar.com" and authenticate them against the
> > > corresponding system users "x.foo.com" and "x.bar.com"?  A
> > > non-database solution would be preferred.
>
> > If using courier-imap and therefore courier-authlib, you can use the
> > authpipe authentication module and accomplish the above.
>
> Thanks.
>
> Yes, I was planning to use Courier if possible.  However, documentation
> on authpipe seems to be scanty, and I'm not too familiar with Courier
> beyond the basic one-to-one IMAP/POP auth against PAM.  Any pointers to
> documents and/or examples?
>
>

Pls see => http://permalink.gmane.org/gmane.mail.imap.courier.general/27589

You can replace the SQL statements with grep/awk on /etc/passwd

These and other similar lines will need to be replaced =>

SQL=($(dosql "SELECT uid,pw,mpath,mquota FROM passwd WHERE uid='$ID'"))


SQL=($(dosql "SELECT uid,pw,mpath,mquota FROM passwd WHERE uid='$ID'
AND pw='$PW'"))



To test if the passwd is correct (auth is OK), you can  use the openssl
command to generate an md5 hash and match with /etc/shadow (here i am
assuming you script will run as root and can read /etc/shadow). There might
be other ways to do this, but this one struck me easily.


Regards


-- 
Varad Gupta
Keen & Able Computers Pvt Ltd
62, Deepak Building
13, Nehru Place
New Delhi - 110019
Tel. : +91-11-26426184/5
FAX : +91-11-41808565
varad.gu...@keenable.in
www.keenable.in
_______________________________________________
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to