atom feed15 messages in net.sourceforge.lists.courier-users[courier-users] PROBLEM SOLVED: Re: c...
FromSent OnAttachments
Alfredo MartinoJul 2, 2002 2:41 am 
Bill MichellJul 2, 2002 3:06 am 
M. JolicJul 2, 2002 4:18 am 
M. JolicJul 2, 2002 5:56 am 
Sam VarshavchikJul 2, 2002 6:20 am 
M. JolicJul 2, 2002 6:55 am 
Roland SchneiderJul 2, 2002 7:39 am 
Sam VarshavchikJul 2, 2002 7:42 am 
M. JolicJul 2, 2002 8:15 am 
Toni MattilaJul 2, 2002 8:19 am 
Roland SchneiderJul 2, 2002 9:02 am 
Toni MattilaJul 2, 2002 9:38 am 
Leonard ChanJul 2, 2002 6:55 pm 
Binand Raj S.Jul 2, 2002 8:54 pm 
M. JolicJul 4, 2002 6:08 am 
Subject:[courier-users] PROBLEM SOLVED: Re: courier-imap and virtual domains with vmailmgr & qmail...
From:M. Jolic (m.jo@primusavitos.de)
Date:Jul 4, 2002 6:08:45 am
List:net.sourceforge.lists.courier-users

Hi Gurus and everybody who is using qmail with VMAILMGR and Courier-IMAP!

After several tests we've found the problem and solved it!

No, it's not Outlook or anything else:

It's the authvmailmgr-module from vmailmgr.

So, if you want to log the user of a virtual domain who is using courier-imap here's how to handle this:

The authentication-module of vmailmgr sends the "virtual name" of the domain only! The solution:

Set an ENV with a name where no prog is using this ENV, except the (modified) imapd from courier-imap:

look at "authvlib.cc" from the source of vmailmgr:

[...] if(!lookup_baseuser(fulluser, basepw, virtname)) fail_login("Invalid or unknown base user or domain"); presetenv("VUSER=", virtname); /* the following line must be added! The ENV-Name can be different, but notice to change this in the imapd.c too! */ presetenv("FULL_USER=", fulluser);

if(!virtname) { if(virtual_only) [...]

Notice: We add the ENV "FULL_USER" to the code so that the full functionality of vmailmgr for qmail will be untouched!

Then make it with: make and copy the program authvmailmgr to the auth-dir of courier-imap where your original authvmailmgr resides.

Go to the source of courier-imap and look into the path imap for imapd.c. Open the file and look for: [...] writes("* BYE Courier-IMAP server shutting down\r\n"); writes(tag); writes(" OK LOGOUT completed\r\n"); writeflush(); emptytrash(); /* Original: getenv("AUTHENTICATED") NOW: getenv("FULL_USER") */ fprintf(stderr, "INFO: LOGOUT, USER=%s, ip=[%s]," " headers=%lu, body=%lu\n", getenv("FULL_USER"), getenv("TCPREMOTEIP"), header_count, body_count); exit(0); }

if (strcmp(curtoken->tokenbuf, "LIST") == 0 [...]

Now we put the "FULL_USER"-ENV instead of "AUTHENTICATED"-ENV, because according to vmailmgr the variable "fulluser" contains the domain and the virtual user!

Next step:

STOP imap (& imap-ssl if your using) make make install (or copy the imapd to /usr/lib/courier-imap/bin or whereever your imap-path is)

After you've overwritten the original imapd-prog: start it again and log into your mailbox via imap and logout. Look in the maillog (/var/log/maillog) and you should see something like:

INFO: LOGOUT, USER=domain.com-test, ip=[xxx.xxx.xxx.xxx], headers=0, body=0

Now you have the "alternative" Login from the user:

Login: te@domain.com -> Becomes: domain.com-test

Login: domain.com-test -> Besomes: domain.com-test

I was surprised why NOBODY is interested to get the size of a virtual user who is getting mails via imap over vmailmgr-auth!!!!

Any ideas?

milli