All doors lock automatically when the lock side is pressed. They unlock when the unlock side is pressed.
Driver's door

Front passenger's door

To lock all the doors from an open front door, press the lock side of the door lock switch and then close the door.
NOTE
When locking the doors this way, be careful not to leave the key inside the vehicle.
Locking, Unlocking with Transmitter
Auto Lock/Unlock FunctionMazda 6 Owners Manual: Dual proportioning valve replacement (without abs)
1. Remove in the order indicated in the table.
2. Install in the reverse order of removal.
Dual Proportioning Valve Installation Note
Install the dual proportioning valve so that the R mark faces the left side
of the vehicle.
...
Mazda 6 Owners Manual: Solenoid valve removal/installation
1. Disconnect the negative battery cable.
2. Remove the under cover.
3. Remove the control valve body. (See CONTROL VALVE BODY REMOVAL.)
4. Remove the solenoid valve(s).
5. Apply ATF to a new O-ring and install it on the solenoid valve.
6. Install the solenoid valve in the control valve body. ...