Search This Blog

Wednesday, July 22, 2009

SmarterMail not receiving mails but can send out email

Well, set up my smartermail in new windows 2003 server. I've already make sure steps provided in Smartermail help file properly set.

WebMail URL (A Record) - Add an A or CNAME record for mail.example.com that points to the IP address of the webmail interface. This will allow users of that domain to access the webmail by typing in http://mail.example.com or http://mail.example.com:9998 in their web browser (depending on whether you use the included web server or IIS).

Mail Pointer (MX Record) - Add an MX record for example.com that points to the IP address that you assigned when adding the domain to SmarterMail. This will allow other email servers to locate your mail server.

Reverse DNS Record - Add a reverse DNS record for IP addresses assigned on the server to provide extra assurance to other mail servers. Also, it is recommended that the primary IP address of the server also have a reverse DNS record. Note: Adding reverse DNS may also require a change at your isp.


Also already setup iis to able login thru specific domain. Things work fine, able to send out email but not able to received email from external domain that not in the server. Strange, huh?

After check here and there, finally find out that we need to enable port in windows firewall.

Well, open my windows firewall and add in "Exceptions" to the port correctly. For my case, i just enable the port for below port



It's work. Hope can help.


Monday, July 13, 2009

#1064 - You have an error in your SQL syntax; xxx corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1

I try to create a mysql stored procedure using phpmyadmin and hit error below

Error

SQL query:

DELIMITER;

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1




my original code:

DELIMITER $$

DROP PROCEDURE IF EXISTS `xxxweb`.`pp_pspbatch` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `pp_pspbatch`(
IN pBatchName VARCHAR(255),
IN pCountryID INT
)
BEGIN

xxxxx
xxxxx
xxxxx

END $$
DELIMITER ;

try below steps, it help to solve my problem
1. Go to any SQL tab in phpMyAdmin.
2. Directly below the SQL text area you'll see a text input labeled "Delimiter." In that field, enter "$$".





3. Modify the script become like below

DROP PROCEDURE IF EXISTS `xxxweb`.`pp_pspbatch` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `pp_pspbatch`(
IN pBatchName VARCHAR(255),
IN pCountryID INT
)
BEGIN

xxxxx
xxxxx
xxxxx

END $$

and run it. It works.

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

this will happen in linux server when the owner permissions is set to read/write/execute only. There is no public and group permissions setting. To solve this, i can the permissions to 755.

Problem solved.

Thursday, July 2, 2009

Reverse 2 dimentional array in C/C++

I need to reverse 2 dimentional array in C/C++.
Example: i need to reverse
10010110 t0 01101001
10000000 to 00000001

my 2 dimention array:

myArray[0][0] = 1
myArray[0][1] = 0
myArray[0][2] = 0
myArray[0][3] = 1
myArray[0][4] = 0
myArray[0][5] = 1
myArray[0][6] = 1
myArray[0][7] = 0

myArray[1][0] = 1
myArray[1][1] = 0
myArray[1][2] = 0
myArray[1][3] = 0
myArray[1][4] = 0
myArray[1][5] = 0
myArray[1][6] = 0
myArray[1][7] = 0

//in main
void main()
{

//call function
reverseArray(myArray, 2);

}

// function reverseArray
void reverseArray(char array[][8], int row) {
int i;
int j;
int size;
char swap;

for (j = 0; j<=(row-1); j++)
{

i=0;
size = 8;

for(i;i<--size;i++)
{
swap=array[j][i];
array[j][i]=array[j][size];
array[j][size]=swap;
}
}
}

this return the value i need. Hope this help