diff --git a/mypy/semanal.py b/mypy/semanal.py
--- a/mypy/semanal.py
+++ b/mypy/semanal.py
@@ -1758,6 +1758,8 @@ def visit_import_from(self, imp: ImportFrom) -> None:
                 # precedence, but doesn't seem to be important in most use cases.
                 node = SymbolTableNode(GDEF, self.modules[fullname])
             else:
+                if id == as_id == '__all__' and module_id in self.export_map:
+                    self.all_exports[:] = self.export_map[module_id]
                 node = module.names.get(id)
 
             missing_submodule = False

diff --git a/test-data/unit/check-modules.test b/test-data/unit/check-modules.test
--- a/test-data/unit/check-modules.test
+++ b/test-data/unit/check-modules.test
@@ -2825,3 +2825,21 @@ from mystery import a, b as b, c as d
 [out]
 tmp/stub.pyi:1: error: Cannot find implementation or library stub for module named "mystery"
 tmp/stub.pyi:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+
+[case testReExportAllInStub]
+from m1 import C
+from m1 import D  # E: Module "m1" has no attribute "D"
+C()
+C(1)  # E: Too many arguments for "C"
+[file m1.pyi]
+from m2 import *
+[file m2.pyi]
+from m3 import *
+from m3 import __all__ as __all__
+class D: pass
+[file m3.pyi]
+from m4 import C as C
+__all__ = ['C']
+[file m4.pyi]
+class C: pass
+[builtins fixtures/list.pyi]

Cannot import names from six.moves.collections_abc
This produces an error with GitHub master and latest `types-six`:
```py
# Module "six.moves.collections_abc" has no attribute "Sequence"
from six.moves.collections_abc import Sequence
```

The problem is with how we handle this line in `stdlib/collections/abc.pyi`:
```py
from _collections_abc import __all__ as __all__
```

We should propagate the value of `__all__` (not just existence), but it doesn't happen right now.

mypy/test/testcheck.py::TypeCheckSuite::testReExportAllInStub