Difference between revisions of "IMAP"

From Organic Design wiki
(begin athentication with MW)
m
Line 7: Line 7:
 
*mbox files at /var/mail/[first letter of username]/[username]
 
*mbox files at /var/mail/[first letter of username]/[username]
 
==Authentication against MediaWiki==
 
==Authentication against MediaWiki==
It would be nice to have the same password for the IMAP email account as is used with the wiki.
+
It would be nice to have the same password for the IMAP email account as is used with the wiki. To do this we use dovecot's ability to use a sql database to obtain user and password information.
 +
 
 +
MediaWiki uses hashed passwords. Here is a code fragment that show how this is done:
 +
<pre>
 +
function wfEncryptPassword( $userid, $password ) {
 +
        global $wgPasswordSalt;
 +
        $p = md5( $password);
 +
 
 +
        if($wgPasswordSalt)
 +
                return md5( "{$userid}-{$p}" );
 +
        else
 +
                return $p;
 +
}
 +
</pre>
 +
As you can see the global ''$wgPasswordSalt'' affects how the passwords are stored. On Organicdesign we have this option enabled.
 +
 
 
==Todo==
 
==Todo==
 
*Need help setting up an ''MX'' record in DNS to be able to test mail delivery and collection.
 
*Need help setting up an ''MX'' record in DNS to be able to test mail delivery and collection.

Revision as of 06:45, 23 March 2008

IMAP is a much improved mail delivery and organisation system. Dovecot is a modern and flexible IMAP server. The plan is to set up IMAP on OrganicDesign in order to have better control of our mail service, and as a service to offer clients by ensuring it's installation is included as part of Debian Post Install. Also, by having our mail folders centralised on our own server the data can be included in our weekly FS backups.

It should also be possible to directly authenticate mail users against the users table of a wiki.

  • See: /etc/dovecot/dovecot-sql.conf

Current state

  • logging at /var/log/dovecot.log
  • mbox files at /var/mail/[first letter of username]/[username]

Authentication against MediaWiki

It would be nice to have the same password for the IMAP email account as is used with the wiki. To do this we use dovecot's ability to use a sql database to obtain user and password information.

MediaWiki uses hashed passwords. Here is a code fragment that show how this is done:

function wfEncryptPassword( $userid, $password ) {
        global $wgPasswordSalt;
        $p = md5( $password);

        if($wgPasswordSalt)
                return md5( "{$userid}-{$p}" );
        else
                return $p;
}

As you can see the global $wgPasswordSalt affects how the passwords are stored. On Organicdesign we have this option enabled.

Todo

  • Need help setting up an MX record in DNS to be able to test mail delivery and collection.
does this mean we need to set up Bind on the server, or should I just configure the webdrive DNS to point an MX record to our IP?
I think this is all that is required. Maybe use a domain that does not currently have mail services running on it. Eg peerix.org. No bind just upstream DNS --Rob 13:27, 15 March 2008 (NZDT)
There are no mail services running on OD, so I may as well use that --Nad 14:32, 15 March 2008 (NZDT)