Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync to many subfolder #419

Open
Genialsrl opened this issue Oct 27, 2023 · 9 comments
Open

sync to many subfolder #419

Genialsrl opened this issue Oct 27, 2023 · 9 comments
Assignees
Labels
Archive Deletions Deletions issues Folders Folders issues

Comments

@Genialsrl
Copy link

hello I have a problem with imapsync
imapsync 2.261

Let's start from the first

Origin e destination server are smartermail

xxx.xxx.tldt;archivio@xxx.it;xxxxxx;192.168.1.19;copielocali@local.xxx.it;yyyyy; --useheader Message-Id --noabletosearch --addheader --delete2 --delete2folders --regextrans2 "s,INBOX,Inbox," --subfolder2 archivio

In practice it takes the content present in archivio@xxx.it and synchronizes it on a local smartermail copielocali@local.xxx.it in an archive subfolder

The problem I notice is that on the first passage of a new message the labels are not synchronized. Only in the second step are the labels also synchronized.

If I add

--syncflagsaftercopy --nofilterflags -synclabels

on the origin server all unread messages are marked as read (and this is really strange)

second problem

xxx.xxx.tldt;archivio@xxx.it;xxxxxx;192.168.1.19;copielocali@local.xxx.it;yyyyy; --useheader Message-Id --noabletosearch --addheader --delete2 --delete2folders --regextrans2 "s,INBOX,Inbox," --subfolder2 archivio

ixxx.xxx.tldt;archivio2@xxx.it;xxxxxx;192.168.1.19;copielocali@local.xxx.it;yyyyy; --useheader Message-Id --noabletosearch --addheader --delete2 --delete2folders --regextrans2 "s,INBOX,Inbox," --subfolder2 archivio2

In this case I would like archivio@xxx.it to synchronize in the archive subfolder of copielocali@local.xxx.it

is that
archivio2@xxx.it synchronize in the archivio2 subfolder of copielocali@local.xxx.it

But when archive2 is processed the archive subfolder in copielocali@local.xxx.it is deleted due to --deletefolder2

Not the behavior I expected. Having specified a destination subfolder I expected delete2 and deletefolder2 to occur only there

is there any flag to solve the problem?

Thank you

@gilleslamiral gilleslamiral self-assigned this Oct 27, 2023
@gilleslamiral
Copy link
Member

hello I have a problem with imapsync imapsync 2.261

Let's start from the first

A piece of advice: if you have several issues, open several tickets, or email several emails, and you'll get quicker answers.

@gilleslamiral
Copy link
Member

Origin and destination servers are smartermail

Ok

The problem I notice is that on the first passage of a new message, the labels are not synchronized. Only in the second step are the labels also synchronized.

It's strange.

If I add
--syncflagsaftercopy --nofilterflags -synclabels
on the origin server all unread messages are marked as read (and this is really strange)

Yes, it's really strange since Imapsync doesn't change flags on the source server, by setting Peek(1) on both imap connexions.
https://metacpan.org/pod/Mail::IMAPClient#Peek
--synclabels is useless here, only Gmail does labels.

A --debugflags can help here to understand the issue. Do it on a small folder "small_one" with --folder "small_one"

@gilleslamiral
Copy link
Member

... --delete2 --delete2folders --subfolder2 archivio

But when archive2 is processed the archive subfolder is deleted due to --deletefolder2
Not the behavior I expected. Having specified a destination subfolder I expected delete2 and deletefolder2 to occur only there

is there any flag to solve the problem?

Use --delete2foldersonly archivio

But since "archivio" is a substring of "archivio2" it should apply the destruction on the archivio2 hierarchy...
Solution? Yes. Have distinguished archive names like archivio1 and archivio2 and use --delete2foldersonly archivio1

https://imapsync.lamiral.info/README

...
  OPTIONS/deletions
...
     --delete2folders    : Delete folders in host2 that are not in host1.
                           For safety, first try it like this, it is safe:
                           --delete2folders --dry --justfolders --nofoldersizes
                           and see what folders will be deleted.

     --delete2foldersonly   reg : Delete only folders matching the regex reg.
                                  Example: --delete2foldersonly "/^Junk$|^INBOX.Junk$/"
                                  This option activates --delete2folders

     --delete2foldersbutnot reg : Do not delete folders matching the regex rex.
                                  Example: --delete2foldersbutnot "/Tasks$|Contacts$|Foo$/"
                                  This option activates --delete2folders

@Genialsrl
Copy link
Author

I tried with this syntax

xxx.xxx.tld;archivio@xxx.it;xxxx;192.168.1.19;copielocali@local.xxx.it;xxxx; --useheader Message-Id --noabletosearch --addheader --subfolder2 archivio1 --delete2foldersonly archivio1
xxx.xxx.tld;archivio2@xxx.it;xxxx;192.168.1.19;copielocali@local.xxx.it;xxxx; --useheader Message-Id --noabletosearch --addheader --subfolder2 archivio2 --delete2foldersonly archivio2

But it keeps deleting archivio1 when it processes the second account

here is an extract of the log of the second account

....
Sanitizing subfolder2: [archivio2] => [archivio2]
....

Host2: folders list (first the raw imap format then the [X] = [Y]):

  • LIST (\HasNoChildren \Drafts) "/" "Drafts"

  • LIST (\HasChildren) "/" "archivio1"

  • LIST (\HasChildren) "/" "archivio1/Inbox"

  • LIST (\HasNoChildren) "/" "archivio1/Inbox/ciccio1"

  • LIST (\HasNoChildren) "/" "archivio1/Inbox/ciccio2"

  • LIST (\HasNoChildren) "/" "archivio1/Drafts"

  • LIST (\HasNoChildren) "/" "archivio1/Junk E-Mail"

  • LIST (\HasNoChildren) "/" "archivio1/Sent Items"

  • LIST (\HasNoChildren) "/" "archivio1/Deleted Items"

  • LIST (\HasNoChildren \Junk) "/" "Junk E-Mail"

  • LIST (\HasNoChildren \Inbox) "/" "Inbox"

  • LIST (\HasNoChildren \Sent) "/" "Sent Items"

  • LIST (\HasNoChildren \Trash) "/" "Deleted Items"

9 OK LIST completed

[Deleted Items]
[Drafts]
[Inbox]
[Junk E-Mail]
[Sent Items]
[archivio1]
[archivio1/Deleted Items]
[archivio1/Drafts]
[archivio1/Inbox]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox/ciccio2]
[archivio1/Junk E-Mail]
[archivio1/Sent Items]

Folders in host2 not in host1:
[archivio1/Sent Items]
[archivio1/Junk E-Mail]
[archivio1/Inbox/ciccio2]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox]
[archivio1/Drafts]
[archivio1/Deleted Items]
[archivio1]

@gilleslamiral
Copy link
Member

But it keeps deleting archivio1 when it processes the second account

It's strange. Can you show me the log of this archivio1 deletion?
Add --justfolders to keep it small.

@Genialsrl
Copy link
Author

