[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Fwd: Fwd: Re: Re[6]: Fwd: QMAIL-MYSQL - CHECKPASSWORD



so 1st of all in order to work you need to change all the passwords.
the easiest way is to make a "script" which does:
1) select from the passwd table
2) generate the crypted password
3) update query (with the crypted password)

for example in PHP to generate a crypt passowrd:

$salt=chr(rand(0,25)+97).chr(rand(0,25)+97);
$crypt_password=crypt($password,$salt);

so there is no "automatic" thing !

you just need to make a small 10 lines script (perl / php / python,
what ever you want) to make the sql update !


Friday, August 26, 2005, 11:47:15 AM, spdesai@xxxxxxxxx wrote:

> Hello all ..specially michael.devogelaere and catalin

> Pl. help me to resolve the below problem.....as i m very much near to solve it..

> It will be highly appreciated...

> Regards,
> Suhag


> ----- Forwarded message from "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx> -----
>     Date: Thu, 25 Aug 2005 20:17:55 +0530
>     From: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
> Reply-To: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
>  Subject: Fwd: Fwd: Re: Re[6]: Fwd: QMAIL-MYSQL - CHECKPASSWORD
>       To: "qmail-sql@xxxxxxxxxx" <qmail-sql@xxxxxxxxxx>

> Hello All

> Pl read the below forwared message first....


> Actually i have stored the password in my sql database as per below..

mysql>> select passwd from passwd where id='suhag';
> +---------------+
> | passwd        |
> +---------------+
> | suhag          
> +---------------+
> 1 row in set (0.00 sec)

mysql>> select passwd from passwd where id='noc';
> +--------+
> | passwd |
> +--------+
> | noc    |
> +--------+
> 1 row in set (0.00 sec)


> I think which is not so i have added crypted password as per below
> perl -e "print crypt(suhag, encrypted_password)"

> and copied the output of above command to password of suhag in sql table..

mysql>> select passwd from passwd where id='suhag';
> +---------------+
> | passwd        |
> +---------------+
> | enpPeRoF31.1Q |
> +---------------+
> 1 row in set (0.00 sec)


> and then i have tried to login ..so its working file..

> But its not worked for other user ... so pl give me setting to store the
> crypted password in sql table for all user so i not need to give perl command ,
> copied same in passwd table etc... etc for every user....

> My dbtable (passwd) are as per below.. 

mysql>> describe passwd;
> +--------------+--------------------+------+-----+---------------------+-------+
> | Field        | Type               | Null | Key | Default        | Extra |
> +--------------+--------------------+------+-----+---------------------+-------+
> | id           | varchar(64)        |      | PRI |                |       |
> | uid          | int(11)            |      |     | 0              |       |
> | gid          | int(11)            |      |     | 0              |       |
> | home         | varchar(200)       |      |     |                |       |
> | mbox_host    | varchar(64)        |      | PRI |                |       |
> | passwd       | varchar(32)        |      |     |                |       |
> | hardquota    | int(11)            | YES  |     | 0              |       |
> | start_date   | datetime           |      |     | 0000-00-00 00:00:00 |       |
> | expire_date  | datetime           |      |     | 0000-00-00 00:00:00 |       |
> | enabled      | tinyint(1)         |      |     | 1              |       |
> | use_dotqmail | tinyint(1)         | YES  |     | 0              |       |
> | lastlogin    | datetime           |      |     | 0000-00-00 00:00:00 |       |
> | crypt        | varchar(32) binary |      |     |                |       |
> | active       | enum('Y','N')      |      |     | Y              |       |
> | apop_pass    | varchar(32)        |      |     |                |       |
> +--------------+--------------------+------+-----+---------------------+-------+
> 15 rows in set (0.00 sec)


> Thanks for yr helpp..now tell me to solve above..as i m very much near to solve
> the problem ..

> _regards,

> Suhag.



> ----- Forwarded message from "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx> -----
>     Date: Thu, 25 Aug 2005 19:48:35 +0530
>     From: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
> Reply-To: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
>  Subject: Fwd: Re: Re[6]: Fwd: QMAIL-MYSQL - CHECKPASSWORD
>       To: "qmail-sql@xxxxxxxxxx" <qmail-sql@xxxxxxxxxx>

> Hello,,

> I have checked with your suggested patch ..and now i m getting below error.

> Aug 25 19:50:23 mail checkpassword: Received authentication-request for
> suhag@xxxxxxxxxx
> Aug 25 19:50:23 mail checkpassword: Authentication failed: bad password

> My sql table entry as per below for yr ref..

