SendMail tips

Some nice tips for setting up sendmail. The more important of it is to setup the domain name that is the MTA correct, so that the receiving server may not consider the sent emails as spam. By default emails are sent out from the domain name of localhost.localdomain which will be considered spam, best is to change the /etc/mail/sendmail.mc file to match the server details.

A very nice summary of setups to setup sendmail correctly is listed here

MySQL error “Client does not support authentication protocol requested by server; consider upgrading MySQL client”

MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message:

shell> mysql
Client does not support authentication protocol requested by server; consider upgrading MySQL client

To solve this problem, you should use one of the following approaches:

  • Upgrade all client programs to use a 4.1.1 or newer client library.
  • When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
  • Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
    mysql> SET PASSWORD FOR
        -> some_user@some_host = OLD_PASSWORD('newpwd');

Additional details are listed here

Email in Java

I have been using direct socket connections to SMTP server to send out emails through JSP / Java code, but it turns out that no of email clients found that insufficient since, the emails sent out this way had bad chars in the headers that most clients did not understand, I guess its because of not using the SMTP protocal in detail , finally decided to use JavaMail API and it turns out that its quite a simple and easy integration using JavaMail, although I am using J2SE but the only additional files required to use JavaMail is the JavaMail API class and JavaBeans Activation Framework in your classpath and you are all ready to go, here is my simple code in JSP to send out an email.

<%@ page contentType=”text/html; charset=iso-8859-1″ language=”java” import=” java.util.*, java.sql.* , javax.mail.*,javax.mail.internet.*,java.net.*, java.text.*,java.io.*” errorPage=”" %>

<%

String[] strrecipients = {“imran@mydomain.com”, “user@hotmail.com”,”user@gmail.com”};

String strsubject;
String strmessage;
String strfrom ;

boolean debug = false;

strsubject = “this is a test”;

strmessage = “This is a test message  http://www.mydomain.com  “;
strfrom = “admin@mydomain.com”;

//Set the host smtp address
try
{
Properties props = new Properties();
props.put(“mail.smtp.host”, “mail.mydomain.com”);

// create some properties and get the default Session
javax.mail.Session mailsession = Session.getDefaultInstance(props, null);
mailsession.setDebug(debug);

// create a message
Message msg = new MimeMessage(mailsession);

// set the from and to address
InternetAddress addressFrom = new InternetAddress(strfrom);
msg.setFrom(addressFrom);

InternetAddress[] addressTo = new InternetAddress[strrecipients.length];
for (int i = 0; i < strrecipients.length; i++)
{
addressTo[i] = new InternetAddress(strrecipients[i]);
}
msg.setRecipients(Message.RecipientType.TO, addressTo);

// Optional : You can also set your custom headers in the Email if you Want
//    msg.addHeader(“MyHeaderName”, “myHeaderValue”);

// Setting the Subject and Content Type
msg.setSubject(strsubject);
msg.setContent(strmessage, “text/plain”);
Transport.send(msg);
}
catch (MessagingException ex)
{
out.println(ex.toString());
}

%>

“Tag Grammer” or “Tag Trees”

Since tagging has become such a important way to store and retrieve data, I really feel the need to be able to tag data based on a hirarachy. I assume that there is a tagging grammer out there through which I should be able to tag hyperlinks to resources in a tree structure or hirarical categories.

Say e.g if I find a article for ASP.net that is related to datasources and I found it at microsoft site, I should be able to tag it in way like

microsoft : asp.net : datasources

This in return will arrange it in a hirachy , hence if I am searching for microsoft : asp.net that will show me all my tags under that sub category and hence links under that.

I have done a 5 minute search on google to find something like this, but have not been successful to find anything like that for the moment. But will surly like to see something like that that does provide the general user capability to search by simple tags like datasource but at the same time for the experienced user who knows something called a “tag grammer” to make more complex data classification and later on searches.

windows 2003 SP1

Today I found out about the SP1 for windows 2003, I was not confident about installing it on the online server before reading some reviews about it and also testing it out on our development machine first.

download link
Installed the SP1 on the local machine, SP1 is around 337 MB, quite a big download, after installation nothing got broken so thats a good indication :) . It is focused towards security, and contains loads of security enhancements

SP1 is suppose to provide the following features.

http://www.securityfocus.com/columnists/312

Although I did come to know that SP1 does have problems with SBS

http://www.betanews.com/article/Windows_Server_2003_SP1_Released/1112282084

Some discussions

upgrading Small Business Server 2000 to 2003

Small Business server comes in two flavours Standard and premium edition, the details are listed here

http://www.microsoft.com/windowsserver2003/sbs/howtobuy/pricing.mspx

The details of finding the correct reseller in the UK is listed here

http://www.microsoft.com/uk/licensing/buy/where/default.mspx

Microsoft contact details in the UK are listed here

http://www.microsoft.com/worldwide/phone/contact.aspx?country=United%20Kingdom

It is not possible to upgrade premium edition to standard edition.

All Client licenses need to be upgraded.