I have looked into the code with my poor c skills and here is a first-attempt.
I have not tested the code.

Please someone with some kind of understanding of this. Take a short stop. 
I don't know if there are any general need for this, but it seems I'm not alone 
anyway.

yours, Peter Andersson

Attached is same as text below:

# This is a REAL amateur attempt for achieving separate MYSQL_WHERE_CLAUSE for 
IMAPd and POP3d
# I have LITTLE experience of c years back, and have never done this kind of 
coding, so possibly I have got strcmp all backwards or something similiar. 
# My hope is not that this gets mainstream, but that I can get some help on 
this.  


# Have looked into sourceforge downloaded sourcetree courier-imap-1.7.0
# Patch attempt to authmysqllib.c

# ENV var indicating where authdeamon is called from
# CALLED_BY = POPd or IMAPd as string, default to IMAPd 

# line 674 and further
                where_clause=read_env("MYSQL_WHERE_CLAUSE");
                where_clausePOPd=read_env("MYSQL_WHERE_CLAUSE_POPd");
                where_clauseIMAPd=read_env("MYSQL_WHERE_CLAUSE_IMAPd");
                
                if (!where_clause) 
                {
                                if (strcmp(CALLED_BY, "POPd") == 0)
                                         where_clause = where_clausePOPd; 
                                else 
                                         where_clause = where_clauseIMAPd; 

                                if (!where_clause) 
                                         where_clause = "";
                }

# I assume this ENV var can be set in the respective main() functions before 
calling authdeamon, so 
# pop3dserver.c, line 803-ish
                putenv("CALLED_BY=POPd");
# and imapd.c, line 3214-ish
                putenv("CALLED_BY=IMAPd");


 
> --Mailinglists wrote on 27.02.03 13:50 +0100:
> 
> > I have some accounts I only want to give access via IMAP and som only with
> POP.
> >
> > Is it possible to have separate sql settings for IMAP and POP?
> 
> This wont need separate settings, an additional flag/variable
> for MYSQL_SELECT_CLAUSE would be enough, but needs a patch.
> 
> > I have read through some documentation, but nothing I have found adresses
> this
> > issue.
> > It could possibly be a setting in authdeamonrc, like POPRC =
> authmysqlrc.pop
> > and IMAPRC = authmysqlrc.imap
> >
> > Anybody has a clue?
> 
> You could use authmysql for one, and authuserdb for the
> other if you build courier --without-authdaemon.
> 
> Roland
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> courier-users mailing list
> [EMAIL PROTECTED]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
> 


# This is a REAL amateur attempt for achieving separate MYSQL_WHERE_CLAUSE for IMAPd 
and POP3d
# I have LITTLE experience of c years back, and have never done this kind of coding, 
so possibly I have got strcmp all backwards or something similiar. 
# My hope is not that this gets mainstream, but that I can get some help on this.  


# Have looked into sourceforge downloaded sourcetree courier-imap-1.7.0
# Patch attempt to authmysqllib.c

# ENV var indicating where authdeamon is called from
# CALLED_BY = POPd or IMAPd as string, default to IMAPd 

# line 674 and further
                where_clause=read_env("MYSQL_WHERE_CLAUSE");
                where_clausePOPd=read_env("MYSQL_WHERE_CLAUSE_POPd");
                where_clauseIMAPd=read_env("MYSQL_WHERE_CLAUSE_IMAPd");
                
                if (!where_clause) 
                {
                                if (strcmp(CALLED_BY, "POPd") == 0)
                                         where_clause = where_clausePOPd; 
                                else 
                                         where_clause = where_clauseIMAPd; 

                                if (!where_clause) 
                                         where_clause = "";
                }

# I assume this ENV var can be set in the respective main() functions before calling 
authdeamon, so 
# pop3dserver.c, line 803-ish
                putenv("CALLED_BY=POPd");
# and imapd.c, line 3214-ish
                putenv("CALLED_BY=IMAPd");


Reply via email to