Can't connect to Gmail on stock email app using WiFi (works on mobile data)


Question

This is on an Xperia X Compact with Android 7.0. I get the error message "Can't establish server connection"1 when I want to sync my email while connected to my home WiFi.




  • Other IMAP accounts sync without a problem

  • Using the stock email app for Gmail worked fine on Marshmallow

  • Using Gmail in the stock email app works when I'm on mobile data (!)

  • Using other email apps (e.g. Gmail, K-9, BlueMail) to connect to Gmail while on WiFi works as well

  • I have been able to add the Gmail account and initially synchronize my emails on the same WiFi network without any problems

  • There is no error message under Accounts -> Google -> Synchronize Gmail



Things I have tried:




  • Deactivate and reactivate mail app

  • Clear data of the mail app

  • Remove and re-add Google account

  • Complete factory reset via Xperia Companion

  • Disable two-factor auth

  • Add Gmail manually as an IMAP account in the mail app

  • Allowed less secure apps in Gmail settings

  • Check Gmail's IMAP settings on Desktop (it's enabled)



I haven't had the opportunity to test it on a different network than my home WiFi yet, but to me this looks more like a software problem since all other email clients, as well as the initial setup worked fine? There are of course a number of obvious workarounds (use Gmail / other email client), but I would prefer the stock email app to work as it fits my needs best.






1 All error messages and descriptions of settings have been translated from German. Please edit if you know the exact English translations so other people with the same problem can find this question more easily.


Answer

As usual, I found the culprit minutes after posting this question when I battled with this problem for a week:



I use DNS66 for ad-blocking. Adding the email app to the exceptions and restarting the service solved the problem.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes