Kompx.com or Compmiscellanea.com

Imapsync. IMAP migration

Operating systems : Linux

Migrating an IMAP account from one IMAP server to another [ 1 ] / Linux, command line:

imapsync --host1 imap.this.com --user1 email@example.com --passfile1 /home/user/imap/passwordfile1 --ssl1 --host2 imap.another.com --user2 email@example.com --passfile2 /home/user/imap/passwordfile2 --ssl2 --skipsize --allowsizemismatch

- There is a web site (example.com) and an email box (email@example.com) hosted at a web hosting company. The IMAP server: imap.this.com. The IMAP server supports SSL.

- The example.com web site is to be transfered to another web hosting company. So is the email@example.com box with all its contents and keeping its folders structure. The IMAP server of another web hosting company: imap.another.com. The IMAP server supports SSL.

1. Set up an email box named email@example.com and a password to it on the server of the web hosting company the email@example.com mailbox is to be transfered to - from the previous web hosting company.

2. Create two text files in /home/user/imap/: passwordfile1 with the password for the mailbox on the first IMAP server and passwordfile2 with the password for the mailbox on the second IMAP server.

3. chmod 600 /home/user/imap/passwordfile1

4. chmod 600 /home/user/imap/passwordfile2

5. Install imapsync

6. Run imapsync

Imapsync transfers a mailbox - keeping its folders structure - from imap.this.com to imap.another.com. SSL is used to enable encryption and passwords are saved to protected files (chmod 600).

Migration between two email service boxes may happen to require to make use of more imapsync options [ 2 ]. Like transfering contents of one Gmail.com box to another demands to have "--port1" and "--port2" specified:

imapsync --host1 imap.gmail.com --port1 993 --user1 email1@gmail.com --passfile1 /home/user/imap/passwordfile1 --ssl1 --host2 imap.gmail.com --port2 993 --user2 email2@gmail.com --passfile2 /home/user/imap/passwordfile2 --ssl2 --skipsize --allowsizemismatch

[ 1 ]

A simple and common case: contents of one email box are transfered to another, empty mailbox. But there can be more complicated ones like: Gmail to Google Apps Email Migration and Moving to Google Apps with imapsync.

[ 2 ]

For more command options: Migrate mail from one server to another with imapsync and imapsync(1) - Linux man page.

Aliosque subditos et thema


Screenshots in DOS


There are several programs for taking screenshots in DOS. SNARF, for instance. Using this application succeeded in taking screenshots in most of the cases. Also, the screenshots' quality (.BMP files) by SNARF results to be the highest among the programs tested: ScreenThief, VideoThief, FLIP, GRABBER, SNARF. Using SNARF with default settings is straightforward, but there is a shortcoming - SNARF always saves screenshots to the folder where the user is currently in. That could be inconvenient or unacceptable. And there is no obvious way to change it. But there is a roundabout option. The initial idea had been found on this page. The result based on it: 1. SNARF [ Download ] 2. Open SNARF.EXE in a text editor in text mode (not hex), find snarf000.bmp and replace it for s:scn000.bin 3. Create a batch file, S.BAT for example, where besides a string for starting SNARF.EXE will be a command assigning the path to the folder screenshots will be saved into to a virtual drive S: The folder and path may be any: C:\SOFT\SNARF.EXE SUBST S: C:\SCREENS\ 4. Start SNARF: S [or S.BAT] 5. To take a screenshot: Alt + S There will be two beeps. The first at the beginning and the second one as a sign the process has completed successfully. After the screenshots are taken, go to the folder where they are saved in and replace the file extensions from .BIN to .BMP SNARF - Freeware.

HTTPS to HTTP redirect for a single page


Redirecting a single page with HTTPS to the page with HTTP. Server configuration: Apache + nginx. SSL is enabled for the whole web site, so all pages are served with HTTPS. But there is a need to make just one single page to be with HTTP. Directives for .htaccess file: RewriteEngine On RewriteCond %{HTTP:HTTPS} on [NV] RewriteRule ^(page\.html)$ http://%{HTTP_HOST}/$1 [R=301,L,QSA] HTTPS to HTTP redirect for a single page in detail -- Enable runtime rewriting engine RewriteEngine On -- If HTTPS is present RewriteCond %{HTTP:HTTPS} on [NV] -- Then, when a page name and extension correspond to the search group in parentheses, form for it a URI with HTTP RewriteRule ^(page\.html)$ http://%{HTTP_HOST}/$1 [R=301,L,QSA] Notes RewriteCond %{HTTP:HTTPS} on [NV] is not the only way to detect if HTTPS is present. Moreover, for some server configurations other directives may be more suitable, like RewriteCond %{SERVER_PORT} 443 for example. The point is to find out somehow if HTTPS is on. So it should probably be checked by practice what is going to work in a particular case. QSA is used to keep the existing query string, if there is any, when the replacement URI also contains a query string. So that in the end both query strings are to be combined. More on the subject: http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_qsa