Here is imapsync 2.261 on host MailServerSM, a MSWin32 system with 3.3/8.0 free GiB of RAM, 62.00% used by processes.
with Perl 5.32.1 and Mail::IMAPClient 3.43
Transfer started at Wednesday 01 November 2023-11-01 19:11:53 W. Europe Standard Time
PID is 7552 my PPID is unknown under MSWin32 (too complicated)
Log file is LOG_imapsync/2023_11_01_19_11_53_853_archivio2_xxxx_it_copielocali_local_xxxx_it.txt ( to change it, use --logfile path ; or use --nolog to turn off logging )
Load is unknown on 4 cores
Real user id is localadmin (uid 0)
Effective user id is localadmin (euid 0)
$RCSfile: imapsync,v $ $Revision: 2.261 $ $Date: 2023/09/27 11:26:09 $
Command line used, run by perl.exe:
D:\imapsync_2.261 - tocopielocali\imapsync.exe --host1 xxx.xxx.tld --user1 archivio2@xxx.tld --password1 MASKED --host2 192.168.1.19 --user2 copielocali@local.xxx.tld --password2 MASKED --useheader Message-Id --noabletosearch --addheader --subfolder2 archivio2 --delete2foldersonly archivio2 --justfolders
Current directory is D:/imapsync_2.261 - tocopielocali
Temp directory is ./ ( to change it use --tmpdir dirpath )
Creating temp directory ./
kill -QUIT 7552 # special behavior: call to sub catch_exit
kill -TERM 7552 # special behavior: call to sub catch_exit
kill -INT 7552 # special behavior: call to sub catch_reconnect
kill -HUP 7552 # special behavior: call to sub catch_print
File .//imapsync.pid does not exist
PID file is .//imapsync.pid ( to change it, use --pidfile filepath ; to avoid it use --pidfile "" )
Writing my PID 7552 in .//imapsync.pid
Writing also my logfile name in .//imapsync.pid : LOG_imapsync/2023_11_01_19_11_53_853_archivio2_xxxx_it_copielocali_local_xxxx_it.txt
Modules version list ( use --no-modulesversion to turn off printing this Perl modules list ):
Authen::NTLM 1.09
CGI Not installed
Compress::Zlib 2.1
Crypt::OpenSSL::RSA 0.33
Data::Uniqid Not installed
Digest::HMAC_MD5 1.04
Digest::HMAC_SHA1 1.04
Digest::MD5 2.58
Digest::SHA 6.02
Encode 3.19
Encode::IMAPUTF7 1.05
File::Copy::Recursive 0.45
File::Spec 3.78
Getopt::Long 2.52
HTML::Entities 3.81
IO::Socket 1.51
IO::Socket::INET 1.51
IO::Socket::INET6 2.73
IO::Socket::IP 0.42
IO::Socket::SSL 2.083
IO::Tee 0.65
JSON 4.10
JSON::WebToken 0.10
LWP 6.72
MIME::Base64 3.16
Mail::IMAPClient 3.43
Net::Ping 2.74
Net::SSLeay 1.92
Term::ReadKey 2.38
Test::MockObject 1.20200122
Time::HiRes 1.9764
Unicode::String 2.10

Info: will resync flags for already transferred messages. Use --noresyncflags to not resync flags.
Host1: probing ssl on port 993 ( use --nosslcheck to avoid this ssl probe )
Host1: sslcheck detected open ssl port 993 so turning ssl on (use --nossl1 --notls1 to turn off SSL and TLS wizardry)
Host2: probing ssl on port 993 ( use --nosslcheck to avoid this ssl probe )
Host2: sslcheck did not detected open ssl port 993. Will use standard 143 port.
SSL debug mode level is --debugssl 1 (can be set from 0 meaning no debug to 4 meaning max debug)
Host1: SSL default mode is like --sslargs1 "SSL_verify_mode=0", meaning for host1 SSL_VERIFY_NONE, ie, do not check the server certificate.
Host1: Use --sslargs1 SSL_verify_mode=1 to have SSL_VERIFY_PEER, ie, check the server certificate. of host1
Info: turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
Host1: will try to use LOGIN authentication on host1
Host2: will try to use LOGIN authentication on host2
Host1: imap connection timeout is 120 seconds
Host2: imap connection timeout is 120 seconds
Host1: imap connection keepalive is on on host1. Use --nokeepalive1 to disable it.
Host2: imap connection keepalive is on on host2. Use --nokeepalive2 to disable it.
Host1: IMAP server [xxx.xxx.tld] port [993] user [archivio2@xxx.tld]
Host2: IMAP server [192.168.1.19] port [143] user [copielocali@local.xxx.tld]
Host1: connecting and login on host1 [xxx.xxx.tld] port [993] with user [archivio2@xxx.tld]
Host1 IP address: 217.61.42.197 Local IP address: 192.168.1.19
Host1 banner: * OK IMAP4rev1 SmarterMail

