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

 

Arachne web browser. Installing and setting up for dial-up internet connection

 

A : Installing Arachne web browser on a disk created in RAM - Arachne runs the fastest this way. RAM size should allow for a RAM disk of 6 MB or more. In order to install and set up Arachne web browser for dial-up internet connection, there have to be several programs at hand: 1. Arachne web browser [ Download ] 2. If Arachne web browser is to be used for surfing web pages with character encoding other than Latin for West European languages, visit www.glennmcc.org/apm/ to find available character set packages and download the necessary one. 3. Mouse driver, mouse.com for instance [ Download ] 4. Archivers. For example, PKZIP [ Download ] and PKUNZIP [ Download ] 5. If it is not MS-DOS 6.0+ to be used, QEMM97 [ Download ] 6. If it is not MS-DOS 6.0+ to be used, TDSK [ Download ] Installing and setting up Arachne web browser, step by step: 1. Create a RAM disk. Which drive letter will be assigned to it comes from the assumption that A: and B: go to floppy drives (even if there is only one, both letters will be reserved anyway), C: goes to the first active primary MS-DOS partition on the first physical hard disk. If there are more disks, then there will be as many letters used consecutively as to name them all. Unless there are no devices installed using DRIVER.SYS or similar drivers, the next drive letter will be assigned to the RAM disk. In order to be sure, after having the relevant string for making RAM disk added to CONFIG.SYS (See below), computer could be restarted and what letter is assigned to the RAM disk checked by experiment. In this case, it is E: Depending on RAM size it needs to be decided how many megabytes can be reserved for RAM disk. Basically, the more the better. Since, for instance, web browser cache is going to swell during prolonged and intensive use within a session. In this example the RAM disk is 12 000 KB. The maximum size for RAMDRIVE.SYS MS-DOS driver is 32 767 KB, the one of TDSK - 64 MB. In order to create such a disk, the string has to be added somewhere in the middle of CONFIG.SYS as follows: DEVICE=C:\DOS\RAMDRIVE.SYS 12000 512 512 /E 2. Create a folder, for example C:\DRIVERS\. Put there a mouse driver, for instance mouse.com 3. Add a string starting mouse driver to AUTOEXEC.BAT. Specify there the full path to the driver, may be any: LH C:\DRIVERS\MOUSE.COM 4. Run MemMaker or OPTIMIZE from QEMM97 to optimize base memory management. If it is MemMaker, press Enter at any suggestion - MemMaker will handle it itself. Computer is going to restart several times, each time MemMaker will be re-running - again nothing, just Enter, is a safe choice. If it is QEMM97 (specifically OPTIMIZE), then there is going to be several restarts too and each time just pressing Enter is OK. 5. Start installation of Arachne web browser on RAM disk. In the case discussed it is E: A195GPL.EXE Press Y to continue: Press N to specify the path to the folder Arachne web browser is to be installed in: Specify the path to the folder Arachne web browser is to be installed in. In the case discussed it is E:\ARACHNE\.

HTTP to HTTPS redirect in .htaccess

 

Redirecting from HTTP to HTTPS, when the web server serving the pages is behind a load balancer or reverse proxy. Server configuration: Apache + nginx; SSL is enabled; SSL-certificate is purchased, approved and installed. That is, everything is up and running. So it is just the HTTP to HTTPS redirection that is left to get ready and start up. Directives for .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{HTTP:X_FORWARDED_PROTO} !https [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] HTTP to HTTPS redirect -- Enable runtime rewriting engine: RewriteEngine On -- If domain name has no www: RewriteCond %{HTTP_HOST} !^www\. [NC] -- Then replace it with domain with www: RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] -- If HTTPS is not present: RewriteCond %{HTTP:X_FORWARDED_PROTO} !https [NC] -- Then replace domain without HTTPS with domain with HTTPS: RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] Notes 1. X_FORWARDED_PROTO may instead be called X-Forwarded-Proto or even else. The point is to obtain the information from a load balancer or reverse proxy on the original request it gets. Load balancers or reverse proxies may provide the web server with this info and a header named X_FORWARDED_PROTO or X-Forwarded-Proto or else may be sent, holding the protocol string. It is most often so, but not always. So it should probably be determined by practice how to get the protocol string in a particular case. 2. The other way is just to set the environment variable (if it is suitable for the given web server): SetEnvIf X_FORWARDED_PROTO https HTTPS=on Then directives for .htaccess file are to be like this: RewriteEngine On SetEnvIf X_FORWARDED_PROTO https HTTPS=on RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteCond %{HTTP:HTTPS} !on [NV] RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] 3. Apache Module mod_rewrite docs: http://httpd.apache.org/docs/current/mod/mod_rewrite.html