Physics of the magnetosphere door