Hi,

I'm using courier-imap with a mysql backend containing the
configuration. My current users have usernames such as:

[EMAIL PROTECTED]

There are a *large* amount of users on another mail system that I am
trying to migrate in at the moment, but they're used to using
usernames without the "@domain" bit. They're all in fact on the same
domain.

I was hoping to provide a different ip address for these new users and
to allow them to continue using their same login details. I would get
the load balancers to forward imap connections to a different port on
the imap server cluster boxes, and then use the port the connection was
coming in on as part of the MySQL query in the courier config...
Something along the lines of:

SELECT mail_dir.username,
       mail_dir.password_hash,
       mail_dir.password_clear,
       mail_dir.uid,
       mail_dir.gid,
       mail_dir.path,
       '',
       0
  FROM mail_dir
 WHERE local_part = '$(local_part)'
   AND domain     = IF( '$(server_port)' == '14301',
                        'newcustomers.generic.domain'
                        '$(domain)'
                      )
);

I could of course, set a default domain to be the
newcustomers.generic.domain, however I will be migrating accounts from
other mail systems in the near future and there are certain to be
username conflicts.

Basically, what I'm looking for is a $(server_port) functionality. I've
had a brief look at adding this into authmysqllib.c but my c skills are
pretty poor... I'm pretty sure adding the variable would be straight
forward, but I'm not sure where to actually grab the port from...

My other options are to run a separate copy of courier-imap on a
different port, or to email the userbase telling them to start using a
new username. I'd like to avoid these two options despite their
advantages if at all possible.

I think the ability to differentiate between accounts depending on the
server port or ip address connected to, would be a worthwhile feature...

Thanks for your time,

Mike

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Courier-imap mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap

Reply via email to