Host1 capability before authentication: IMAP4rev1 AUTH=CRAM-MD5 AUTH=NTLM AUTH=PLAIN SASL-IR UIDPLUS QUOTA MOVE XLIST CHILDREN ENABLE CONDSTORE X-SM-TAGS IDLE AUTH
Host1: success login on [xxx.xxx.tld] with user [archivio2@xxx.tld] auth [LOGIN] or [LOGIN]
Host2: connecting and login on host2 [192.168.1.19] port [143] with user [copielocali@local.xxx.tld]
Host2 IP address: 192.168.1.19 Local IP address: 192.168.1.19
Host2 banner: * OK IMAP4rev1 SmarterMail

Host2 capability before authentication: IMAP4rev1 AUTH=CRAM-MD5 AUTH=NTLM AUTH=PLAIN SASL-IR UIDPLUS QUOTA MOVE XLIST CHILDREN ENABLE CONDSTORE X-SM-TAGS AUTH
Host2: success login on [192.168.1.19] with user [copielocali@local.xxx.tld] auth [LOGIN] or [LOGIN]
Host1: state Authenticated
Host2: state Authenticated
Host1 capability once authenticated: IMAP4rev1 AUTH=CRAM-MD5 AUTH=NTLM AUTH=PLAIN SASL-IR UIDPLUS QUOTA MOVE XLIST CHILDREN ENABLE CONDSTORE X-SM-TAGS IDLE AUTH
Host2 capability once authenticated: IMAP4rev1 AUTH=CRAM-MD5 AUTH=NTLM AUTH=PLAIN SASL-IR UIDPLUS QUOTA MOVE XLIST CHILDREN ENABLE CONDSTORE X-SM-TAGS AUTH
Host1: No ID capability
Host2: No ID capability

Host2: QUOTA capability found, presented in raw IMAP on next lines
Sending: 4 GETQUOTAROOT INBOX
Sent 22 bytes
Read: * QUOTAROOT INBOX ""
* QUOTA "" (STORAGE 5 0)
4 OK STATUS completed

Host2: Quota current storage is 5120 bytes. Limit is 0 bytes. So 0 % full
Host1: Compression is off. Use --compress1 to allow compression on host1
Host2: Compression is off. Use --compress2 to allow compression on host2
Compression often generates annoying errors, especially with SSL connexions, Gmail, Office365. So, avoid it.
Host1: found 5 folders.
Host2: found 13 folders.
Host1: guessing separator from folder listing: [/]
Host1: No NAMESPACE capability, so using guessed separator [/]
You can set the separator character with the --sep1 option,
the complete listing of folders may help you to find it
[Sent Items]
[Deleted Items]
[Drafts]
[Junk E-Mail]
[Inbox]
Host2: guessing separator from folder listing: [/]
Host2: No NAMESPACE capability, so using guessed separator [/]
You can set the separator character with the --sep2 option,
the complete listing of folders may help you to find it
[Drafts]
[archivio1]
[archivio1/Inbox]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox/ciccio2]
[archivio1/Drafts]
[archivio1/Junk E-Mail]
[archivio1/Sent Items]
[archivio1/Deleted Items]
[Junk E-Mail]
[Inbox]
[Sent Items]
[Deleted Items]
Host1: guessing prefix from folder listing: []
Host1: No NAMESPACE capability so using guessed prefix []
You can set the prefix namespace with the --prefix1 option,
the folowing listing of folders may help you to find it:
[Sent Items]
[Deleted Items]
[Drafts]
[Junk E-Mail]
[Inbox]
Host2: guessing prefix from folder listing: []
Host2: No NAMESPACE capability so using guessed prefix []
You can set the prefix namespace with the --prefix2 option,
the folowing listing of folders may help you to find it:
[Drafts]
[archivio1]
[archivio1/Inbox]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox/ciccio2]
[archivio1/Drafts]
[archivio1/Junk E-Mail]
[archivio1/Sent Items]
[archivio1/Deleted Items]
[Junk E-Mail]
[Inbox]
[Sent Items]
[Deleted Items]
Host1: separator and prefix: [/][]
Host2: separator and prefix: [/][]
Turning off automapping folders because of --subfolder2
Sanitizing subfolder2: [archivio2] => [archivio2]
Including all folders found by default. Use --subscribed or --folder or --folderrec or --include to select specific folders. Use --exclude to unselect specific folders.
Host1: Checking wanted folders exist. Use --nocheckfoldersexist to avoid this check (shared of public namespace targeted).
Host1: Checking wanted folders are selectable. Use --nocheckselectable to avoid this check.
Turned off automapping folders ( use --automap to turn on automapping )

