jberkel / sms-backup-plus

Backup Android SMS, MMS and call log to Gmail / Gcal / IMAP
https://play.google.com/store/apps/details?id=com.zegoggles.smssync
Apache License 2.0
1.79k stars 497 forks source link

network I/O error #1087

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello. I am adding a Gmail account to SMS Backup+ using the IMAP way. I meet a I/O error and cannot sync messages. What's I/O error and how to fix it?

The IMAP setting on Gmail is on. I see the app password of Google is in using. The IMAP address is imap.gmail.com:993. Everything looks good. What's the problem?

IMG_20220917_223103

IMG_20220917_224750

kurahaupo commented 1 year ago

Thanks for the report.

"IO Error" simply means that the program received an unexpected response from Android when it asked to send or receive data, either from a local file or over the network.

"Unable to connect" and "end of stream reached" indicate that a network connection rather than a local file was a fault, but don't really help to narrow the problem down any further.

Does this happen every time, some of the time, or just once?

Was your WiFi working correctly at the time? Does your device have a recent release of Android?

ghost commented 1 year ago

@kurahaupo I am living in a country where Google, Twitter, Facebook are blocked. I have to use a VPN service to visit the internet on my phone. This app may not be able to detect VPN. Other apps work well on my phone. I don't know how to fix it.

kurahaupo commented 1 year ago

That definitely could cause those symptoms. I'm afraid I'm not entirely sure how an in-phone VPN normally works.

Perhaps the VPN only diverts HTTPS & DNS traffic, which would miss the IMAP connections.

Is there anything in the configuration of the VPN about choosing "ports" or "traffic types" or "protocols?

ghost commented 1 year ago

@kurahaupo The default settings is good. All apps work well and be able to visit the internet. Only this one has a error. I am afraid it want to connect to the internet directly and be stopped by the firewall.

kurahaupo commented 1 year ago

A properly-working VPN should not require any changes to client programs.

The majority of apps only need web access, if anything, but SMS Backup+ uses IMAP, which is a separate protocol, not part of HTTP or HTTPS.

So "only this one has an error" is not proof that it's at fault.

We also need to consider:

Although we are looking for "blocking IMAP", this might be phrased as "blocking TCP ports 143 and/or 993", or "blocking email", or "blocking everything except" (some list of other ports or services). Please confirm that you've checked what the "default settings" for your VPN actually provide, at this level of detail. If you find it difficult to confirm these, can you at least say which VPN client you're using (and its version)?

Have you confirmed that your VPN provider isn't blocking "email"? You might need to email them and ask them to unblock email. (Such blocking is commonly done to prevent blacklisting, since their customers' devices get compromised by spammers.)

Personally I would test end-to-end functionality by installing a telnet client and trying to connect to imap.gmail.com:143; if it fails to connect then at least the error message will be a little more informative.

Even the timing of the response will be informative: if it takes less than 0.01 seconds that indicates that the problem is almost certainly on your device; if it takes longer than 0.1 seconds, then it's being blocked out on the internet somewhere. (Visually that's the difference between "apparently simultaneous" and "the tiniest perceptible delay".)

ghost commented 1 year ago

Hello, @kurahaupo, thank your for your reply all the time. I may fix it.

I have over 1000 messages and call logs on my phone. Maybe there are too many items to backup at one time. I choose to backup 100 items each time in the Settings. It works. It's not perfect. At least it works for me right now.

I am using a proxy client which called Shadowsocks R. I don't know if you hear it. photo_2022-09-29_09-12-14 photo_2022-09-29_09-12-11