{"id":13473683,"url":"https://github.com/imapsync/imapsync","last_synced_at":"2025-05-13T21:09:04.115Z","repository":{"id":37492946,"uuid":"1422820","full_name":"imapsync/imapsync","owner":"imapsync","description":"Imapsync is an IMAP transfers tool. The purpose of imapsync is to migrate IMAP accounts or to backup IMAP accounts. IMAP is one of the three current standard protocols to access mailboxes, the two others are POP3 and HTTP with webmails, webmails are often tied to an IMAP server. Upstream website is ","archived":false,"fork":false,"pushed_at":"2025-01-21T15:34:02.000Z","size":15413,"stargazers_count":3570,"open_issues_count":182,"forks_count":487,"subscribers_count":86,"default_branch":"master","last_synced_at":"2025-04-09T19:10:48.633Z","etag":null,"topics":["emails","imap","imaps","imapsync","mailbox","migration","perl"],"latest_commit_sha":null,"homepage":"http://imapsync.lamiral.info","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imapsync.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["gilleslamiral"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2011-02-28T19:21:40.000Z","updated_at":"2025-04-09T09:42:50.000Z","dependencies_parsed_at":"2022-07-13T18:21:03.205Z","dependency_job_id":"167d6c75-5cb4-402b-8b91-1ed3bf8885dd","html_url":"https://github.com/imapsync/imapsync","commit_stats":{"total_commits":284,"total_committers":32,"mean_commits":8.875,"dds":0.3098591549295775,"last_synced_commit":"c6d3925c68088c27ceb1cb66ed509d578408e870"},"previous_names":[],"tags_count":201,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imapsync%2Fimapsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imapsync%2Fimapsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imapsync%2Fimapsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imapsync%2Fimapsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imapsync","download_url":"https://codeload.github.com/imapsync/imapsync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251325905,"owners_count":21571622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emails","imap","imaps","imapsync","mailbox","migration","perl"],"created_at":"2024-07-31T16:01:05.969Z","updated_at":"2025-04-28T13:58:53.014Z","avatar_url":"https://github.com/imapsync.png","language":"Shell","readme":"NAME\n\n    imapsync - Email IMAP tool for syncing, copying, migrating and archiving\n    email mailboxes between two imap servers, one way, and without\n    duplicates.\n\nVERSION\n\n    This documentation refers to Imapsync $Revision: 2.229 $\n\nUSAGE\n\n     To synchronize the source imap account\n       \"test1\" on server \"test1.lamiral.info\" with password \"secret1\"\n     to the destination imap account\n       \"test2\" on server \"test2.lamiral.info\" with password \"secret2\"\n     do:\n\n      imapsync \\\n       --host1 test1.lamiral.info --user1 test1 --password1 secret1 \\\n       --host2 test2.lamiral.info --user2 test2 --password2 secret2\n\nDESCRIPTION\n\n    We sometimes need to transfer mailboxes from one imap server to one\n    another.\n\n    Imapsync command is a tool allowing incremental and recursive imap\n    transfers from one mailbox to another. If you don't understand the\n    previous sentence, it's normal, it's pedantic computer-oriented jargon.\n\n    All folders are transferred, recursively, meaning the whole folder\n    hierarchy is taken, all messages in them, and all message flags (\\Seen\n    \\Answered \\Flagged etc.) are synced too.\n\n    Imapsync reduces the amount of data transferred by not transferring a\n    given message if it already resides on the destination side. Messages\n    that are on the destination side but not on the source side stay as they\n    are. See the --delete2 option to have strict sync and delete them.\n\n    How does imapsync know a message is already on both sides? Same specific\n    headers and the transfer is done only once. By default, the\n    identification headers are \"Message-Id:\" and \"Received:\" lines but this\n    choice can be changed with the --useheader option, most often a\n    duplicate problem is solved by using --useheader \"Message-Id\"\n\n    All flags are preserved, unread messages will stay unread, read ones\n    will stay read, deleted will stay deleted. In the IMAP protocol, a\n    deleted message is not deleted, it is marked \\Deleted and can be\n    undeleted. Real destruction comes with the EXPUNGE or UIDEXPUNGE IMAP\n    commands.\n\n    You can abort the transfer at any time and restart it later, imapsync\n    works well with bad connections and interruptions, by design. On a\n    terminal hit Ctr-c twice within two seconds to abort the program. Hit\n    Ctr-c just once makes imapsync reconnect to both imap servers.\n\n    How do you know the sync is finished and well done? When imapsync ends\n    by itself it mentions it with lines like those:\n\n      Exiting with return value 0 (EX_OK: successful termination) 0/50 nb_errors/max_errors PID 301\n      Removing pidfile /tmp/imapsync.pid\n      Log file is LOG_imapsync/2020_11_17_15_59_22_761_test1_test2.txt ( to change it, use --logfile filepath ; or use --nolog to turn off logging )\n\n    If you don't have those lines it means that either the sync process is\n    still running (or eventually hanging indefinitely) or that it ended\n    without a whisper, a strong kill -9 on Linux for example.\n\n    If you have those final lines then it means the sync process is properly\n    finished. It may have encountered problems though.\n\n    A good synchronization is mentioned by some lines above the last ones,\n    especially those three lines:\n\n      The sync looks good, all 1745 identified messages in host1 are on host2.\n      There is no unidentified message on host1.\n      Detected 0 errors\n\n    Imapsync mentions the total sizes of both accounts at the beginning of\n    the sync and also at the end. Sometimes, even with a strict sync, those\n    total sizes differ, and sometimes they differ a lot. The difference is\n    not a good criterion to conclude the sync went wrong.\n\n    Why? That's because message sizes given by the imap servers are not\n    always accurate, they are not always the same as the actual message\n    sizes of the messages transferred by imapsync. Imapsync use the sizes\n    given by the imap servers to calculate the big total size. They can\n    differ. In the early days, Imapsync used the sizes of the messages as\n    one of the criteria to identify the messages, different sizes implied\n    different messages; but it was a mistake, the same message had different\n    sizes on both sides sometimes, depending on the imap servers.\n\n    Another explanation for a big total size difference is that Gmail\n    doesn't count the size of duplicate messages across folders twice, while\n    imapsync does.\n\n    A classical scenario is synchronizing a mailbox B from another mailbox A\n    where you just want to keep a strict copy of A in B. Strict meaning all\n    messages in A will be in B but no more.\n\n    For a strict synchronization, use the option --delete2. The option\n    --delete2 deletes the messages in the host2 folder B that are not in the\n    host1 folder A. If you also need to destroy host2 folders that are not\n    in host1 then use --delete2folders. See also --delete2foldersonly and\n    --delete2foldersbutnot to set up exceptions on folders to destroy. INBOX\n    will never be destroyed, it's a mandatory folder in IMAP so imapsync\n    doesn't even try to remove it.\n\n    A different scenario is to delete the messages from the source mailbox\n    after a successful transfer, it can be a good feature when migrating\n    mailboxes since messages will be only on one side. The source account\n    will only have messages that are not on the destination yet, ie,\n    messages that arrived after a sync or that failed to be transferred.\n\n    In that case, use the --delete1 option. Option --delete1 implies also\n    the option --expunge1 so all messages marked deleted on host1 will be\n    deleted. In IMAP protocol deleting a message does not delete it, it\n    marks it with the flag \\Deleted, allowing an undelete. Expunging a\n    folder removes, definitively, all the messages marked as \\Deleted in\n    this folder.\n\n    You can also decide to remove empty folders once all of their messages\n    have been transferred. Add --delete1emptyfolders to obtain this\n    behavior.\n\n    Imapsync is not adequate for maintaining two active imap accounts in\n    synchronization when the user plays independently on both sides. Use\n    offlineimap (written by John Goerzen) or mbsync (written by Michael R.\n    Elkins) for a 2 ways synchronization.\n\nOPTIONS\n\n     usage: imapsync [options]\n\n    The standard options are the six values forming the credentials. Three\n    values on each side are needed to login into the IMAP servers. These six\n    values are a hostname, a username, and a password, two times.\n\n    Here are the conventions used in the following descriptions of the\n    options:\n\n     str means a string\n     int means an integer number\n     flo means a float number\n     reg means a regular expression\n     cmd means a command\n\n     --dry               : Makes imapsync do nothing for real; it just prints what\n                           would be done without --dry.\n\n  OPTIONS/credentials\n\n     --host1        str  : Source or \"from\" imap server.\n     --port1        int  : Port to connect on host1.\n                           Optional since default ports are the\n                           well known ports imap/143 or imaps/993.\n     --user1        str  : User to login on host1.\n     --password1    str  : Password of user1.\n\n     --host2        str  : \"destination\" imap server.\n     --port2        int  : Port to connect on host2. Optional\n     --user2        str  : User to login on host2.\n     --password2    str  : Password of user2.\n\n     --showpasswords     : Shows passwords on output instead of \"MASKED\".\n                           Useful to restart a complete run by just reading\n                           the command line used in the log,\n                           or to debug passwords.\n                           It's not a secure practice at all!\n\n     --passfile1    str  : Password file for the user1. It must contain the\n                           password on the first line. This option avoids showing\n                           the password on the command line like --password1 does.\n     --passfile2    str  : Password file for the user2.\n\n    You can also pass the passwords in the environment variables\n    IMAPSYNC_PASSWORD1 and IMAPSYNC_PASSWORD2. If you don't pass the user1\n    password via --password1 nor --passfile1 nor $IMAPSYNC_PASSWORD1 then\n    imapsync will prompt to enter the password on the terminal. Same thing\n    for user2 password.\n\n  OPTIONS/encryption\n\n     --nossl1            : Do not use a SSL connection on host1.\n     --ssl1              : Use a SSL connection on host1. On by default if possible.\n\n     --nossl2            : Do not use a SSL connection on host2.\n     --ssl2              : Use a SSL connection on host2. On by default if possible.\n\n     --notls1            : Do not use a TLS connection on host1.\n     --tls1              : Use a TLS connection on host1. On by default if possible.\n\n     --notls2            : Do not use a TLS connection on host2.\n     --tls2              : Use a TLS connection on host2. On by default if possible.\n\n     --debugssl     int  : SSL debug mode from 0 to 4.\n\n     --sslargs1     str  : Pass any ssl parameter for host1 ssl or tls connection. Example:\n                           --sslargs1 SSL_verify_mode=1 --sslargs1 SSL_version=SSLv3\n                           See all possibilities in the new() method of IO::Socket::SSL\n                           http://search.cpan.org/perldoc?IO::Socket::SSL#Description_Of_Methods\n     --sslargs2     str  : Pass any ssl parameter for host2 ssl or tls connection.\n                           See --sslargs1\n\n  OPTIONS/authentication\n\n     --authmech1    str  : Auth mechanism to use with host1:\n                           PLAIN, LOGIN, CRAM-MD5 etc. Use UPPERCASE.\n     --authmech2    str  : Auth mechanism to use with host2. See --authmech1\n\n     --authuser1    str  : User to auth with on host1 (admin user).\n                           Avoid using --authmech1 SOMETHING with --authuser1.\n     --authuser2    str  : User to auth with on host2 (admin user).\n     --proxyauth1        : Use proxyauth on host1. Requires --authuser1.\n                           Required by Sun/iPlanet/Netscape IMAP servers to\n                           be able to use an administrative user.\n     --proxyauth2        : Use proxyauth on host2. Requires --authuser2.\n\n     --authmd51          : Use MD5 authentication for host1.\n     --authmd52          : Use MD5 authentication for host2.\n     --domain1      str  : Domain on host1 (NTLM authentication).\n     --domain2      str  : Domain on host2 (NTLM authentication).\n\n     --oauthaccesstoken1 str : The access token to authenticate with OAUTH2.\n                           It will be combined with the --user1 value to form the \n                           string to pass with XOAUTH2 authentication.\n                           The password given by --password1 or --passfile1\n                           is ignored but needed on the command line.\n                           Instead of the access token itself, the value can be a\n                           file containing the access token on the first line.\n                           If the value is a file, imapsync reads its first line\n                           and take this line as the access token. The advantage\n                           of the file is that if the access token changes then\n                           imapsync can read it again when it needs to reconnect \n                           during a run.\n\n\n     --oauthaccesstoken2 str : same thing as --oauthaccesstoken1 \n\n     --oauthdirect1 str  : The direct string to pass with XOAUTH2 authentication.\n                           The password given by --password1 or --passfile1 and \n                           the user given by --user1 are ignored but they are \n                           needed to be on the command line. Consider it a bug.\n\n     --oauthdirect2 str  : same thing as oauthdirect1\n\n  OPTIONS/folders\n\n     --folder       str  : Sync this folder.\n     --folder       str  : and this one, etc.\n     --folderrec    str  : Sync this folder recursively.\n     --folderrec    str  : and this one, etc.\n\n     --folderfirst  str  : Sync this folder first. Ex. --folderfirst \"INBOX\"\n     --folderfirst  str  : then this one, etc.\n     --folderlast   str  : Sync this folder last. --folderlast \"[Gmail]/All Mail\"\n     --folderlast   str  : then this one, etc.\n\n     --nomixfolders      : Do not merge folders when host1 is case-sensitive\n                           while host2 is not (like Exchange). Only the first\n                           similar folder is synced. Example: with folders\n                           \"Sent\", \"SENT\" and \"sent\" on host1, only \"Sent\"\n                           will be synced to host2.\n\n     --skipemptyfolders  : Empty host1 folders are not created on host2.\n\n     --include      reg  : Sync folders matching this regular expression\n     --include      reg  : or this one, etc.\n                           If both --include --exclude options are used, then\n                           include is done before.\n     --exclude      reg  : Skips folders matching this regular expression\n                           Several folders to avoid:\n                            --exclude 'fold1|fold2|f3' skips fold1, fold2 and f3.\n     --exclude      reg  : or this one, etc.\n\n     --automap           : guesses folders mapping, for folders well known as\n                           \"Sent\", \"Junk\", \"Drafts\", \"All\", \"Archive\", \"Flagged\".\n\n     --f1f2    str1=str2 : Force folder str1 to be synced to str2,\n                           --f1f2 overrides --automap and --regextrans2.\n                           Use several --f1f2 options to map several folders.\n                           Option --f1f2 is a one to one only folder mapping,\n                           str1 and str2 have to be full path folder names.\n\n     --subfolder2   str  : Syncs the whole host1 folders hierarchy under the\n                           host2 folder named str.\n                           It does it internally by adding three\n                           --regextrans2 options before all others.\n                           Add --debug to see what's really going on.\n\n     --subfolder1   str  : Syncs the host1 folders hierarchy which is under folder\n                           str to the root hierarchy of host2.\n                           It's the counterpart of a sync done by --subfolder2\n                           when doing it in the reverse order.\n                           Backup/Restore scenario:\n                           Use --subfolder2 str for a backup to the folder str\n                           on host2. Then use --subfolder1 str for restoring\n                           from the folder str, after inverting\n                           host1/host2 user1/user2 values.\n\n\n     --subscribed        : Transfers subscribed folders.\n     --subscribe         : Subscribe to the folders transferred on the\n                           host2 that are subscribed on host1. On by default.\n     --subscribeall      : Subscribe to the folders transferred on the\n                           host2 even if they are not subscribed on host1.\n\n     --prefix1      str  : Remove prefix str to all destination folders,\n                           usually \"INBOX.\" or \"INBOX/\" or an empty string \"\".\n                           imapsync guesses the prefix if host1 imap server\n                           does not have NAMESPACE capability. So this option\n                           should not be used most of the time.\n     --prefix2      str  : Add prefix to all host2 folders. See --prefix1\n\n     --sep1         str  : Host1 separator. This option should not be used\n                           most of the time.\n                           Imapsync gets the separator from the server itself,\n                           by using NAMESPACE, or it tries to guess it\n                           from the folders listing (it counts\n                           characters / . \\\\ \\ in folder names and choose the\n                           more frequent, or finally / if nothing is found.\n     --sep2         str  : Host2 separator. See --sep1\n\n     --regextrans2  reg  : Apply the whole regex to each destination folders.\n     --regextrans2  reg  : and this one. etc.\n                           When you play with the --regextrans2 option, first\n                           add also the safe options --dry --justfolders\n                           Then, when happy, remove --dry for a run, then\n                           remove --justfolders for the next ones.\n                           Have in mind that --regextrans2 is applied after\n                           the automatic prefix and separator inversion.\n                           For examples see:\n                           https://imapsync.lamiral.info/FAQ.d/FAQ.Folders_Mapping.txt\n\n  OPTIONS/folders sizes\n\n     --nofoldersizes     : Do not calculate the size of each folder at the\n                           beginning of the sync. Default is to calculate them.\n     --nofoldersizesatend: Do not calculate the size of each folder at the\n                           end of the sync. Default is to calculate them.\n     --justfoldersizes   : Exit after having printed the initial folder sizes.\n\n  OPTIONS/tmp\n\n     --tmpdir       str  : Where to store temporary files and subdirectories.\n                           Will be created if it doesn't exist.\n                           Default is system specific, Unix is /tmp but\n                           /tmp is often too small and deleted at reboot.\n                           --tmpdir /var/tmp should be better.\n\n     --pidfile      str  : The file where imapsync pid is written,\n                           it can be dirname/filename complete path.\n                           The default name is imapsync.pid in tmpdir.\n\n     --pidfilelocking    : Abort if pidfile already exists. Useful to avoid\n                           concurrent transfers on the same mailbox.\n\n  OPTIONS/log\n\n     --nolog             : Turn off logging on file\n     --logfile      str  : Change the default log filename (can be dirname/filename).\n     --logdir       str  : Change the default log directory. Default is LOG_imapsync/\n\n    The default logfile name is for example\n\n     LOG_imapsync/2019_12_22_23_57_59_532_user1_user2.txt\n\n    where:\n\n     2019_12_22_23_57_59_532 is nearly the date of the start\n     YYYY_MM_DD_HH_MM_SS_mmm\n     year_month_day_hour_minute_second_millisecond\n\n    and user1 user2 are the --user1 --user2 values.\n\n  OPTIONS/messages\n\n     --skipmess     reg  : Skips messages matching the regex.\n                           Example: 'm/[\\x80-\\xff]/' # to avoid 8bits messages.\n                           --skipmess is applied before --regexmess\n     --skipmess     reg  : or this one, etc.\n\n     --skipcrossduplicates : Avoid copying messages that are already copied\n                             in another folder, good from Gmail to XYZ when\n                             XYZ is not also Gmail.\n                             Activated with --gmail1 unless --noskipcrossduplicates\n\n     --debugcrossduplicates : Prints which messages (UIDs) are skipped with\n                              --skipcrossduplicates and in what other folders\n                              they are.\n\n     --pipemess     cmd  : Apply this cmd command to each message content\n                           before the copy.\n     --pipemess     cmd  : and this one, etc.\n                           With several --pipemess, the output of each cmd\n                           command (STDOUT) is given to the input (STDIN)\n                           of the next command.\n                           For example,\n                           --pipemess cmd1 --pipemess cmd2 --pipemess cmd3\n                           is like a Unix pipe:\n                           \"cat message | cmd1 | cmd2 | cmd3\"\n\n     --disarmreadreceipts : Disarms read receipts (host2 Exchange issue)\n\n     --regexmess    reg  : Apply the whole regex to each message before transfer.\n                           Example: 's/\\000/ /g' # to replace null characters\n                           by spaces.\n     --regexmess    reg  : and this one, etc.\n \n     --truncmess    int  : truncates messages when their size exceed the int \n                           value, specified in bytes. Good to sync too big \n                           messages or to \"suppress\" attachments. \n                           Have in mind that this way, messages become \n                           uncoherent somehow.\n\n  OPTIONS/labels\n\n    Gmail present labels as folders in imap. Imapsync can accelerate the\n    sync by syncing X-GM-LABELS, it will avoid to transfer messages when\n    they are already on host2 in another folder.\n\n     --synclabels        : Syncs also Gmail labels when a message is copied to host2.\n                           Activated by default with --gmail1 --gmail2 unless\n                           --nosynclabels is added.\n\n     --resynclabels      : Resyncs Gmail labels when a message is already on host2.\n                           Activated by default with --gmail1 --gmail2 unless\n                           --noresynclabels is added.\n\n    For Gmail syncs, see also:\n    https://imapsync.lamiral.info/FAQ.d/FAQ.Gmail.txt\n\n  OPTIONS/flags\n\n     If you encounter flag problems see also:\n     https://imapsync.lamiral.info/FAQ.d/FAQ.Flags.txt\n\n     --regexflag    reg  : Apply the whole regex to each flags list.\n                           Example: 's/\"Junk\"//g' # to remove \"Junk\" flag.\n     --regexflag    reg  : then this one, etc.\n\n     --resyncflags       : Resync flags for already transferred messages.\n                           On by default.\n     --noresyncflags     : Do not resync flags for already transferred messages.\n                           May be useful when a user has already started to play\n                           with its host2 account.\n\n     --filterbuggyflags  : Filter flags known to be buggy and generators of errors\n                           \"BAD Invalid system flag\" or \"NO APPEND Invalid flag list\".\n\n  OPTIONS/deletions\n\n     --delete1           : Deletes messages on host1 server after a successful\n                           transfer. Option --delete1 has the following behavior:\n                           it marks messages as deleted with the IMAP flag\n                           \\Deleted, then messages are really deleted with an\n                           EXPUNGE IMAP command. If expunging after each message\n                           slows down too much the sync then use\n                           --noexpungeaftereach to speed up, expunging will then be\n                           done only twice per folder, one at the beginning and\n                           one at the end of a folder sync.\n\n     --expunge1          : Expunge messages on host1 just before syncing a folder.\n                           Expunge is done per folder.\n                           Expunge aims is to really delete messages marked deleted.\n                           An expunge is also done after each message copied\n                           if option --delete1 is set (unless --noexpungeaftereach).\n\n     --noexpunge1        : Do not expunge messages on host1.\n\n     --delete1emptyfolders : Deletes empty folders on host1, INBOX excepted.\n                             Useful with --delete1 since what remains on host1\n                             is only what failed to be synced.\n\n     --delete2           : Delete messages in the host2 account that are not in\n                           the host1 account. Useful for backup or pre-sync.\n                           --delete2 implies --uidexpunge2\n\n     --delete2duplicates : Deletes messages in host2 that are duplicates in host2.\n                           Works only without --useuid since duplicates are\n                           detected with an header part of each message.\n                           NB: --delete2duplicates is far less violent than --delete2\n                           since it removes only duplicates.\n\n     --delete2folders    : Delete folders in host2 that are not in host1.\n                           For safety, first try it like this, it is safe:\n                           --delete2folders --dry --justfolders --nofoldersizes\n                           and see what folders will be deleted.\n\n     --delete2foldersonly   reg : Delete only folders matching the regex reg.\n                                  Example: --delete2foldersonly \"/^Junk$|^INBOX.Junk$/\"\n                                  This option activates --delete2folders\n\n     --delete2foldersbutnot reg : Do not delete folders matching the regex rex.\n                                  Example: --delete2foldersbutnot \"/Tasks$|Contacts$|Foo$/\"\n                                  This option activates --delete2folders\n\n     --noexpunge2        : Do not expunge messages on host2.\n     --nouidexpunge2     : Do not uidexpunge messages on the host2 account\n                           that are not on the host1 account.\n\n  OPTIONS/dates\n\n     If you encounter problems with dates, see also:\n     https://imapsync.lamiral.info/FAQ.d/FAQ.Dates.txt\n\n     --syncinternaldates : Sets the internal dates on host2 as the same as host1.\n                           Turned on by default. Internal date is the date\n                           a message arrived on a host (Unix mtime usually).\n     --idatefromheader   : Sets the internal dates on host2 as same as the\n                           ones in \"Date:\" headers.\n\n  OPTIONS/message selection\n\n     --maxsize      int  : Skip messages larger  (or equal) than  int  bytes\n     --minsize      int  : Skip messages smaller (or equal) than  int  bytes\n\n     --maxage       int  : Skip messages older than  int days.\n                           final stats (skipped) don't count older messages\n                           see also --minage\n     --minage       int  : Skip messages newer than  int  days.\n                           final stats (skipped) don't count newer messages\n                           You can do (+ zone are the messages selected):\n                           past|----maxage+++++++++++++++\u003enow\n                           past|+++++++++++++++minage----\u003enow\n                           past|----maxage+++++minage----\u003enow (intersection)\n                           past|++++minage-----maxage++++\u003enow (union)\n\n     --search       str  : Selects only messages returned by this IMAP SEARCH\n                           command. Applied on both sides.\n                           For a complete set of what can be search see\n                           https://imapsync.lamiral.info/FAQ.d/FAQ.Messages_Selection.txt\n\n     --search1      str  : Same as --search but for selecting host1 messages only.\n     --search2      str  : Same as --search but for selecting host2 messages only.\n                           So --search CRIT equals --search1 CRIT --search2 CRIT\n\n     --noabletosearch    : Makes --minage and --maxage options use the internal\n                           dates given by a FETCH imap command instead of the\n                           \"Date:\" header. Internal date is the arrival date\n                           in the mailbox.\n                           --noabletosearch equals --noabletosearch1 --noabletosearch2\n\n     --noabletosearch1   : Like --noabletosearch but for host1 only.\n     --noabletosearch2   : Like --noabletosearch but for host2 only.\n\n     --maxlinelength int : skip messages with a line length longer than  int  bytes.\n                           RFC 2822 says it must be no more than 1000 bytes but\n                           real life servers and email clients do more.\n\n\n     --useheader    str  : Use this header to compare messages on both sides.\n                           Example: \"Message-Id\" or \"Received\" or \"Date\".\n     --useheader    str    and this one, etc.\n\n     --syncduplicates    : Sync also duplicates. Off by default.\n\n     --usecache          : Use cache to speed up next syncs. Off by default.\n     --nousecache        : Do not use cache. Caveat: --useuid --nousecache creates\n                           duplicates on multiple runs.\n\n     --useuid            : Use UIDs instead of headers as a criterion to recognize\n                           messages. Option --usecache is then implied unless\n                           --nousecache is used.\n\n  OPTIONS/miscellaneous\n\n     --syncacls          : Synchronizes acls (Access Control Lists).\n                           Acls in IMAP are not standardized, be careful\n                           since one acl code on one side may signify something\n                           else on the other one.\n     --nosyncacls        : Does not synchronize acls. This is the default.\n\n     --addheader         : When a message has no headers to be identified,\n                           --addheader adds a \"Message-Id\" header,\n                           like \"Message-Id: 12345@imapsync\", where 12345\n                           is the imap UID of the message on the host1 folder.\n                           Useful to sync folders \"Sent\" or \"Draft\".\n\n  OPTIONS/debugging\n\n     --debug             : Debug mode.\n     --debugfolders      : Debug mode for the folders part only.\n     --debugcontent      : Debug content of the messages transferred. Huge output.\n     --debugflags        : Debug mode for flags.\n     --debugimap1        : IMAP debug mode for host1. Very verbose.\n     --debugimap2        : IMAP debug mode for host2. Very verbose.\n     --debugimap         : IMAP debug mode for host1 and host2. Twice very verbose.\n     --debugmemory       : Debug mode showing memory consumption after each copy.\n\n     --errorsmax     int : Exit when int number of errors is reached. Default is 50.\n\n     --tests             : Run local non-regression tests. Exit code 0 means all ok.\n     --testslive         : Run a live test with test1.lamiral.info imap server.\n                           Useful to check the basics. Needs internet connection.\n     --testslive6        : Run a live test with ks6ipv6.lamiral.info imap server.\n                           Useful to check the ipv6 connectivity. Needs internet.\n\n  OPTIONS/specific\n\n      --gmail1           : sets --host1 to Gmail and other options. See FAQ.Gmail.txt\n      --gmail2           : sets --host2 to Gmail and other options. See FAQ.Gmail.txt\n\n      --office1          : sets --host1 to Office365 and other options. See FAQ.Office365.txt\n      --office2          : sets --host2 to Office365 and other options. See FAQ.Office365.txt\n\n      --exchange1        : sets options for Exchange. See FAQ.Exchange.txt\n      --exchange2        : sets options for Exchange. See FAQ.Exchange.txt\n\n      --domino1          : sets options for Domino. See FAQ.Domino.txt\n      --domino2          : sets options for Domino. See FAQ.Domino.txt\n\n  OPTIONS/behavior\n\n     --timeout1     flo  : Connection timeout in seconds for host1.\n                           Default is 120 and 0 means no timeout at all.\n     --timeout2     flo  : Connection timeout in seconds for host2.\n                           Default is 120 and 0 means no timeout at all.\n\n                           Caveat, under CGI context, you may encounter a timeout\n                           from the webserver, killing imapsync and the imap connections.\n                           See the document INSTALL.OnlineUI.txt and search\n                           for \"Timeout\" for how to deal with this issue.\n\n     --keepalive1        : https://metacpan.org/pod/Mail::IMAPClient#Keepalive\n                           Some firewalls and network gears like to timeout connections \n                           prematurely if the connection sits idle.\n                           This option enables SO_KEEPALIVE on the host1 socket.\n                           --keepalive1 is on by default since imapsync release 2.169\n                           Use --nokeepalive1 to disable it.\n                       \n     --keepalive2        : Same as --keepalive2 but for host2.\n                           Use --nokeepalive2 to disable it.\n\n     --maxmessagespersecond flo : limits the average number of messages \n                                  transferred per second.\n\n     --maxbytespersecond int : limits the average transfer rate per second.\n     --maxbytesafter     int : starts --maxbytespersecond limitation only after\n                               --maxbytesafter amount of data transferred.\n\n     --maxsleep      flo : do not sleep more than int seconds.\n                           On by default, 2 seconds max, like --maxsleep 2\n\n     --abort             : terminates a previous call still running.\n                           It uses the pidfile to know what process to abort.\n\n     --exitwhenover int  : Stop syncing and exits when int total bytes\n                           transferred is reached.\n\n     --version           : Print only the software version.\n     --noreleasecheck    : Do not check for any new imapsync release.\n     --releasecheck      : Check for new imapsync release.\n                           it's an http request to\n                           http://imapsync.lamiral.info/prj/imapsync/VERSION\n\n      --emailreport1     : Put the email final report in host1 INBOX\n      --emailreport2     : Put the email final report in host2 INBOX\n\n      --noemailreport1   : Do not put the email final report in host1 INBOX\n      --noemailreport2   : Do not put the email final report in host2 INBOX\n\n     --noid              : Do not send/receive IMAP \"ID\" command to imap servers.\n\n     --justconnect       : Just connect to both servers and print useful\n                           information. Need only --host1 and --host2 options.\n                           Obsolete since \"imapsync --host1 imaphost\" alone\n                           implies --justconnect\n\n     --justlogin         : Just login to both host1 and host2 with users\n                           credentials, then exit.\n\n     --justfolders       : Do only things about folders (ignore messages).\n\n     --help              : print this help.\n\n     Example: to synchronize imap account \"test1\" on \"test1.lamiral.info\"\n                         to  imap account \"test2\" on \"test2.lamiral.info\"\n                         with test1 password \"secret1\"\n                         and  test2 password \"secret2\"\n\n     imapsync \\\n        --host1 test1.lamiral.info --user1 test1 --password1 secret1 \\\n        --host2 test2.lamiral.info --user2 test2 --password2 secret2\n\nSECURITY\n\n    You can use --passfile1 instead of --password1 to mention the password\n    since it is safer. With --password1 option, on Linux, any user on your\n    host can see the password by using the 'ps auxwwww' command. Using a\n    variable (like IMAPSYNC_PASSWORD1) is also dangerous because of the 'ps\n    auxwwwwe' command. So, saving the password in a well protected file (600\n    or rw-------) is the best solution.\n\n    Imapsync activates ssl or tls encryption by default, if possible.\n\n    What detailed behavior is under this \"if possible\"?\n\n    Imapsync activates ssl if the well known port imaps port (993) is open\n    on the imap servers. If the imaps port is closed then it open a normal\n    (clear) connection on port 143 but it looks for TLS support in the\n    CAPABILITY list of the servers. If TLS is supported then imapsync goes\n    to encryption with STARTTLS.\n\n    If the automatic ssl and the tls detections fail then imapsync will not\n    protect against sniffing activities on the network, especially for\n    passwords.\n\n    If you want to force ssl or tls just use --ssl1 --ssl2 or --tls1 --tls2\n\n    See also the document FAQ.Security.txt in the FAQ.d/ directory or at\n    https://imapsync.lamiral.info/FAQ.d/FAQ.Security.txt\n\nEXIT STATUS\n\n    Imapsync will exit with a 0 status (return code) if everything went\n    good. Otherwise, it exits with a non-zero status. That's classical Unix\n    behavior. Here is the list of the exit code values (an integer between 0\n    and 255). In Bourne Shells, this exit code value can be retrieved within\n    the variable value \"$?\" if you read it just after the imapsync call.\n\n    The names reflect their meaning:\n\n         EX_OK          =\u003e 0  ; #/* successful termination */\n         EX_USAGE       =\u003e 64 ; #/* command line usage error */\n         EX_NOINPUT     =\u003e 66 ; #/* cannot open input */\n         EX_UNAVAILABLE =\u003e 69 ; #/* service unavailable */\n         EX_SOFTWARE    =\u003e 70 ; #/* internal software error */\n         EXIT_CATCH_ALL              =\u003e   1 ; # Any other error\n         EXIT_BY_SIGNAL              =\u003e   6 ; # Should be 128+n where n is the sig_num\n         EXIT_BY_FILE                =\u003e   7 ;\n         EXIT_PID_FILE_ERROR         =\u003e   8 ;\n         EXIT_CONNECTION_FAILURE     =\u003e  10 ;\n         EXIT_TLS_FAILURE            =\u003e  12 ;\n         EXIT_AUTHENTICATION_FAILURE =\u003e  16 ;\n         EXIT_SUBFOLDER1_NO_EXISTS   =\u003e  21 ;\n         EXIT_WITH_ERRORS            =\u003e 111 ;\n         EXIT_WITH_ERRORS_MAX        =\u003e 112 ;\n         EXIT_OVERQUOTA              =\u003e 113 ;\n         EXIT_ERR_APPEND             =\u003e 114 ;\n         EXIT_ERR_FETCH              =\u003e 115 ;\n         EXIT_ERR_CREATE             =\u003e 116 ;\n         EXIT_ERR_SELECT             =\u003e 117 ;\n         EXIT_TRANSFER_EXCEEDED      =\u003e 118 ;\n         EXIT_ERR_APPEND_VIRUS       =\u003e 119 ;\n         EXIT_TESTS_FAILED           =\u003e 254 ; # Like Test::More API\n         EXIT_CONNECTION_FAILURE_HOST1     =\u003e  101 ;\n         EXIT_CONNECTION_FAILURE_HOST2     =\u003e  102 ;\n         EXIT_AUTHENTICATION_FAILURE_USER1 =\u003e  161 ;\n         EXIT_AUTHENTICATION_FAILURE_USER2 =\u003e  162 ;\n\nLICENSE AND COPYRIGHT\n\n    Imapsync is free, open, public but not always gratis software cover by\n    the NOLIMIT Public License, now called NLPL. See the LICENSE file\n    included in the distribution or just read the following simple sentence\n    as it IS the license text:\n\n     \"No limits to do anything with this work and this license.\"\n\n    In case it is not long enough, I repeat:\n\n     \"No limits to do anything with this work and this license.\"\n\n    Look at https://imapsync.lamiral.info/LICENSE\n\nAUTHOR\n\n    Gilles LAMIRAL \u003cgilles@lamiral.info\u003e\n\n    Good feedback is always welcome. Bad feedback is very often welcome.\n\n    Gilles LAMIRAL earns his living by writing, installing, configuring and\n    sometimes teaching free, open, and often gratis software. Imapsync used\n    to be \"always gratis\" but now it is only \"often gratis\" because imapsync\n    is sold by its author, your servitor, a good way to maintain and support\n    free open public software tools over decades.\n\nBUGS AND LIMITATIONS\n\n    See https://imapsync.lamiral.info/FAQ.d/FAQ.Reporting_Bugs.txt\n\nIMAP SERVERS supported\n\n    See https://imapsync.lamiral.info/S/imapservers.shtml\n\nHUGE MIGRATION\n\n    If you have many mailboxes to migrate think about a little shell\n    program. Write a file called file.txt (for example) containing users and\n    passwords. The separator used in this example is ';'\n\n    The file.txt file contains:\n\n    user001_1;password001_1;user001_2;password001_2\n    user002_1;password002_1;user002_2;password002_2\n    user003_1;password003_1;user003_2;password003_2\n    user004_1;password004_1;user004_2;password004_2\n    user005_1;password005_1;user005_2;password005_2 ...\n\n    On Unix the shell program can be:\n\n     { while IFS=';' read  u1 p1 u2 p2; do\n            imapsync --host1 imap.side1.org --user1 \"$u1\" --password1 \"$p1\" \\\n                     --host2 imap.side2.org --user2 \"$u2\" --password2 \"$p2\" ...\n     done ; } \u003c file.txt\n\n    On Windows the batch program can be:\n\n      FOR /F \"tokens=1,2,3,4 delims=; eol=#\" %%G IN (file.txt) DO imapsync ^\n      --host1 imap.side1.org --user1 %%G --password1 %%H ^\n      --host2 imap.side2.org --user2 %%I --password2 %%J ...\n\n    The ... have to be replaced by nothing or any imapsync option. Welcome\n    in shell or batch programming !\n\n    You will find already written scripts at\n    https://imapsync.lamiral.info/examples/\n\nINSTALL\n\n     Imapsync works under any Unix with Perl.\n\n     Imapsync works under most Windows (2000, XP, Vista, Seven, Eight, Ten\n     and all Server releases 2000, 2003, 2008 and R2, 2012 and R2, 2016)\n     as a standalone binary software called imapsync.exe, usually launched\n     from a batch file in order to avoid always typing the options. There\n     is also a 32bit binary called imapsync_32bit.exe\n\n     Imapsync works under OS X as a standalone binary software called\n     imapsync_bin_Darwin\n\n     Purchase latest imapsync at\n     https://imapsync.lamiral.info/\n\n     You'll receive a link to a compressed tarball called\n     imapsync-x.xx.tgz where x.xx is the version number. \n     Untar the tarball where you want (on Unix):\n\n      tar xzvf  imapsync-x.xx.tgz\n\n     Go into the directory imapsync-x.xx and read the INSTALL file.\n     As mentioned at https://imapsync.lamiral.info/#install\n     the INSTALL file can also be found at\n     https://imapsync.lamiral.info/INSTALL.d/INSTALL.ANY.txt\n     It is now split in several files for each system\n     https://imapsync.lamiral.info/INSTALL.d/\n\nCONFIGURATION\n\n    There is no specific configuration file for imapsync, everything is\n    specified by the command line parameters and the default behavior.\n\nHACKING\n\n    Feel free to hack imapsync as the NOLIMIT license permits it.\n\nSIMILAR SOFTWARE\n\n      See also https://imapsync.lamiral.info/S/external.shtml\n      for a better up to date list.\n\n    List verified on Friday July 1, 2021.\n\n     imapsync: https://github.com/imapsync/imapsync (this is an imapsync copy, sometimes delayed, with --noreleasecheck by default since release 1.592, 2014/05/22)\n     imap_tools: https://web.archive.org/web/20161228145952/http://www.athensfbc.com/imap_tools/. The imap_tools code is now at https://github.com/andrewnimmo/rick-sanders-imap-tools\n     imaputils: https://github.com/mtsatsenko/imaputils (very old imap_tools fork)\n     Doveadm-Sync: https://wiki2.dovecot.org/Tools/Doveadm/Sync ( Dovecot sync tool )\n     davmail: http://davmail.sourceforge.net/\n     offlineimap: http://offlineimap.org/\n     fdm: https://github.com/nicm/fdm\n     mbsync: http://isync.sourceforge.net/\n     mailsync: http://mailsync.sourceforge.net/\n     mailutil: https://www.washington.edu/imap/ part of the UW IMAP toolkit. (well, seems abandoned now)\n     imaprepl: https://bl0rg.net/software/ http://freecode.com/projects/imap-repl/\n     imapcopy (Pascal): http://www.ardiehl.de/imapcopy/\n     imapcopy (Java): https://code.google.com/archive/p/imapcopy/\n     imapsize: http://www.broobles.com/imapsize/\n     migrationtool: http://sourceforge.net/projects/migrationtool/\n     imapmigrate: http://sourceforge.net/projects/cyrus-utils/\n     larch: https://github.com/rgrove/larch (derived from wonko_imapsync, good at Gmail)\n     wonko_imapsync: http://wonko.com/article/554 (superseded by larch)\n     pop2imap: http://www.linux-france.org/prj/pop2imap/ (I wrote that too)\n     exchange-away: http://exchange-away.sourceforge.net/\n     SyncBackPro: http://www.2brightsparks.com/syncback/sbpro.html\n     ImapSyncClient: https://github.com/ridaamirini/ImapSyncClient\n     MailStore: https://www.mailstore.com/en/products/mailstore-home/\n     mnIMAPSync: https://github.com/manusa/mnIMAPSync\n     imap-upload: http://imap-upload.sourceforge.net/ (A tool for uploading a local mbox file to IMAP4 server)\n     imapbackup: https://github.com/rcarmo/imapbackup (A Python script for incremental backups of IMAP mailboxes)\n     BitRecover email-backup 99 USD, 299 USD https://www.bitrecover.com/email-backup/.\n     ImportExportTools: https://addons.thunderbird.net/en-us/thunderbird/addon/importexporttools/ ImportExportTools for Mozilla Thunderbird by Paolo Kaosmos. ImportExportTools does not do IMAP.\n     rximapmail: https://sourceforge.net/projects/rximapmail/\n     CodeTwo: https://www.codetwo.com/ but CodeTwo does imap source to Office365 only.\n\nHISTORY\n\n    I initially wrote imapsync in July 2001 because an enterprise, called\n    BaSystemes, paid me to install a new imap server without losing huge old\n    mailboxes located in a far away remote imap server, accessible by an\n    often broken low-bandwidth ISDN link.\n\n    I had to verify every mailbox was well transferred, all folders, all\n    messages, without wasting bandwidth or creating duplicates upon resyncs.\n    The imapsync design was made with the beautiful rsync command in mind.\n\n    Imapsync started its life as a patch of the copy_folder.pl script. The\n    script copy_folder.pl comes from the Mail-IMAPClient-2.1.3 perl module\n    tarball source (more precisely in the examples/ directory of the\n    Mail-IMAPClient tarball).\n\n    So many changes happened since then that I wonder if it remains any\n    lines of the original copy_folder.pl in imapsync source code.\n\n","funding_links":["https://github.com/sponsors/gilleslamiral"],"categories":["Perl","\\*nix/\\*nux","Shell"],"sub_categories":["Email"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimapsync%2Fimapsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimapsync%2Fimapsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimapsync%2Fimapsync/lists"}