The sunshade can be opened and closed by hand.
The sunshade opens automatically when the moonroof is opened, but must be closed by hand.

CAUTION
Jam-safe Moonroof
Security SystemMazda 6 Owners Manual: Rear door speaker removal/installation
1. Disconnect the negative battery cable.
2. Remove the rear door trim.
3. Remove in the order indicated in the table.
4. Install in the reverse order of removal.
Rear Door Speaker Installation Note
Attach the speaker with the wiring harness placed in the groove of the door
unit panel.
...
Mazda 6 Owners Manual: Door adjustment
1. Measure the gap and height between the front or rear door and the body.
2. If not as specified, loosen the front or rear door hinge installation
bolts or the door lock striker installation screws, and reposition the door.
Clearance
a: 2.5-4.5 mm {0.10-0.18 in}
b: -0.8-1.2 mm {-0.03-0.0 ...