If you don't want to go to the trouble of 3rd parties (all probably excellent) or running your own imap server and synchronizing to it with larch (probably excellent) or other synch solutions,
If you use Thunderbird then you have a low barrier to entry and low cognitive load solution.
[Tools|Edit]Account Settings, then click Synchronization and Storage for you gmail account (or any other account),
then check Keep messages and click on Advanced. Then check the folders that you want to synch. The most sensible one for gmail is [Gmail]/All Mail.
Now Tbird will make a copy of all your messages in All Mail.
Caveat: I have found that the copy isn't made until you click on the All Mail folder in your folder list. Tradeoff between getting something OK working in two minutes, and the time for whatever other solution.
If you use Thunderbird then you have a low barrier to entry and low cognitive load solution.
[Tools|Edit]Account Settings, then click Synchronization and Storage for you gmail account (or any other account),
then check Keep messages and click on Advanced. Then check the folders that you want to synch. The most sensible one for gmail is [Gmail]/All Mail.
Now Tbird will make a copy of all your messages in All Mail.
Caveat: I have found that the copy isn't made until you click on the All Mail folder in your folder list. Tradeoff between getting something OK working in two minutes, and the time for whatever other solution.