wget http://www.linux-france.org/prj/pop2imap/dist/pop2imap-1.27.tgz

tar zxvf pop2imap-1.27.tgz

cd pop2imap-1.27/


You need : 
- Perl 
  try : perl -v
  try : perl -c pop2imap

- Mail::IMAPClient module 
  try : perl -mMail::IMAPClient -e ''

- Mail::POP3Client module 
  try : perl -mMail::POP3Client -e ''

- Email::Simple module
  try : perl -mEmail::Simple -e ''

- Date::Manip module 
  try : perl -mDate::Manip -e ''

- IO::Socket::SSL  module (optional needed with --ssl1 or --ssl2)
  try : perl -mIO::Socket::SSL -e ''

Any software packager should add all the perl modules dependencies by default
since users can use any option (--ssl*).


yum -y install \
perl-Mail-POP3Client.noarch \
perl-Mail-IMAPClient.noarch \
perl-Mail-POP3Client.noarch \
perl-Date-Manip.noarch \


make install  # /usr/bin/pop2imap にインストールされる


pop2imap --help

usage: /usr/bin/pop2imap [options]

Several options are mandatory. See the example below.

--from        <string> : parsed as <user1>@<host1>[:<port1>]
--host1       <string> : "from" POP server. Mandatory.
--port1       <int>    : port to connect. Default is 110 (ssl:995).
--user1       <string> : user to login.   Mandatory.
--password1   <string> : password for the user1. Dangerous, use --passfile1
--passfile1   <string> : password file for the user1. Contains the password.
--ssl1                 : enable ssl on POP connect
--to          <string> : parsed as <user2>@<host2>[:<port2>][/<folder>]
--host2       <string> : "destination" IMAP server. Mandatory.
--port2       <int>    : port to connect. Default is 143 (ssl:993).
--user2       <string> : user to login.   Mandatory.
--password2   <string> : password for the user2. Dangerous, use --passfile2
--passfile2   <string> : password file for the user2. Contains the password.
--ssl2                 : enable ssl on IMAP connect
--starttls2            : use starttls on IMAP connect instead of SSL
--timeout2    <int>    : Connections timeout in seconds. Default is 240.
--folder      <string> : sync to this IMAP folder.
--delete               : delete messages in "from" POP server after
                         a successful transfer. useful in case you
                         want to migrate from one server to another one.
                         They are really deleted when a QUIT command
                         is send.
--idatefromheader      : sets the internal dates on host2 same as the 
                         "Date:" headers from host1. Turned on by default.
--dry                  : do nothing, just print what would be done.
--debug                : debug mode.
--debugimap            : IMAP debug mode.
--debugpop             : POP debug mode.
--tests                : Run non-regression tests
--quiet                : Only print error messages
--version              : print sotfware version.
--help                 : print this message.

Example: to synchronise pop  account "foo" on "pop3.truc.org"
                     to imap account "bar" on "imap.trac.org"

/usr/bin/pop2imap \
   --host1 pop3.troc.org --user1 foo --passfile1 /etc/secret1 \
   --host2 imap.trac.org --user2 bar --passfile2 /etc/secret2

Branched by Phil Carmody <phil.carmody@partner.samsung.com> from:
 $Id: pop2imap,v 1.27 2015/11/03 23:34:02 gilles Exp gilles $ 
      pop2imap copyleft is the GNU General Public License.


pop2imap --host1 移行元サーバー --user1 移行元ユーザー名 --password1 移行元パスワード --host2 移行先サーバー --user2 移行先ユーザー名 --password2 移行先パスワード -ssl2(IMAPSで接続)


history -c