Nov 24

said: 553 1242141906 (in reply to RCPT TO command))

okay just quick  share, i have this strange qmail bounceback error on  my qmail vpopmail server. One of our developer have this formail and use our local open relay mail server to send email and some of the user reported the email didn’t wen through. Sent mail relay from test@mail.com(alias) to user@domainmail.com

And first of all i checked the qmail log on /var/log/mail.info and got this

# cat /var/log/mail.info | grep user@domainmail.com
Nov 24 11:57:47 mx4 postfix/cleanup[8234]: 26C979EC8D: hold: header Received: from smtp.mail.com (mx4.mail.com [101.52.112.1])??by mx4.binus.edu
(Postfix) with ESMTP id 26C979EC8D??for < user@domainmail.com>; Tue, 24 Nov 2009 11:57:10 +0700 (WIT) from mx4.mail.com [101.52.112.1]; from=<test@mail.com> to=<user@domainmail.com> proto=ESMTP
helo=<smtp.mail.com>
Nov 24 11:57:59 mx4 postfix/smtp[8241]: EE3B59ECC5:to=<user@domainmail.com>, relay=artem.domainmail.com[101.51.181.1]:25, delay=49, delays=48/0.02/0.72/0.06, dsn=5.0.0, status=bounced (host artem.domainmail.com[101.51.181.1] said: 553 1242141906 (in reply to RCPT TO command))

Okay you just got this 553 1242141906, hmm that’s not explain everything right ? even you try to google it you did not find anything. Okay i need another test and this time i will go to smtp.mail.com shell and send email from there

# telnet mail.domainmail.com 25
Trying 101.51.181….
Connected to artem.domainmail.com.
Escape character is ‘^]’.
220 rblsmtpd.local

ehlo mail.domainmail.com
250 rblsmtpd.local

it suppose to  show this

# telnet mail.domainmail.com 25
Trying 101.51.181….
Connected to artem.domainmail.com.
Escape character is ‘^]’.
220 domainmail.com ESMTP
ehlo mail.domainmail.com
250-domainmail.com
250-PIPELINING
250 8BITMIME

okay i also try to send a mail test

# telnet mail.domainmail.com 25
Trying 101.51.181….
Connected to artem.domainmail.com.
Escape character is ‘^]’.
220 rblsmtpd.local

ehlo mail.domainmail.com

250 rblsmtpd.local
mail from: <test@mail.com>
250 rblsmtpd.local
rcpt to: <user@domainmail.com>
553 1242141906
data
553 1242141906
Connection closed by foreign host.

there you see the 553 1242141906 error once again

Okay solution

– go to your destination server mail.domainmail.com-> shell and checked the rbl setting and on qmail vpopmail it is on /var/qmail/supervise/qmail-smtpd/run

# vim /var/qmail/supervise/qmail-smtpd/run

-b -r sbl-xbl.spamhaus.org \
#!/bin/sh
exec /usr/local/bin/tcpserver -p -R -x /home/vpopmail/etc/tcp.smtp.cdb -u92 -g91 -v -c250 0 smtp /usr/local/bin/rblsmtpd \
-b -r bl.spamcop.net \

-b -r sbl-xbl.spamhaus.org \

-b -r dnsbl.njabl.org \  # remove this
-r dnsbl.sorbs.net \
# remove this

/var/qmail/bin/qmail-smtpd 2>&1

#exec  \
#    tcpserver -u92 -g91 -v -p -R    \
#    -c 100 -x /home/vpopmail/etc/tcp.smtp.cdb 0 25  \
#    /var/qmail/bin/qmail-smtpd 2>&1

then save it and don’t forget to restart the qmail

# /etc/init.d/qmail restart

Restarting qmail:
* Stopping qmail-smtpd.
* Sending qmail-send SIGTERM and restarting.
* Restarting qmail-smtpd.
* Sending qmail-pop3d SIGTERM and restarting.

then go to your source mail server which issmtp.mail.com and try the telnet

# telnet mail.domainmail.com 25
Trying 101.51.181….
Connected to artem.domainmail.com.
Escape character is ‘^]’.
220 domainmail.com ESMTP
ehlo mail.domainmail.com
250-domainmail.com
250-PIPELINING
250 8BITMIME

try to send email

# telnet mail.domainmail.com 25
Trying 101.51.181…
Connected to artem.domainmail.com.
Escape character is ‘^]’.
220 domainmail.com ESMTP
ehlo mail.domainmail.com
250-domainmail.com
250-PIPELINING
250 8BITMIME
mail from: <test@mail.com>
250 ok
rcpt to: <user@domainmail.com>
250 ok
data
354 go ahead
test test 123
.
250 ok 1259071309 qp 9519
quit
221 domainmail.com
Connection closed by foreign host.

that’s it 🙂

Aug 11

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  first 11 password  (or so) characters are random data called the “salt”. 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 vpasswd command from the qmail vpopmail and here is my script for you who want to changes of your email username.

Just create a php files and insert the script below:

#vi passwdrst.php

<?

$handle = fopen(“pwdrst.txt”, “r”);

$counter=0;

while (!feof($handle)) {

$userinfo = fscanf($handle, “%[a-zA-Z0-9._ ],%[a-zA-Z0-9. ]” );

if ($userinfo) {

list ($email, $password) = $userinfo;

$counter++;

$email=trim(strtolower($email));

$password=trim($password);

echo “username : $email@test.org password : $password  \n”;

exec(“/home/vpopmail/bin/vpasswd $email@test.org $password “);

}

$userinfo=NULL;

}

fclose($handle);

echo “Changing $counter users password”;

?>

changes the test.org to your email domain address.

Then paste your list of username and the new password you want to changes on pwdrst.txt ( use this format : username, newpassword)

# vi pwdrst.txt

test,  testi3
test2, test456
test3, test6757

Then run your  resetpwd.php script

# php resetpwd.php

username : test@test.org password : testi3
username : test2@test.org password : test456
username : test3@test.org password : test6757

Changing 3 users password

That’s it 🙂 you can changes all of the user password