Tuesday, January 4, 2011

email server migration - Sendmail - Postfix - LDAP

I am given with a task to migrate emails from a sendmail server to postfix server. The was a complex task, because of following reason.
- There were many virtual domains
- The sendmail was using mailbox and postfix was using maildir
- The sendmail authentications was on passd files and the postfix's user profile was on LDAP
- The users who are migrated to postfix will get a emails with new domain which was there in postfix and users should be able to use both emails using single account.

I learnt a lot by doing this. I will share that here.

Migrating virtual domain accounts
Sendmail had several virtual domains
eg. xxx.ttt.lk, nnn.mmm.lk etc. All these were created under /etc/vmail/alias.xxx.yyy.lk, alias.nnn.mmm.lk etc. In /etc/vmail the respecting passwd and shadow files also were there.

There I extracted all the users information and made a ldif file so that I can create users on LDAP server. To do that I developed a PHP scipt which reads the information from an excel file and output a ldif file.

When I do this, I add all the mail accounts are mail alias in LDAP.

Another issue I found when I do this was, some password on the old sendmail system was in Unix crypt format. However in the new postfix server it was decided to use the md5crypt. Since the Unix crypt use fixed salting, I used a default md5crypted password for existing Unix Crypted password.

Using the generated ldif file, I created the accounts on LDAP server


Then another issue was how to have all the sendmail virtual domains in postfix. I found that in postfix configuration there is a pasrameter called virtual_domains where I listed all the virtual domains of sendmail so that the postfix will start allowing those domains.

In addition to that I had to do the change in the DNS server as well so that here after all the xxx.yyy.lk and nnn.mmm.lk will be sent to new postfix server.


Moving mailbox to maildir

