K9 fetches mail on wifi, but not reliably on cell

My email is on my private servers and I have an OpenVPN tunnel for k9mail on our Android phones.

When using OpenVPN I am able to send from k9mail whether connected through cellular network or wifi. However when on cellular network I am usually unable to fetch mail - I can only reliably fetch mail when on wifi. This is all the more annoying because occasionally it does fetch when on cellular, nost not reliably.

OpenVPN is making the tunnel whether on cellular network or wifi. My outgoing server is Postfix and my imap server is Dovecot, both those and my OpenVPN endpoint are running on Gentoo Linux.

I thought I had some setting wrong on the phone, but I validated that k9mail had full access to data even when Data Saver was active.

When you say you are unable to fetch which error do you get?

I had a problem with the same symptoms while in Yellowknife. It turned out I was at the edge of the cell towers range. when I was in the back of the house it would not work properly. I had to be in the front of the house. It also had to be decent weather.
This also caused delays with sending/receiving texts.
I wound up just keeping my phone on the wireless LAN for email… had to just deal with the texts.

No error, the little indicator keeps spinning and spinning, and at some point I have to get back to the real world.
To put it more simply, when I’m at home and the phone is on my LAN and desk, an email will show up on Thunderbird and within a minute the phone will give a notification sound. (Is this “push”? (or poll)) Same thing when I’m on wifi. And once in a blue moon on cell. I normally don’t have to tell it to fetch, it usually just shows up.
If there is a logfile and you can point me to it I can take a look.

I’ve had it fail to work standing at the base of a cell tower.
I’ve had it work (one of three times in recent history) with 1.5 bars in my living room.

Ah well… just a thought. luck.

General Settings / Debugging / Enable Debug Loging

And when the issue occurs gobtobsame menu and click 3buttons-menu. There you can export log

If you are on a mobile IPv6 connection, ignore this post…

Your mobile network operator may use internal NAT due to lack of IPv4 addresses.

OpenVPN maps any port to the VPN connection. Thus, you might end up in a double NAT connection. This always leads to problems.

Are you able to activate TURN (Traversal Using Relays around NAT) for your connection?

OpenVPN says it has established a connection, and I have the little key up in the status area. Outgoing mail works just fine also, as sent by k9mail to the postfix server in my basement. I’m in the cellular backwater of Vermont, so I don’t always have enough signal at home to test this and have to go somewhere. My normal test consists of two emails, one from my gmail address to my home servers and the other from k9mail to my gmail address. From what I’ve seen, this latter path works reliably.

This is the first I’ve heard of TURN, I’ll start looking it up, and if you have a reference I’d be interested in seeing it.

1 Like

I’ll give that a try next time I’m able to test. As mentioned elsewhere, my cellular connection at home is not good, at best.