Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: App to move mail between imap servers?

  1. #1
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default App to move mail between imap servers?

    Hi,

    I'd like to know if there is an application capable of moving/copying
    emails between two imap servers, preferable if scriptable.

    Like: move emails from server1, such account, such folder, to server2,
    such account, such folder.

    I want it to move emails from my laptop dovecot local server to my
    desktop when I get back there, keeping track of which emails I read
    already, which I marked, etc.


    It is possible to do it with a mail client like Alpine or Thunderbird,
    but I have to do it folder by folder, and I may have two dozens or more.
    Thus the scripting thing I ask.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  2. #2
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,109

    Default Re: App to move mail between imap servers?

    On Mon, 17 Dec 2012 12:14:09 +0000, Carlos E. R. wrote:

    > Hi,
    >
    > I'd like to know if there is an application capable of moving/copying
    > emails between two imap servers, preferable if scriptable.


    Fetchmail might be able to accomplish this.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  3. #3
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,965
    Blog Entries
    1

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: App to move mail between imap servers?

    On 2012-12-17 17:54, Jim Henderson wrote:
    > On Mon, 17 Dec 2012 12:14:09 +0000, Carlos E. R. wrote:
    >
    >> Hi,
    >>
    >> I'd like to know if there is an application capable of moving/copying
    >> emails between two imap servers, preferable if scriptable.

    >
    > Fetchmail might be able to accomplish this.


    Nope, I use it, it doesn't keep flags, nor move emails from one account
    to other. It does read emails, yes, then pushes them to MTA or procmail.
    All those emails appear as new, state is not copied across.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: App to move mail between imap servers?

    On 2012-12-17 23:46, deano ferrari wrote:
    >
    > Will these do?
    >
    > 'IMAP Move - An email migration script'
    > (http://edoceo.com/creo/imap-move)
    >
    > 'Migrating your IMAP mail? Here’s how! - ThinkOvi! –
    > Website transfer and Server migration services'
    > (http://www.thinkovi.com/migrating-yo...ail-heres-how/)


    I'll have a read, thanks.
    [...]

    It looks promising! I'll try it when I get back home.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  6. #6
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,109

    Default Re: App to move mail between imap servers?

    On Tue, 18 Dec 2012 00:44:10 +0000, Carlos E. R. wrote:

    > On 2012-12-17 17:54, Jim Henderson wrote:
    >> On Mon, 17 Dec 2012 12:14:09 +0000, Carlos E. R. wrote:
    >>
    >>> Hi,
    >>>
    >>> I'd like to know if there is an application capable of moving/copying
    >>> emails between two imap servers, preferable if scriptable.

    >>
    >> Fetchmail might be able to accomplish this.

    >
    > Nope, I use it, it doesn't keep flags, nor move emails from one account
    > to other. It does read emails, yes, then pushes them to MTA or procmail.
    > All those emails appear as new, state is not copied across.


    I use it too, but only to pull mail from a few servers for archival
    purposes. I saw an update recently and thought that might have added
    some functionality.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

  7. #7
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,021
    Blog Entries
    2

    Default Re: App to move mail between imap servers?

    Although I haven't tried it, I would expect a simple backup/restore with perhaps a forklift migration twist should work paricularly if you plan on implementing the same Server mailserver application.

    Should preserve all the data attributes and associated metadata.

    An alternative which might be possible is to deploy a new mailserver on your target machine sharing the same network security as your original mailserver, often mailserver apps support data migration easily, maybe in that case a straight forklift.

    TSU

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: App to move mail between imap servers?

    On 2012-12-25 17:36, tsu2 wrote:
    >
    > Although I haven't tried it, I would expect a simple backup/restore with
    > perhaps a forklift migration twist should work paricularly if you plan
    > on implementing the same Server mailserver application.


    file backup restore? No, in my case it will not serve. See later.
    forklift I do not understand (I know what the machine is, but not in
    this context). :-?

    > Should preserve all the data attributes and associated metadata.
    >
    > An alternative which might be possible is to deploy a new mailserver on
    > your target machine sharing the same network security as your original
    > mailserver, often mailserver apps support data migration easily, maybe
    > in that case a straight forklift.


    I'll explain what I have.

    I have a desktop with dovecot, which is the important application for
    this problem. There is also postfix, amavis, spamd... but they are not
    relevant.

    I have a laptop with dovecot, and the same auxiliary programs as the
    desktop except amavis, which for me is not really necesary for the few
    bad things that manage to crawl in.

    I use the laptop when away from home, and I want to structure
    my mail folders in the same way, and when I get back, to push
    those emails to the desktop in the same folders as in the laptop.

    The mail is retrieved from the outside (both machines) with fetchmail,
    which delivers to postfix and this to procmail. As the procmail recipes
    are the same on both machines, the folder structure that gets created
    when I use the laptop is the same as in the desktop machine. The laptop
    structure is basically empty when I start.

    There is also a subfolder of ~/Mail that contains a partial copy of the
    important folders of the desktop machine. This is so that I can read
    older emails. This is a file by file copy made with 'mc'. This folder
    has to be ignored when the new email is moved back to the desktop.


    The idea is that when I get back home I want to copy the new emails back
    to the desktop to the same named folders. It has to be made by a program
    that knows about imap, so that a message is copied with the same flags
    (specially "read"). This I can do with thunderbird or Pine, but it is
    tedious, I have to do it folder by folder, one by one.


    It is possible that "imap-move.php" that deano_ferrari pointed to works,
    I'll learn when I get back and try.

    I'm not aware if the dovecot package has something to move mails across
    servers. :-?


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,021
    Blog Entries
    2

    Default Re: App to move mail between imap servers?

    Fundamentally IMAP is a mail protocol which doesn't require storing messages on the Client, it only downloads <copies> of messages on demand, always leaving an original on the Server. It's one of the main things that differentiate IMAP from POP.

    For that reason, regardless what mailserver components like dovecot you may have installed on your client machine, the primary issue is where is your designated "main mailserver," likely the machine your MX records point to. <That> machine should have the main and original copy of any messages any of your clients retrieve messages from. If somehow you also have copies of messages on your client machine(s), that should be unimportant and if you wish to retrieve, duplicate or migrate mail data, it should be done by way of your main mailserver, hardly ever by way of the data on your client.

    Since your laptop is a "traveling" portable machine, it's highly unlikely it's your main mailserver (unless you have a DNS redirector configured, but even that is not optimal if your machine isn't always connected to the Internet although I suppose caching SmartSMTP Servers could enter the picture).

    "Forklift" is a standard procedure for migrating databases in general, usually not the preferred method because it means simply copying the data store from one machine to another. The problem is, accessing the data usually is complex and requires proper application configuration, getting your security identities/hashes properly set at various levels, eg application, user, objects. Because manually re-creating these configurations can be difficult and time-consuming, it's usually easier to setup a new database application instance using same security and permissions as the original, then executing an authorized file transfer. Much simpler, far less problems if it can be done. Fork lifts sometimes have to be done if the machine has crashed, no working backup is available and the only thing you can do is recover the disk data.

    TSU

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: App to move mail between imap servers?

    On 2012-12-27 00:46, tsu2 wrote:
    >
    > Fundamentally IMAP is a mail protocol which doesn't require storing
    > messages on the Client, it only downloads <copies> of messages on
    > demand, always leaving an original on the Server. It's one of the main
    > things that differentiate IMAP from POP.
    >
    > For that reason, regardless what mailserver components like dovecot you
    > may have installed on your client machine, the primary issue is where is
    > your designated "main mailserver," likely the machine your MX records
    > point to. <That> machine should have the main and original copy of any
    > messages any of your clients retrieve messages from. If somehow you also
    > have copies of messages on your client machine(s), that should be
    > unimportant and if you wish to retrieve, duplicate or migrate mail data,
    > it should be done by way of your main mailserver, hardly ever by way of
    > the data on your client.


    Your description is generally correct, but does not apply to my setup. I
    have two main mailserver, not one. When I'm at home, my desktop is the
    main one. When I'm on the move, it is the laptop. When I get back home,
    I have to move the emails from the laptop to the desktop (which is
    powered up only when I'm present there).

    Using the desktop remotely as mail server is not feasible, for two
    reasons: my mobile Internet connection is limited to 500MB/month, and I
    do not like to leave it powered up and unattended.

    I do not use a local imap server to act as a central storage to other
    machines (which I can), but to act as storage to different MUAs on the
    same machine as the storage. Ie, to be able to read emails in Pine and
    Thunderbird sharing the same folders and flags.

    When at home I can, of course, read email in the laptop using the
    desktop machine as storage.


    > "Forklift" is a standard procedure for migrating databases in general,


    ....

    Ah, I see. That's what I do sometimes with an mysql database between the
    desktop and the laptop.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •