On Tue, 2011-09-27 at 19:39 +0200, Lucio Crusca wrote:
> Hello *,
> 
> I'm new here but I've been using courier for 10 years. Mostly courier-imap, 
> but a few years ago I've also used courier-mta. Then I moved to a mixed setup 
> with Postfix+courier-imap+MySQL.
> 
> Now I have a new server to configure (Ubuntu 10.04 server) and I'm quite 
> annoyed by the postfix mess and the sasl hell, not to mention the back and 
> forth of messages between daemons only to apply spam filters, that kind of 
> setup is too muddled for my taste. So I feel like going back to my origins 
> and 
> use courier-mta instead.
> 
> However when I used courier-mta back then I did not need virtual mailboxes 
> (though I used them anyway with authuserdb) nor more than one domain; now 
> things are different.

Your requirements sound exceptionally similar to those I set for the
mail system for customers of FMP Computer Services several years ago,
which I built, piecemeal, over a period of a year or so.  Customers can
log in with a master account password and are presented with a menu, one
of which is "Manage Mail".  The mail management page lists the mailboxes
associated with that account, as well as all the domain names associated
with it, all of which are effectively aliases for one another and share
a common set of mailboxes.  The mail management page allows a user to
set up a limited number of mailboxes and an unlimited number of mail
forwarding directives (alias/.courier-xxxxxx).  Each configured mailbox
displays the mailbox name, the clear-text password in a text box, and
offers buttons to update (change the pw), delete the mailbox, and to set
spam and virus filtering.  The filtering button brings up a filtering
page for that mailbox which allows the adjustment of a variety of
filtering options.  Spam filtering is done by SpamAssassin and users can
set the cutoff level for identified spam, the option to segregate spam
and viruses (detected by clamav), storage times for identified spam,
etc.  Users can add or delete names for a whitelist and blacklist, and
if spam is segregated, a button is presented which allows all identified
spam and ham left in the Inbox to be processed by sa-learn into the
Bayesian filtering database.  The system depends on users accessing
their email using IMAP, either from a mail client or Squirrelmail, or
via Courier Webmail which honors IMAP mailboxes.

Here's a summary of the underlying technology.  All customer accounts
are virtual mail accounts, supported by a MySQL database.  The web UI
interface is developed using PHP, xajax, smarty and lots of JavaScript.
I make extensive use of scripts which run as various users, mostly root
or vmail, the virtual mail user.  These are protected and managed by a
setuid wrapper program written in C which allows a limited number of
real UIDs to execute one of a limited (hard-coded) set of scripts which
provides both a level of security and the flexibility to run as the user
of choice even though the process is run by the web server user.  These
scripts are written in shell (bash) and in Python, depending on which
language best suits the task at hand.  There's a master maildroprc which
invokes the SA and clamav systems and a number of other features and
runs on every piece of incoming email.  Courier uses authmysql and via a
custom allows authentication based on email address, or a similar string
with the "@" replaced by a dot, as required by some mail clients.  This
is implemented in authmysqlrc with a custom MYSQL_SELECT_CLAUSE query.

Access control is managed using PEAR's MDB2 and Auth modules via a
couple of custom PHP classes.  The whole thing is modular, and flexible
enough that it wouldn't be difficult to add feature it doesn't
implement, such as group mailboxes.

This kind of scratches the surface.  This whole system is pretty
complex, and was developed over a period of time.  If I had to rebuild
it from scratch, it would probably take me at least of couple of weeks
of 8-hour days to put it all together again, and then some!  It could
probably be done more simply, but it works, so I don't try to fix it.
I'm very far from the world's most competent programmer but I get by.

I hope this helps.  It CAN be done :-)  I'll be glad to answer any
detail questions you have via private email as my time permits.

-- 
Lindsay Haisley       | "We have met the enemy and he is us."
FMP Computer Services |
512-259-1190          |          -- Pogo
http://www.fmp.com    |

-- 
Lindsay Haisley       | "Never expect the people who caused a problem
FMP Computer Services |  to solve it."  - Albert Einstein
512-259-1190          |        
http://www.fmp.com    |



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to