Postfix Admin + Drupal integration. Anyone interested?

Since I have been struggling with this for a while, I think it's time I do something about it. I've seen that other people have tred to address the issue, but no clean solution has yet been found.

Bbackground: a client needs to set up e-mail addresses for her website users. On my server I have an installation of Postfix Admin (http://sourceforge.net/projects/postfixadmin/) that she can surely use, but this poses two problems:

  1. she will have 200+ users, and Postfix Admin allows creation of one account at a time. A real pain;
  2. the created accounts will still be disconnected from the users' Drupal accounts, which might confuse most users.

I have thought of a couple of solutions where custom-made PHP pages would tap into the Postfix database, but they would end up being very unclean, not scalable, ultimately undrupallike (assuming that's a word).

The best solution would be to take Postfix Admin and make it into a real Drupal module. I am aware of most (if not all) difficulties, among which:

  • Postfix Admin manages multiple domains;
  • the Postfix database is, obviously, different from the Drupal database;
  • Postfix tends to store cleartext passwords (someone correct me if I'm wrong – although I've found a small workaround for this).

Even though the base code is there, the time and effort needed to write such a module (especially to someone like me, who's played with modules but never really built one from scratch) would be great. At one point I'll definitely give it a try myself (not before the spring), and although I'm doing this for a specific client I will definitely give it back to the Drupal community.

If anyone is willing to join this idea, let me know through the forum. Let's keep the discussion (if any) on here for the moment.

Thanks,
Tony

LDAP

bangpound - January 18, 2008 - 13:20

This is a project where Drupal - LDAP integration would be useful.

I've done it for CiviCRM using OpenLDAP's SQL backend. That reads the CiviCRM database over ODBC and transforms the relational data to a directory tree for LDAP. I've posted this over at the CiviCRM wiki.

I've extended this to allow Drupal users to bind to the LDAP tree, which means their password and username on Drupal are used to connect them to the OpenLDAP server.

Postfix has a good LDAP interface which should be reliable over the long term. You might be able to accomplish your task without any PHP code... just use roles to select who has permission to use the mail server, and set up your back_sql to limit its valid users to those with that role.

Let me know if I should explain more. It's still early in the morning.

Maybe some more explanation

antiorario - January 18, 2008 - 21:32

Maybe some more explanation will be needed. I don't know much about LDAP, but I will learn more to understand exactly what you are suggesting.

The thing is, in my case, that I already have Postfix set up and running with virtual domains (I set it up myself a year ago), and I would like to implement this so that the current users won't be affected.

Let's do this too

dhruvahuja - July 31, 2008 - 07:26

Hi

I am primarily interested in rebuilding postfixadmin for drupal but since I am a big fan of LDAP, I would like to contribute with these efforts too.

Tell me more about what your stuff is... is it a drupal module? Can we look at automatically configuring postfix too? Active Directory integration will be a killer!

I have extensive experience in LDAP integrations. Lets take this somewhere :)

Thanks
Dhruv

OK I'll start by answering

antiorario - January 23, 2008 - 08:10

OK I'll start by answering my own questions. By doing so, hopefully I'll get some positive response – or corrections, or tips on how to proceed.

Following bangpound's post, I investigated into LDAP a little further and I found out that making Postfix work with LDAP with a MySQL backend gets only half the job done, because lookups are possible but user provisioning isn't. So I would have to still create the users outside of Drupal if I wanted to have LDAP authentication.

The thing is that my Postfix server is already based on MySQL. I also read that this setup works fine if the server gets a few hundreds connections per minute, but starts being inefficient for thousands a minute. I don't know if that will ever be my case, but what I read is that a standard LDAP-based Postfix setup would be muche better at the job.

So, my planned course of action (I write this for myself, and for whoever else might be interested in the matter) would be to:

  1. set LDAP correctly (here's where I'm lacking knowledge, although I'm learning more and more each day);
  2. copy and adapt MySQL-based Posftix data to LDAP (using PHP, possibly, because that's what I'm good at), so that old users won't notice the difference;
  3. switch Postfix to LDAP, editing the relevant .cf files to change virtual maps, etc. from MySQL.

To link this particular Drupal website to LDAP (both in lookup and provisioning), I am planning to use these modules:
http://drupal.org/project/ldap_provisioning
http://drupal.org/project/ldap_integration

Finally, to manage the whole Postfix/LDAP server (especially those domains that aren't linked to a specific Drupal user system), I guess I can use http://phpldapadmin.sourceforge.net/, since obviously Postfix Admin won't work anymore.

Am I on the right track?

I'm interested.

NigelCunningham - April 11, 2008 - 23:56

Hi.

I'm setting up a new site (transferring it from Joomla) for the small denomination I'm a minister in. One of the new features I'd like to implement is a facility for managing Postfix.

I'd like to set things up so that particular users can set up/modify real addresses and aliases for their congregation (virtual host), change passwords and the like.

Regards,

Nigel

Count me in!

dhruvahuja - July 31, 2008 - 07:21

Hi

I realize how important this integration is. I felt the need in my last project. Due to lack of time, I did it the undrupal way ;)

I have extensive experience with Linux, Postfix, Multiple Domains and Multi Site Drupal installations.

LDAP integration is the best idea but the MySQL backend are also important.

So, how and when do we get started?

Thanks
Dhruv

 
 

Drupal is a registered trademark of Dries Buytaert.