Discussion:
'Connection reset by peer'
Jos van den Oever
2017-03-02 06:43:22 UTC
Permalink
Hi,

I'm trying to push to an IMAP server and the connection is reset by peer. I'm
wondering if this can be avoided. The configuration is added below and the
redacted output of running with -D is attached.

Cheers,
Jos

```
$ mbsync -D --config mbsyncrc --push --full MAIL
new message 1213 on slave
-> pair(-2,1213) exists
-> pushing message, TUID fFzb1tNbHJO+
synchronizing flags
propagating new messages
5 APPEND "INBOX" (\Seen \Deleted) "30-Jun-2016 08:40:53 +0200" {8355}
+ send literal data
(1 in progress) >>> 6 APPEND "INBOX" (\Deleted) "30-Jun-2016 08:40:53 +0200"
{9806}
Socket error from _____._______.nl (__.___.___.___:993): Connection reset by
peer
```

`mbsyncrc`
```
IMAPAccount MAIL
Host _____._______.nl
User user
Pass pass
Port 993
SSLType IMAPS
AuthMechs *

IMAPStore MAIL-remote
Account MAIL

MaildirStore MAIL-local
Path ~/imap/MAIL/
Inbox ~/imap/MAIL/Inbox
Trash ~/imap/MAIL/Trash

Channel MAIL
Master :MAIL-remote:
Slave :MAIL-local:
Patterns *
Patterns % !Trash
Create Both
ExpireUnread no
CopyArrivalDate yes
```
Oswald Buddenhagen
2017-03-02 08:05:00 UTC
Permalink
Post by Jos van den Oever
propagating new messages
5 APPEND "INBOX" (\Seen \Deleted) "30-Jun-2016 08:40:53 +0200" {8355}
+ send literal data
(1 in progress) >>> 6 APPEND "INBOX" (\Deleted) "30-Jun-2016 08:40:53 +0200"
{9806}
Socket error from _____._______.nl (__.___.___.___:993): Connection reset by peer
this definitely indicates a sequencing bug in mbsync when used without
the LITERAL+ extension; this is consistent with previous reports. there
must be something wrong with cmd_sendable() (of course there is - have
you seen it? :D) or the related code.

you can try PipelineDepth 1 as a workaround, but this will be obviously
even slower (though i suppose it could be ok if the latency to the
davmail server is low compared to that of the exchange connection).
Jos van den Oever
2017-03-02 15:23:50 UTC
Permalink
Thanks for the explanation. I'll have a look at using PipelineDepth 1.

My use case is actually to modify a subset of all my mails and re-upload them.
Perhaps isync is too heavy a tool for this and I should script with some imap
lib.

Basically, I'm doing:

mbsync -V --config mbsyncrc --pull MAIL
<modify some mails>
mbsync -V --config mbsyncrc --push --full MAIL

Cheers,
Jos
Post by Oswald Buddenhagen
Post by Jos van den Oever
propagating new messages
5 APPEND "INBOX" (\Seen \Deleted) "30-Jun-2016 08:40:53 +0200" {8355}
+ send literal data
(1 in progress) >>> 6 APPEND "INBOX" (\Deleted) "30-Jun-2016 08:40:53
+0200" {9806}
Socket error from _____._______.nl (__.___.___.___:993): Connection reset by peer
this definitely indicates a sequencing bug in mbsync when used without
the LITERAL+ extension; this is consistent with previous reports. there
must be something wrong with cmd_sendable() (of course there is - have
you seen it? :D) or the related code.
you can try PipelineDepth 1 as a workaround, but this will be obviously
even slower (though i suppose it could be ok if the latency to the
davmail server is low compared to that of the exchange connection).
----------------------------------------------------------------------------
-- Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
isync-devel mailing list
https://lists.sourceforge.net/lists/listinfo/isync-devel
Oswald Buddenhagen
2017-03-02 17:55:20 UTC
Permalink
Post by Jos van den Oever
My use case is actually to modify a subset of all my mails and
re-upload them. Perhaps isync is too heavy a tool for this and I
should script with some imap lib.
the only more lightweight solution i can think of would be using the
CATENATE extension, which isn't terribly popular.
Post by Jos van den Oever
mbsync -V --config mbsyncrc --pull MAIL
<modify some mails>
i hope "modify" includes renaming them (at least throwing away the
,U=NNN part), as otherwise mbsync won't re-upload anything.
Post by Jos van den Oever
mbsync -V --config mbsyncrc --push --full MAIL
Jos van den Oever
2017-03-02 23:48:47 UTC
Permalink
Post by Oswald Buddenhagen
i hope "modify" includes renaming them (at least throwing away the
,U=NNN part), as otherwise mbsync won't re-upload anything.
Yes, modify means: for all mails from a certain address that have a forwarded
mail as attachment, add the forwarded mail instead of the mail that had the
attachement.

Cheers,
Jos
Oswald Buddenhagen
2017-03-04 17:07:16 UTC
Permalink
Post by Oswald Buddenhagen
Post by Jos van den Oever
propagating new messages
5 APPEND "INBOX" (\Seen \Deleted) "30-Jun-2016 08:40:53 +0200" {8355}
+ send literal data
(1 in progress) >>> 6 APPEND "INBOX" (\Deleted) "30-Jun-2016 08:40:53 +0200"
{9806}
Socket error from _____._______.nl (__.___.___.___:993): Connection reset by peer
this definitely indicates a sequencing bug in mbsync
actually, i misread the log. the next command is sent only after the
command continuation request, so everything seems right (you can verify
that with -DN when using the 1.2 branch).

is this always happening with the same message?
take the {8355} as a hint, verify with -Ds.
if the problem is the message's content, -DN will help with that, too.
William Napier
2017-04-24 09:48:49 UTC
Permalink
Post by Jos van den Oever
Hi,
I'm trying to push to an IMAP server and the connection is reset by peer. I'm
wondering if this can be avoided. The configuration is added below and the
redacted output of running with -D is attached.
Cheers,
Jos
```
$ mbsync -D --config mbsyncrc --push --full MAIL
new message 1213 on slave
-> pair(-2,1213) exists
-> pushing message, TUID fFzb1tNbHJO+
synchronizing flags
propagating new messages
5 APPEND "INBOX" (\Seen \Deleted) "30-Jun-2016 08:40:53 +0200" {8355}
+ send literal data
(1 in progress) >>> 6 APPEND "INBOX" (\Deleted) "30-Jun-2016 08:40:53 +0200"
{9806}
Socket error from _____._______.nl (__.___.___.___:993): Connection reset by
peer
```
`mbsyncrc`
```
IMAPAccount MAIL
Host _____._______.nl
User user
Pass pass
Port 993
SSLType IMAPS
AuthMechs *
IMAPStore MAIL-remote
Account MAIL
MaildirStore MAIL-local
Path ~/imap/MAIL/
Inbox ~/imap/MAIL/Inbox
Trash ~/imap/MAIL/Trash
Channel MAIL
Patterns *
Patterns % !Trash
Create Both
ExpireUnread no
CopyArrivalDate yes
```<mbsync.log>------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot_______________________________________________
isync-devel mailing list
https://lists.sourceforge.net/lists/listinfo/isync-devel
Loading...