mysql>> select *  from passwd where id='suhag';
> +-------+------+------+--------------------------+-------------------+--------+-
> ----------+------
> ---------------+---------------------+---------+--------------+-----------------
> ----+-------+----
> ----+-----------+
> | id    | uid  | gid  | home                     | mbox_host      | passwd |
> hardquota | start
> _date          | expire_date         | enabled | use_dotqmail | 
> lastlogin           | crypt | act
> ive | apop_pass |
> +-------+------+------+--------------------------+-------------------+--------+-
> ----------+------
> ---------------+---------------------+---------+--------------+-----------------
> ----+-------+----
> ----+-----------+
> | suhag | 1000 | 1000 | /var/qmail/sqlhome/suhag | gnfcinfotower.com | suhag
> |         0 | 0000-
> 00-00 00:00:00 | 0000-00-00 00:00:00 |       1 |            0 | 0000-00-00
> 00:00:00 | Y     | Y
>     |           |
> +-------+------+------+--------------------------+-------------------+--------+-
> ----------+------
> ---------------+---------------------+---------+--------------+-----------------
> ----+-------+----
> ----+-----------+
> 1 row in set (0.00 sec)

> Pl help me..

> Regards,
> Suhag.


> ----- Forwarded message from "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx> -----
>     Date: Thu, 25 Aug 2005 15:20:39 +0530
>     From: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
> Reply-To: "spdesai@xxxxxxxxx" <spdesai@xxxxxxxxx>
>  Subject: Re: Re[6]: Fwd: QMAIL-MYSQL - CHECKPASSWORD
>       To: Catalin Constantin <catalin@xxxxxxxxxxxxxxxxxxx>

> OK
> then

> i will try with that patch and will let u know...if any problem arise..

> thanks..

> suhag.


> Quoting Catalin Constantin <catalin@xxxxxxxxxxxxxxxxxxx>:

>> i think what Michael Devogelaere said about the wrong patch might be
>> the solution in your case !
>> 
>> use the patch that michael suggested:
>> http://qmail-sql.digibel.be/downloads/checkpassword-0.90-sql-0.23b.patch
>> 
>> good luck !
>> 
>> Thursday, August 25, 2005, 12:16:54 PM, spdesai@xxxxxxxxx wrote:
>> > Below is the error while trying POP3 login
>> 
>> > root@mail root]# telnet localhost 110
>> > Trying Localhost...
>> > Connected to localhost.
>> > Escape character is '^]'.
>> > +OK <16843.1124961766@xxxxxxxxxxxxxxx>
>> > user suhag@xxxxxxxxxx
>> > +OK
>> > pass suhag
>> > -ERR authorization failed
>> > Connection closed by foreign host.
>> 
>> 
>> > My pop3d run file as per below.
>> 
>> > [root@mail root]# cat /var/qmail/supervise/qmail-pop3d/run
>> > #!/bin/sh
>> > exec /usr/local/bin/softlimit -m 15000000 \
>> >     /usr/local/bin/tcpserver -v -R -H -l 0 0 110 /var/qmail/bin/qmail-popup
>> \
>> >         mail.domain.com /bin/checkpassword
>> > /var/qmail/bin/qmail-pop3d Mai      
>> >          ldir 2>&1
>> 
>> > Regards,
>> > Suhag
>> 
>> 
>> > Quoting Catalin Constantin <catalin@xxxxxxxxxxxxxxxxxxx>:
>> 
>> >> and !
>> >> what do you get in the logs when you simulate the pop3 login:
>> >> user username
>> >> pass the pass
>> >> 
>> >> 
>> >> also did you consider trying with something else:
>> >> 1) dovecot + mysql / pgsql support (Very good choice)
>> >> 2) courier imap + auth mysql / pgsql support
>> >> 
>> >> maybe you also will need imap soon (eg: a webmail) so investing your
>> >> time in configuring for example dovecot might be a very good
>> >> alternative  !
>> >> 
>> >> another thing:
>> >> make sure that /bin/checkpassword is the file resulted after the
>> >> compilation of your qmail-sql package.
>> >> 
>> >> 
>> >> 
>> >> 
>> >> Wednesday, August 24, 2005, 7:18:49 PM, spdesai@xxxxxxxxx wrote:
>> >> > Hello
>> >> 
>> >> > I started  
>> >> 
>> >> > /var/qmail/bin/qmail-popup domain /bin/checkpassword pwd
>> >> 
>> >> > Any other info ?
>> >> 
>> >> > Reagards,
>> >> > Suhag
>> >> 
>> >> 
>> >> -- 
>> >> Catalin Constantin
>> >> Bounce Software
>> >> http://www.bounce-software.com
>> >> http://www.cabanova.ro
>> >> 
>> >> 
>> 
>> 
>> 
>> 
>> > -------------------------------------------------
>> > This mail sent through IMP: http://horde.org/imp/
>> 
>> 
>> -- 
>> Catalin Constantin
>> Bounce Software
>> http://www.bounce-software.com
>> http://www.cabanova.ro
>> 
>> 




> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/


> ----- End forwarded message -----




> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/


> ----- End forwarded message -----




> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/


> ----- End forwarded message -----




> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/


-- 
Catalin Constantin
Bounce Software
http://www.bounce-software.com
http://www.cabanova.ro