# Almost have Postfix Virtual Hosting Done (DONE!)

## Bigun

I followed this how to and almost have this working.

I believe it may be a simple issue, but I don't know where to look.

I attempt to login and /var/log/messages barfs up this error:

```
Jun 24 19:31:50 pwnedclips authdaemond: supplied password '********' does not match encrypted password '75d28fef2fbca18334b3de082e95c452'
```

Of course the astericks is my plain password.  Also, I MD5'ed my password online and it does indeed match the stored-encrypted password.  

Is authdaemond using a different encryption?  If so, where do I change it?

----------

## kashani

Hey I'm the guy who wrote the how-to you're using. Couple of questions for you. 

1. Does this happen when you check your mail via imap/pop or when you are attempting to send mail? Or both?

2. Which version of courier-authlib do you have installed?

I suspect that authlib is the problem and I have not tried the new one yet. I'll do some updates on my servers and see what happens. 

kashani

----------

## Bigun

It is with IMAP-SSL.

And uber-props on that how-to.  *BY FAR AND LARGE* the best written on the subjet so far.  Why?  

0% BS.

Love it

*EDIT*

courier-authlib version - [0.60.2-r1]

Although it wants to upgrade to 0.60.6

----------

## kashani

Thanks for the kind words about the how-to I appreciate it. Now I feel guilty for having not updated it in months.  :Smile: 

Okay I looked at the db schema in PostfixAdmin 2.2 which is basically the same for the mailbox table so it's not that. The new courier-authlib looks like it has extra options, but nothing looks vastly different from 0.59. However in looking for a command line md5crypt tool I did find this. "The printable form of MD5 password hashes starts with $1$." Looking at the password column in my database I see that all my passwords do start with $1$. Is the password entry in your case really "75d28fef2fbca18334b3de082e95c452" because if it is it's probably being cram-md5 or md5sum generated instead of md5crypt generated. 

Make sure that you have this line in your Postfixadmin config.inc.php

```

// Encrypt

// In what way do you want the passwords to be crypted?

// md5crypt = internal postfix admin md5

// md5 = md5 sum of the password

// system = whatever you have set as your PHP system default

// cleartext = clear text passwords (ouch!)

$CONF['encrypt'] = 'md5crypt';

```

I think there is a way to do md5 sum comparison, but now you have to change things in other places... and I'm frankly not sure how to do that. 

kashani

----------

## Bigun

```
// Encrypt

// In what way do you want the passwords to be crypted?

// md5crypt = internal postfix admin md5

// md5 = md5 sum of the password

// system = whatever you have set as your PHP system default

// cleartext = clear text passwords (ouch!)

$CONF['encrypt'] = 'md5crypt';

```

That *is* what I have in my config.

Lemme try to create another mailbox

----------

## kashani

Another thing to check, make sure PHP is built with crypt and mhash USE flags. I think Postfixadmin would have bombed a sanity check without those, but silently using md5sum in the background might explain the password.

kashani

----------

## Bigun

I found it, and it was my fault.  Upon initial setup *I* assumed it would be MD5SUM, and set the first mailbox up manually as such.    :Embarassed: 

Now I have one simple question:

```
Jun 24 21:21:30 pwnedclips imapd-ssl: chdir bigun@foo.bar/: No such file or directory
```

The domain is of course not foo.bar.  But how can I get these directories to make themselves?

----------

## Bigun

And again.... odd.... it seemed to have fixed.... itself?!

 :Shocked: 

----------

## Bigun

Wow, bottom line folks, best how to.

Only things that I can think of that need to be added are:

Mention the step where /var/vmail is supposed to be created then given to 'postfix'

Creating the database and user for postfixadmin to use 

That is about it.  Stellar work my friend.

----------

## kashani

Added an OS section for creating the dirs and chown-ing over to Postfix. Added a bit for Mysql. The Postfixadmin instructions cover the Mysql setup fairly well, but it's easy enough to put the quick instructions in my how-to.

Good luck with your mail server and feel free to update the how-to yourself.

kashani

----------

## Bigun

I won't directly update the how-to myself, in the past it seems to make things go messy quite quickly.

However, if you can slip in a user comment section, it would be cool.  That way the structure of the document won't be compromised, but people can still leave comments.  Then what I noticed is that people would wait until you've gone through 90% of the document, then you would see a comment from someone, "hey yeah, ignore the last 30 steps, do this instead".  And at that point, it's a little late.

Very annoying.

----------

