<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8088599768006216074</id><updated>2011-07-08T06:50:01.649-07:00</updated><category term='Migration'/><category term='Mail'/><category term='SquirrelMail'/><category term='Qmail'/><category term='Vpopmail'/><category term='Sys.Admin'/><category term='Sniffing'/><title type='text'>lief/tecanologie</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://navinsylvester.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8088599768006216074/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://navinsylvester.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Navin A.Sylvester</name><uri>http://www.blogger.com/profile/09233488750184340897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_y7j8EE2G-Oo/SlCkZVqT2BI/AAAAAAAAACs/gUZN4Rvd8KM/S220/profile.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8088599768006216074.post-1513456965141667705</id><published>2009-07-05T07:22:00.000-07:00</published><updated>2009-07-05T11:47:03.332-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Vpopmail'/><category scheme='http://www.blogger.com/atom/ns#' term='Qmail'/><category scheme='http://www.blogger.com/atom/ns#' term='Sys.Admin'/><category scheme='http://www.blogger.com/atom/ns#' term='Migration'/><category scheme='http://www.blogger.com/atom/ns#' term='Mail'/><category scheme='http://www.blogger.com/atom/ns#' term='SquirrelMail'/><title type='text'>Migrate Qmail, Vpopmail &amp; SquirrelMail to New Server</title><content type='html'>Needed to migrate a Qmail, Vpopmail and SquirrelMail from an old machine to a brand new server with Raid 5 capabilities. Everything with the old setup was working as a charm so i wanted to keep my smartness on the hold to not to screw up anything.&lt;br /&gt;&lt;br /&gt;Below mentioned is the procedure to effortlessly do the migration.&lt;br /&gt;&lt;br /&gt;Setup Raid 5.&lt;br /&gt;&lt;br /&gt;Install CentOS 5.2(RAID &amp;amp; LVM).&lt;br /&gt;&lt;br /&gt;Install all the needed requirements for the mail server.&lt;br /&gt;&lt;br /&gt;Install all the components of the mail server(Qmail, Vpopmail, SquirrelMail, etc).&lt;br /&gt;&lt;br /&gt;Login to the old server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd /home/vpopmail/domains&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vi list_vpopmail_users.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;for domain in *;&lt;br /&gt;do for user in `ls $domain`;&lt;br /&gt;do echo -n "~vpopmail/bin/vadduser" $user@$domain;&lt;br /&gt;~vpopmail/bin/vuserinfo $user@$domain | grep -v "name:\|^passwd:" | sed -e 's/clear passwd://'; done; done | grep -v "no such"| grep @ |sort&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#chmod 755 list_vpopmail_users.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#./list_vpopmail_users.sh &gt; vpopmail_users&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Open vpopmail_users and edit unwanted entries.&lt;br /&gt;&lt;br /&gt;Move the vpopmail_users file to the new server.&lt;br /&gt;&lt;br /&gt;Login to your new server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#/home/vpopmail/bin/vadddomain your_domain_name your_postmaster_password&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Execute the vpopmail_users file in the new server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#./vpopmail_users&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now login to you old server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd /root&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#ssh-keygen -t dsa -b 1024 -f root_dsa -C 'Root dsa key'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#mv root_dsa /root/.ssh/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#scp root_dsa.pub root@new_server_ip:~&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Login to your new server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cat root_dsa.pub &gt;&gt; /root/.ssh/authorized_keys&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#chmod 600 /root/.ssh/authorized_keys&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#rm -rf root_dsa.pub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Login to your old server and issue the following command.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#rsync -avuzr --stats --delete -e "ssh -i /root/.ssh/root_dsa" /home/vpopmail/domains/your_domain_name root@new_server_ip:/home/vpopmail/domains/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy SquirrelMail from old to new server.&lt;br /&gt;&lt;br /&gt;Login to your new server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#scp -r root@old_server_ip:/var/www/html/webmail /var/www/html/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had my SquirrelMail data and attachments in the /var/wmdata and /var/wmattachments. So copy your data and attachments directory from old server to the new one using the scp command.&lt;br /&gt;&lt;br /&gt;Next we need to change permissions of the data and attachments directory to enable apache to have write access. Look up apache config to find the username and group under which it runs and change the permissions accordingly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#chown -R apache:apache /var/your_data_directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#chown -R apache:apache /var/your_attachment_directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Next change the ip address used by SquirrelMail by running conf.pl.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd /var/www/html/webmail/config&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#./conf.pl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And that's it folks!!!.&lt;br /&gt;&lt;br /&gt;The solution is nothing new and i have posted what just worked for me. I owe google...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8088599768006216074-1513456965141667705?l=navinsylvester.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://navinsylvester.blogspot.com/feeds/1513456965141667705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8088599768006216074&amp;postID=1513456965141667705' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8088599768006216074/posts/default/1513456965141667705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8088599768006216074/posts/default/1513456965141667705'/><link rel='alternate' type='text/html' href='http://navinsylvester.blogspot.com/2009/07/migrate-qmail-vpopmail-squirrelmail-to.html' title='Migrate Qmail, Vpopmail &amp; SquirrelMail to New Server'/><author><name>Navin A.Sylvester</name><uri>http://www.blogger.com/profile/09233488750184340897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_y7j8EE2G-Oo/SlCkZVqT2BI/AAAAAAAAACs/gUZN4Rvd8KM/S220/profile.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8088599768006216074.post-3662042894519219435</id><published>2009-07-05T06:18:00.000-07:00</published><updated>2009-07-06T01:55:43.173-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Qmail'/><category scheme='http://www.blogger.com/atom/ns#' term='Sys.Admin'/><category scheme='http://www.blogger.com/atom/ns#' term='Sniffing'/><category scheme='http://www.blogger.com/atom/ns#' term='Mail'/><title type='text'>Sniff outgoing and incoming mails in Qmail</title><content type='html'>The client had a email policy and requested mail sniffing feature to be implemented in Qmail. My personal moral standpoint doesn't matter here and explained below is just the technology feasibility for sniffing all outgoing and incoming mails in a Qmail server.&lt;br /&gt;&lt;br /&gt;It's quite easy to sniff mails using "QUEUE_EXTRA" and "QUEUE_EXTRALEN" as explained elsewhere on the Internet. This solution will help to setup an sniff account to view all outgoing and incoming mails. But this solution is not smart enough, so it will even copy all the marked mails. The sniff account will become clogged with many similar mails. The best solution would be to club the above sniff method with "eliminate-dups". This method will ensure that your sniff account will have a single unique copy of marked mail.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sniff Method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Open Qmail source file extra.h and modify QUEUE_EXTRA and QUEUE_EXTRALEN as mentioned below.&lt;br /&gt;&lt;br /&gt;QUEUE_EXTRA here has sniff@domainname.com. Please replace that with your sniff acount name and your domain name.&lt;br /&gt;&lt;br /&gt;QUEUE_EXTRALEN 22 is the length of your email account name + 2(T,/0). sniff@domainname.com length is 20 and when you add + 2, its 22. Difficult math :).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vi /usr/src/qmail/qmail-1.03/extra.h&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;############################################&lt;br /&gt;#ifndef EXTRA_H&lt;br /&gt;#define EXTRA_H&lt;br /&gt;&lt;br /&gt;#define QUEUE_EXTRA "Tsniff@domainname.com\0"&lt;br /&gt;#define QUEUE_EXTRALEN 22&lt;br /&gt;&lt;br /&gt;#endif&lt;br /&gt;############################################&lt;br /&gt;&lt;br /&gt;Save the file.&lt;br /&gt;&lt;br /&gt;I already had a Qmail production server and so i needed to stop it to enable this feature.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#qmailctl stop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd /usr/src/qmail/qmail-1.03/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile the changes&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#make setup check&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Eliminate Duplicates Method:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#tar xzvf eliminate-dups-2.2.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd eliminate-dups-2.2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#make -f Makefile.dist Makefile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#make&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recent perl version will complain about missing NDBM. To fix this problem comment out the line "use NDBM_File;".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vi eliminate-dups.pl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;#use NDBM_File;&lt;br /&gt;&lt;br /&gt;Now you are ready to install eliminate-dups.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#make install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The installation should proceed without any glitch.&lt;br /&gt;&lt;br /&gt;Now you need to create a file named as ".qmail" in your /root directory. Whack yourself if you forget to replace sniff@domainname.com with your sniff account name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#cd /root&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vi .qmail&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;| eliminate-dups mailhash&lt;br /&gt;&amp;amp;sniff@domainname.com&lt;br /&gt;&lt;br /&gt;Save the file.&lt;br /&gt;&lt;br /&gt;Now you need to create another file named as ".qmail-maildir" in your /root directory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#vi .qmail-maildir&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;./Maildir/&lt;br /&gt;&lt;br /&gt;Now start Qmail and shamelessly spy on others.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;#qmailctl start&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8088599768006216074-3662042894519219435?l=navinsylvester.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://navinsylvester.blogspot.com/feeds/3662042894519219435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8088599768006216074&amp;postID=3662042894519219435' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8088599768006216074/posts/default/3662042894519219435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8088599768006216074/posts/default/3662042894519219435'/><link rel='alternate' type='text/html' href='http://navinsylvester.blogspot.com/2009/07/sniff-outgoing-and-incoming-mails-in.html' title='Sniff outgoing and incoming mails in Qmail'/><author><name>Navin A.Sylvester</name><uri>http://www.blogger.com/profile/09233488750184340897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://3.bp.blogspot.com/_y7j8EE2G-Oo/SlCkZVqT2BI/AAAAAAAAACs/gUZN4Rvd8KM/S220/profile.jpg'/></author><thr:total>3</thr:total></entry></feed>