Other issues was moving existing mailbox of users in sendmail to maildirs in postfix.
To do this, I used a tool called mb2md (http://batleth.sapienti-sat.org/projects/mb2md/)
This tool has several options.
However to use this tool, your system also should have date::parse perl

I installed this using following way :

perl -MCPAN -e 'SHELL'
Install Date::parse

After installing this I added executable access to downloaded mb2md perl script.

Thereafter I ran the script as follows :

./mb2md -s /var/spool/mail/user1 -d /opt/maildirs/user1

Then I also prepared the existing mailbox folders (which were located in /vhome/user1) as maildirs using following command :

./mb2md -s /vhome/user1 -R -d /opt/maildirs/user1

when I ran these command it was showing how many messages got extacted and how many folders have been created etc.

After creating these maildirs I moved them to the respecting locations in the postfix server and provided the owenership to vmail (in my case it was vmail. This user should be defined in main.cf file.


Hope this will help

Enjoy!

Friday, August 13, 2010

Configure TSIG between DNS master and slave

Generating SIG(0) Keys

SIG(0) keys are generated with the following command:

$ dnssec-keygen -a -b -n HOST

is the desired algorithm of the key and can be any of the following values: RSAMD5, RSASHA1, DSA. We recommend that you use RSAMD5.

is the desired size in bits of the key and the ranges are different depending on the algorithm:

* RSAMD5: 512 to 4096 (recommended size 1024)
* RSASHA1: 512 to 4096 (recommended size 1024)
* DSA: 512 to 1024 (must be divisible by 64, recommended size 1024)

is the name of the key. Since it must be published in the zone file, it should be a subname of the zone that it is being published in. It is recommended that the keyname be the fully qualified domain name of the host so that the update-policy self works correctly. (see Section 6.2.22.4 of the BIND ARM for more information on update-policy).

The key will be stored in the file K++.private

is an identity tag to be able to differentiate between different keys under the same name.

There will also be a corresponding K++.key file that contains a DNS KEY resource record formatted for inclusion in the zone file.

One possible problem that can be encountered with dnssec-keygen is that it might use up all the entropy in /dev/random before it is done generating the key. This will make dnssec-keygen appear to hang, when in fact it is simply waiting for more entropy. One solution to this is to use the -r parameter that allows you to specify another random device, such as /dev/urandom.
Configuring the DNS Server

Configuring the server also depends on which type of key you choose.
TSIG Keys

The /etc/named.conf file must be edited to configure the server for dynamic update.

The first step is to configure the server to use the key. This is accomplished with the following lines in the /etc/named.conf file:

key {
algorithm HMAC-MD5;
secret "";
};

is the name of the key chosen when the key was generated (See the previous step, Generating TSIG keys).

is the string after the Key: line in the generated key file (See the previous step, Generating TSIG keys).
SIG(0) Keys

Only the zone file must be edited to configure the server for dynamic update with sig(0). No changes are needed in /etc/named.conf as the client's public, not private, key is in the zone file.

The first step is to add the generated key, using the K++.key file, to the zone file. This generated key file contains a properly formatted resource record that can be simply copy-and-pasted into the zone file.

If you are using DNSSEC signed zones, then the next step is to resign your zone.
Allowing Updates

The final step is to configure the zone to allow updates using the key. The following statements should be added to the zone options block in /etc/named.conf. The simplest configuration is to add:

update-policy {
grant name A TXT;
};

e.g.

zone "example.com" {
type master;
file "master/example.com";

update-policy {
grant foo.example.com. name foo.example.com. A TXT;
};
};

Complex example with a number of hosts allowed to update only their own A+TXT records and one master key allowed to update anything:

update-policy {
grant host1.example.com. name host1.example.com. A TXT;
grant host2.example.com. name host2.example.com. A TXT;
grant host3.example.com. name host3.example.com. A TXT;
grant host4.example.com. name host4.example.com. A TXT;
grant bofh.example.com. subdomain example.com. ANY;
};

Simple example where every key can update the A+TXT records of its matching hostname:

update-policy {
grant * self * A TXT;
};

Note: update-policy is described further in Section 6.2.22.4 of the BIND ARM.

The allow-update statement can also be used, which allows the key to modify any data in the zone. Using more fine grained access control with update-policy is recommended.

allow-update {
key ;
};

is the name of the key chosen when the key was generated (See the previous step, Keys)

http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html

http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html

Wednesday, July 14, 2010

Reset mysql root password - in LAMP / XAMPP

Once I forgot the mysql root password of my laptop computer in which I have Fedora 10 and also XAMPP running in it.

When I searched on Web there are soooo many solutions and none of them worked for me. However I could get un understanding about the issue....

With that I worked out in following way to get rid of the issue :

1. Stop mysqld
2. start /opt/lampp/sbin/mysqld --skip-grant-priviledges --user=nobody
3. open new terminal and type : mysql -u root
4. excute following commands in order :
shell> mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit

Now its done.

You may think that you can do use phpmyadmin after the step-2 to reset the root password. But it was not working for me though I have a phpmyadmin. So I worked our in mysql prompt.

After this everything were working wellll...

but I was not sure with one thing that I could not stop / restart mysql service as usual...
SO what I did is, I restarted the machine... SO simple ha!... but this is not possible in production servers....

Anyone of you know the solution for this?

Enjoy!....

Wednesday, June 30, 2010

Launch of .ලංකා and .இலங்கை domains

28th of June 2010, the .ලංකා and .இலங்கை were formally opened for registration. Now any people who is having a .lk domain can request for .ලංකා and .இலங்கை domains for free.

This launch was held at Mount Lavinia hotel and many people around the world have participated in it including an ICANN board member.

This is an historic event. Because .lk domain was added to root servers on 15th June 1990. Till that date the Sri Lanka was identified the two words .lk. But from 28th June 2010 onwards the country can be indexed using .ලංකා and .இலங்கை.

The another notable point is, these are the two domains which are going to be added to the root servers in the South Asian region and .இலங்கை is the first Tamil domain which is going to be added.

Though the only people in Sri Lanka can access these Sinhala and Tamil domain now, from august onwards all the world should be able to type URL in Sinhala and Tamil and reach respective web sites.

currently there are few IDNs assigned to government sites.
eg
http://தளம்.பாராளுமன்றம்.இலங்கை
http://වෙබ්.පාර්ලිමේන්තුව.ලංකා

I am very happy that I also could take part in this developments and event.

visit www.nic.lk to register and also visit www.idns.lk to get more information about this.

Tuesday, June 29, 2010

Niue - A country - Population is 1000

I had a chance to attend APTLD (Asia Pacific Top Level Domain) meeting which was held at Mount Lavinia hotel on 27 - 28 June, 2010. Many people from Asia pacific region who maintain Domain registries also came for that meeting.
I met a person called Stafford Guest. His native country is Nieu!

Nieu! first time I hear that name. This is an island located near New Zealand. Though it got the Independence in 1974, still getting the symbotic support from New Zealand.

The interesting things to note are :
- Population of the country is 1000!
- The total intetnet bandwidth the country has is 4mbps :-) I have more than that in my PC
- Only one hotel is there
- Only flights can reach there and also those operates once in a week. Therefore if you would like to attend a meeting some there else you may need to leave atlease 8 days before.....
- No Cinema...
- No big shopping malls....

Cant Believe isnt it!

I was really supprised when he tells all these!

But you know it looks soooooo beautiful. Nice beaches (though it rough)... Full of cocunut treess (I saw some picture in Google images)

Also found that Nieu means "Behold! Coconut"

Monday, May 10, 2010

bdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/openldap-data: (2) Expect poor performance

"bdb_db_open: Warning - No DB_CONFIG file found in directory /var/lib/openldap-data: (2) Expect poor performance for suffix XXXXXXXX"


When I work on openLDAP on Fedora 10 platform I got above error.

Solution :

cp /usr/share/doc/openldap-servers-2.4.XX/DB_CONFIG.example /var/lib/ldap/DB_CONFIG
chown ldap:ldap /var/lib/ldap/DB_CONFIG
service ldap restart

This was working for me. Hope it will for you too. Gd lk.

To view the solutions for other platforms visit : http://readthefuckingmanual.net/error/1256/

Monday, August 3, 2009

How Famous Companies were Named

Yahoo!
The word was invented by Jonathan Swift and used in his book Gulliver's Travels. It represents a person who is repulsive in appearance and action and is barely human. Yahoo! founders Jerry Yang and David Filo selected the name because they considered themselves yahoos.

Xerox
The Greek root "xer" means dry. The inventor, Chestor Carlson , named his product Xerox as it was dry copying, markedly different from the then prevailing wet copying.

Sun Microsystems
Founded by four Stanford University buddies, Sun is the acronym for Stanford University Network.

Sony
From the Latin word 'sonus' meaning sound, and 'sonny' a slang used by Americans to refer to a bright youngster.

SAP
"Systems, Applications, Products in Data Processing", formed by four ex-IBM employees who used to work in the 'Systems/Applications/Projects' group of IBM.

Red Hat
Company founder Marc Ewing was given the Cornell lacrosse team cap (with red and white stripes) while at college by his grandfather. He lost it and had to search for it desperately. The manual of the beta version of Red Hat Linux had an appeal to readers to return his Red Hat if found by anyone!

Oracle
Larry Ellison and Bob Oats were working on a consulting project for the Central Intelligence Agency (CIA). The code name for the project was called Oracle (the CIA saw this as the system to give answers to all questions or something such).

Motorola

Founder Paul Galvin came up with this name when his company started manufacturing radios for cars. The popular radio company at the time was called Victrola.
 
Microsoft
It was coined by Bill Gates to represent the company that was devoted to MICROcomputer SOFTware. Originally christened Micro-Soft, the '-' was removed later on.

Lotus
Mitch Kapor got the name for his company from the lotus position or 'padmasana.' Kapor used to be a teacher of Transcendental Meditation of Maharishi Mahesh Yogi.

Intel
Bob Noyce and Gordon Moore wanted to name their new company ' Moore Noyce' but that was already trademarked by a hotel chain, so they had to settle for an acronym of INTegrated ELectronics.

Hewlett-Packard
Bill Hewlett and Dave Packard tossed a coin to decide whether the company they founded would be called Hewlett-Packard or Packard-Hewlett.

Hotmail
Founder Jack Smith got the idea of accessing email via the web from a computer anywhere in the world. When Sabeer Bhatia came up with the business plan for the mail service, he tried all kinds of names ending in 'mail' and finally settled for Hotmail as it included the letters "html" - the programming language used to write web pages. It was initially referred to as HoTMaiL with selective upper casings.

Google
The name started as a jockey boast about the amount of information the search-engine would be able to search. It was originally named 'Googol', a word for the number represented by 1 followed by 100 zeros. After founders - Stanford graduate students Sergey Brin and Larry Page presented their project to an angel investor, they received a cheque made out to 'Google

Cisco
The name is not an acronym but an abbreviation of San Francisco . The company's logo reflects its San Francisco name heritage. It represents a stylized Golden Gate Bridge

Apple Computers

Favourite fruit of founder Steve Jobs. He was three months late in filing a name for the business, and he threatened to call his company Apple Computers if the other colleagues didn't suggest a better name by 5 o'clock.

Apache
It got its name because its founders got started by applying patches to code written for NCSA's httpd daemon. The result was 'A PAtCHy' server - thus, the name Apache.

Adobe
The name came from the river Adobe Creek that ran behind the house of founder John Warnock .

Wednesday, July 22, 2009

Joomla! workshop

Last week I conducted a Joomla! workshop in Tamil for mainly North and East people of Sri Lanka. It is a two days workshop and I did it well than I thought. Enjoyed a lot..

I think the participants too. All appreciated well.. Send mails... Called...

The important think is that they really learnt Joomla! almost all the participants were confident that they can develop the site. Thats a great thing and it seems some of them have developed site for their institute and published.

This workshop is organized by ICTA Sri lanka.

LAKapps

LAKapps is a project of localizing Open Source applications in Sri Lankan local languages viz Tamil and Sinhala. I am in the core team.
We are doing various projects and the project that we started are successfully done till now. Thats a great thing I suppose.

We have localized following FOSS into Tamil :
Joomla!
Moodle
Mozilla Firefox
Mozilla Thunderbird
Squirrel Mail
Horde
GeoGebra

Also we localized following into Sinhala :
Mozilla Thunderbird
Horde
GeoGebra

We also prepared user manuals for all the software that we localized. And other than that we prepared Video training for Joomla! and Open Office.

Next 2nd september 2009 LAKapps is going to organize a Symposium on Local Language Application and Systems.

Wen site : www.lakapps.lk

Sarves

Thursday, June 25, 2009

8th Tamil Internet Conference

INFITT has announced 8th Tamil Internet Conference and its going to be held in Kolen, Germany. I am planing to write a paper about Tamil localization, will see.
Hope you guys also can write something and can contribute to the Tamil-Computing.

For more info. :
http://www.infitt.org/ti2009/?page=eng/home