++++ Listing folders
All foldernames are presented between brackets like [X] where X is the foldername.
When a foldername contains non-ASCII characters it is presented in the form
[X] = [Y] where
X is the imap foldername you have to use in command line options and
Y is the utf8 output just printed for convenience, to recognize it.

Host1: folders list (first the raw imap format then the [X] = [Y]):

  • LIST (\HasNoChildren \Sent) "/" "Sent Items"

  • LIST (\HasNoChildren \Trash) "/" "Deleted Items"

  • LIST (\HasNoChildren \Drafts) "/" "Drafts"

  • LIST (\HasNoChildren \Junk) "/" "Junk E-Mail"

  • LIST (\HasNoChildren \Inbox) "/" "Inbox"

13 OK LIST completed

[Deleted Items]
[Drafts]
[Inbox]
[Junk E-Mail]
[Sent Items]

Host2: folders list (first the raw imap format then the [X] = [Y]):

  • LIST (\HasNoChildren \Drafts) "/" "Drafts"

  • LIST (\HasChildren) "/" "archivio1"

  • LIST (\HasChildren) "/" "archivio1/Inbox"

  • LIST (\HasNoChildren) "/" "archivio1/Inbox/ciccio1"

  • LIST (\HasNoChildren) "/" "archivio1/Inbox/ciccio2"

  • LIST (\HasNoChildren) "/" "archivio1/Drafts"

  • LIST (\HasNoChildren) "/" "archivio1/Junk E-Mail"

  • LIST (\HasNoChildren) "/" "archivio1/Sent Items"

  • LIST (\HasNoChildren) "/" "archivio1/Deleted Items"

  • LIST (\HasNoChildren \Junk) "/" "Junk E-Mail"

  • LIST (\HasNoChildren \Inbox) "/" "Inbox"

  • LIST (\HasNoChildren \Sent) "/" "Sent Items"

  • LIST (\HasNoChildren \Trash) "/" "Deleted Items"

9 OK LIST completed

[Deleted Items]
[Drafts]
[Inbox]
[Junk E-Mail]
[Sent Items]
[archivio1]
[archivio1/Deleted Items]
[archivio1/Drafts]
[archivio1/Inbox]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox/ciccio2]
[archivio1/Junk E-Mail]
[archivio1/Sent Items]

Folders in host2 not in host1:
[archivio1/Sent Items]
[archivio1/Junk E-Mail]
[archivio1/Inbox/ciccio2]
[archivio1/Inbox/ciccio1]
[archivio1/Inbox]
[archivio1/Drafts]
[archivio1/Deleted Items]
[archivio1]

