How to sync mac mail app with only unarchived/recent gmail messages
You can't limit it to the last 50 messages, but you can limit it to the last 1000 messages in each "folder" (label).


Go to the Gmail website and click on the gear icon to the top-right side.
Click on Settings.
Click on the "Forwarding and IMAP/POP" tab across the top of the Settings area.
Towards the bottom of the IMAP section, change the "Folder Size Limit" setting to "Limit IMAP folders to contain no more than this many messages". By default 1000 is selected, though you can also choose 2000, 5000, or 10000.
Click Save Changes at the bottom.