ImapCopy or fast way to migrate mail between servers

The following guide describes the installation very simple program which is ImapCopy through which we will migrate mail from one server to another.

Let's get started is extremely simple.


Installation ImapCopy
ImapCopy is available in the repository of Debian / ubuntu. Its installation is simple and comes down to one issue the command:

sudo apt-get install imapcopy 

Configuration

Click the configuration can be found in the directory:

/usr/share/doc/imapcopy/examples

Edit the file named:ImapCopy.cfg

nano /usr/share/doc/imapcopy/examples/ImapCopy.cfg

Edit the file as follows:

#############################################################
# imapcopy config
# all lines beginning with # are comments and will be ignored
#############################################################

##############
# Sourceserver
##############
SourceServer serwer.nazwa.pl
SourcePort 143

###################
# Destinationserver
###################
DestServer ip-serwera gdzoe ma zostać przeniesiona poczta.
DestPort 143

We go to the bottom of the file and configure the box to transfer.

#############################
# List of users and passwords
#############################
#       SourceUser    SourcePassword   DestinationUser DestinationPassword
Copy    "pomoc@serwerweb.pl"         "hasło_na_starym_serwerze"       "pomoc@serwerweb.pl"           "hasło_na_nowym_serwerze"

In order to test if everything is well configured to run the program in the directory where imapcopy signed our configuration file.

imapcopy -t 

the script will run and check the availability and correctness of the data to log.
that we begin to migrate mailbox command:

imapcopy

The problem with SSL - stunel
The problem occurs when we want to copy the e-mails with SSL encryption / TLS. The solution to this problem is to tunneling traffic from ports

We install and run two commands in separate console. So to work all the time during our copy emails.

Install the required packages:

sudo apt-get install stunnel 
Uruchamiamy dwa terminale i wykonujemy polecenia:

stunnel -c -f -d 1143 -r imap.foo.tld:993 -P
stunnel -c -f -d 1144 -r imap.bar.tld:993 -P

After running the above commands in separate terminals you need to update our configuration file imapcopy.cfg.

SourceServer 127.0.0.1
SourcePort 1143

DestServer 127.0.0.1
DestPort 1144

It sets out the source and destination servers were on our localhost. Thanks to which all traffic is redirected from stunnel address 127.0.0.1:1143 address imap.source.net:993 after already establishing an encrypted connection.

Linux

Zobacz komentarze

Udostępnij
Opublikowane przez
Linux

Recent posts

KeePass2 2.52 w Ubuntu 22.04

The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń

2 years temu

Installing Master PDF editor in Ubuntu 22.04

Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji

2 years temu

iotop - memory monitoring

Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w

2 years temu

Run multiple commands in one cron job

You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania

2 years temu

Changing the exif data of a photo in the Linux terminal

Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.

2 years temu

Installing Rocket.Chat Server on Rocky Linux 8

The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy

2 years temu