Deleted archivio1/Sent Items
Deleted archivio1/Junk E-Mail
Deleted archivio1/Inbox/ciccio2
Deleted archivio1/Inbox/ciccio1
Deleted archivio1/Inbox
Deleted archivio1/Drafts
Deleted archivio1/Deleted Items
Deleted archivio1
++++ Looping on each one of 5 folders to sync
Folder 1/5 [Deleted Items] -> [archivio2/Deleted Items]
Host1: folder [Deleted Items] has 0 messages in total (mentioned by SELECT)
Creating folder [archivio2/Deleted Items] on host2
Creating folder [archivio2] on host2
Created folder [archivio2] on host2
Created folder [archivio2/Deleted Items] on host2
Host2: folder [archivio2/Deleted Items] has 0 messages in total (mentioned by SELECT)
Host2: folder [archivio2/Deleted Items] permanentflags:
Host2: Subscribing to folder archivio2/Deleted Items
Folder 2/5 [Drafts] -> [archivio2/Drafts]
Host1: folder [Drafts] has 0 messages in total (mentioned by SELECT)
Creating folder [archivio2/Drafts] on host2
Created folder [archivio2/Drafts] on host2
Host2: folder [archivio2/Drafts] has 0 messages in total (mentioned by SELECT)
Host2: folder [archivio2/Drafts] permanentflags:
Host2: Subscribing to folder archivio2/Drafts
Folder 3/5 [Inbox] -> [archivio2/Inbox]
Host1: folder [Inbox] has 3 messages in total (mentioned by SELECT)
Creating folder [archivio2/Inbox] on host2
Created folder [archivio2/Inbox] on host2
Host2: folder [archivio2/Inbox] has 0 messages in total (mentioned by SELECT)
Host2: folder [archivio2/Inbox] permanentflags:
Folder 4/5 [Junk E-Mail] -> [archivio2/Junk E-Mail]
Host1: folder [Junk E-Mail] has 0 messages in total (mentioned by SELECT)
Creating folder [archivio2/Junk E-Mail] on host2
Created folder [archivio2/Junk E-Mail] on host2
Host2: folder [archivio2/Junk E-Mail] has 0 messages in total (mentioned by SELECT)
Host2: folder [archivio2/Junk E-Mail] permanentflags:
Host2: Subscribing to folder archivio2/Junk E-Mail
Folder 5/5 [Sent Items] -> [archivio2/Sent Items]
Host1: folder [Sent Items] has 0 messages in total (mentioned by SELECT)
Creating folder [archivio2/Sent Items] on host2
Created folder [archivio2/Sent Items] on host2
Host2: folder [archivio2/Sent Items] has 0 messages in total (mentioned by SELECT)
Host2: folder [archivio2/Sent Items] permanentflags:
Host2: Subscribing to folder archivio2/Sent Items
++++ End looping on each folder

Folders sizes after the synchronization.
You can remove this foldersizes listing by using "--nofoldersizesatend"
Host1 folder 1/5 [Deleted Items] Size: 0 Messages: 0 Biggest: 0
Host2 folder 1/5 [archivio2/Deleted Items] Size: 0 Messages: 0 Biggest: 0
Host2-Host1 0 0 0

Host1 folder 2/5 [Drafts] Size: 0 Messages: 0 Biggest: 0
Host2 folder 2/5 [archivio2/Drafts] Size: 0 Messages: 0 Biggest: 0
Host2-Host1 0 0 0

Host1 folder 3/5 [Inbox] Size: 5673 Messages: 3 Biggest: 1899
Host2 folder 3/5 [archivio2/Inbox] Size: 0 Messages: 0 Biggest: 0
Host2-Host1 -5673 -3 -1899

Host1 folder 4/5 [Junk E-Mail] Size: 0 Messages: 0 Biggest: 0
Host2 folder 4/5 [archivio2/Junk E-Mail] Size: 0 Messages: 0 Biggest: 0
Host2-Host1 0 0 0

Host1 folder 5/5 [Sent Items] Size: 0 Messages: 0 Biggest: 0
Host2 folder 5/5 [archivio2/Sent Items] Size: 0 Messages: 0 Biggest: 0
Host2-Host1 0 0 0

Host1 Nb folders: 5 folders
Host2 Nb folders: 5 folders

Host1 Nb messages: 3 messages
Host2 Nb messages: 0 messages

Host1 Total size: 5673 bytes (5.540 KiB)
Host2 Total size: 0 bytes (0.000 KiB)

Host1 Biggest message: 1899 bytes (1.854 KiB)
Host2 Biggest message: 0 bytes (0.000 KiB)

