{"id":570,"date":"2009-08-11T20:35:18","date_gmt":"2009-08-11T13:35:18","guid":{"rendered":"http:\/\/adityo.blog.binusian.org\/?p=570"},"modified":"2009-08-11T20:35:18","modified_gmt":"2009-08-11T13:35:18","slug":"script-to-reset-a-list-of-user-email-address-on-qmail-vpopmail","status":"publish","type":"post","link":"https:\/\/adityo.blog.binusian.org\/?p=570","title":{"rendered":"Script to reset a list of user email address on qmail vpopmail"},"content":{"rendered":"<p style=\"text-align: justify;\">This is a script to reset a list of qmail vpopmail email username. As you might know if you are using <a href=\"http:\/\/sylvestre.ledru.info\/howto\/howto_qmail_vpopmail.php\" target=\"_blank\">qmail vpopmail <\/a> and set the qmail vpopmail user and password inside of MySQL db , qmail vpopmail set the\u00a0\u00a0first 11 password \u00a0(or so) characters are random data  called the &#8220;salt&#8221;.  The actual password (encoded using the salt)  appears after the salt . That is why you cannot just insert or update your vpopmail mysql db table and enter your new password or encrypt it with MD5. You must use\u00a0vpasswd command from the qmail vpopmail and here is my script for you who want to changes of your email username.<\/p>\n<p>Just create a php files and insert the script below:<\/p>\n<p>#vi passwdrst.php<\/p>\n<p>&lt;?<\/p>\n<p>$handle = fopen(&#8220;pwdrst.txt&#8221;, &#8220;r&#8221;);<\/p>\n<p>$counter=0;<\/p>\n<p>while (!feof($handle)) {<\/p>\n<p>$userinfo = fscanf($handle, &#8220;%[a-zA-Z0-9._ ],%[a-zA-Z0-9. ]&#8221; );<\/p>\n<p>if ($userinfo) {<\/p>\n<p>list ($email, $password) = $userinfo;<\/p>\n<p>$counter++;<\/p>\n<p>$email=trim(strtolower($email));<\/p>\n<p>$password=trim($password);<\/p>\n<p>echo &#8220;username : $email@test.org password : $password \u00a0\\n&#8221;;<\/p>\n<p>exec(&#8220;\/home\/vpopmail\/bin\/vpasswd $email@test.org $password &#8220;);<\/p>\n<p>}<\/p>\n<p>$userinfo=NULL;<\/p>\n<p>}<\/p>\n<p>fclose($handle);<\/p>\n<p>echo &#8220;Changing $counter users password&#8221;;<\/p>\n<p>?&gt;<\/p>\n<p>changes the\u00a0test.org to your email domain address.<\/p>\n<p>Then paste your list of username and the new password you want to changes on\u00a0pwdrst.txt ( use this format : username, newpassword)<\/p>\n<p># vi\u00a0pwdrst.txt<\/p>\n<p>test, \u00a0testi3<br \/>\ntest2, test456<br \/>\ntest3, test6757<\/p>\n<p>Then run your\u00a0\u00a0resetpwd.php script<\/p>\n<p># php resetpwd.php<\/p>\n<p>username :\u00a0test@test.org password : testi3<br \/>\nusername : test2@test.org password : test456<br \/>\nusername : test3@test.org password : test6757<\/p>\n<p>Changing 3 users password<\/p>\n<p>That&#8217;s it \ud83d\ude42 you can changes all of the user password<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a script to reset a list of qmail vpopmail email username. As you might know if you are using qmail vpopmail and set the qmail vpopmail user and password inside of MySQL db , qmail vpopmail set the\u00a0\u00a0first 11 password \u00a0(or so) characters are random data called the &#8220;salt&#8221;. The actual password (encoded [&hellip;]<\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[493],"tags":[2742],"class_list":["post-570","post","type-post","status-publish","format-standard","hentry","category-qmail","tag-qmail-reset-user-password-script"],"_links":{"self":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=570"}],"version-history":[{"count":2,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions"}],"predecessor-version":[{"id":572,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=\/wp\/v2\/posts\/570\/revisions\/572"}],"wp:attachment":[{"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adityo.blog.binusian.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}