Time spent on sizing: 0.8 seconds
Strange: cpu_time 8.874 > timediff 8.12638306617737
++++ Statistics
Transfer started on : Wednesday 01 November 2023-11-01 19:11:53 W. Europe Standard Time
Transfer ended on : Wednesday 01 November 2023-11-01 19:12:01 W. Europe Standard Time
Transfer time : 8.1 sec
Folders synced : 5/5 synced
Messages transferred : 0
Messages skipped : 0
Messages found duplicate on host1 : 0
Messages found duplicate on host2 : 0
Messages found crossduplicate on host2 : 0
Messages void (noheader) on host1 : 0
Messages void (noheader) on host2 : 0
Messages found in host1 not in host2 : 0 messages
Messages found in host2 not in host1 : 0 messages
Messages deleted on host1 : 0
Messages deleted on host2 : 0
Total bytes transferred : 0 (0.000 KiB)
Total bytes skipped : 0 (0.000 KiB)
Message rate : 0.0 messages/s
Average bandwidth rate : 0.0 KiB/s
Reconnections to host1 : 0
Reconnections to host2 : 0
Memory consumption at the end : 195.1 MiB (time 0.4 MiBh) (started with 181.7 MiB)
Load end is : unknown on 4 cores
CPU time and %cpu : 8.874 sec 109.2 %cpu 27.3 %allcpus
Biggest message transferred : 0 bytes (0.000 KiB)
Memory/biggest message ratio : NA
Detected 0 errors
This imapsync is not up to date. ( local 2.261 < official 2.264 )( Use --noreleasecheck to avoid this release check. )
Homepage: https://imapsync.lamiral.info/
Exiting with return value 0 (EX_OK: successful termination) 0/50 nb_errors/max_errors PID 7552
Removing pidfile .//imapsync.pid
Log file is LOG_imapsync/2023_11_01_19_11_53_853_archivio2_xxxx_it_copielocali_local_xxxx_it.txt ( to change it, use --logfile filepath ; or use --nolog to turn off logging )

@gilleslamiral
Copy link
Member

Ok, there is a problem here.
I investigate

@Genialsrl
Copy link
Author

Are there any news?

@gilleslamiral
Copy link
Member

Yes. Use slashes around the name:

imapsync ... --subfolder2 archivio1 --delete2foldersonly /archivio1/

I fixed
https://imapsync.lamiral.info/FAQ.d/FAQ.Archiving.txt

=======================================================================
Q. How can I archive different accounts on the same destination account,
   each account on a separate folder?

R. Use --subfolder2 

 --subfolder2   str  : Syncs the whole host1 folders hierarchy under the
                       host2 given folder str.
                       (It does it internally by adding two --regextrans2 
                       options before all others.)

Examples:

To backup the account Foo in a subfolder called FooArchiv:

  imapsync ... --user1 Foo --subfolder2 FooArchiv

To backup the account Bar in a subfolder called BarArchiv:

  imapsync ... --user1 Bar --subfolder2 BarArchiv

In case you need a very strict sync, add options 
--delete2 --delete2foldersonly "/FooArchiv/"
or "/BarArchiv/" for the second example.
Slashes around the name are mandatory.
It will delete on account2 what is not on account1 but only in the right place, 
ie, the subfolder "FooArchiv".

 Technically, the value of option --delete2foldersonly is a regex, it's 
 why the slashes are mandatory.
 
  --delete2foldersonly "/FooArchiv/" 
  is equivalent to
  --delete2foldersonly "m{FooArchiv}"


Examples:

To mirror the account Foo in a subfolder called FooArchiv:

  imapsync ... --user1 Foo --subfolder2 FooArchiv --delete2 --delete2foldersonly "/FooArchiv/" 

To mirror the account Bar in a subfolder called BarArchiv:

  imapsync ... --user1 Bar --subfolder2 BarArchiv --delete2 --delete2foldersonly "/BarArchiv/" 

See how to restore those with the next Q/R.

=======================================================================

@gilleslamiral gilleslamiral added Folders Folders issues Deletions Deletions issues Archive labels Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Archive Deletions Deletions issues Folders Folders issues
Projects
None yet
Development

No branches or pull requests

2 participants