After working with it a bit, here is what I got to work:
To get messages to be archived instead of being deleting using gMail and Mac OS Mail.app (tasks underlined):
- Gmail: Create a new trash folder for IMAP clients that won't delete messages
- Settings > See All Settings > Forwarding and POP/IMAP > IMAP access
- Enable IMAP and Save Changes
- Settings > See All Settings > Labels > Labels
- Create new label called "IMAP Trash"
- Enable "Show in IMAP"
- Select "hide" in label list
- Settings > See All Settings > Labels > System Labels
- Disable "Show in IMAP" for "Trash" system label
- Mac OS Mail : send messages to new trash folder upon delete
- Set Trash mailbox to "IMAP Trash"
- Note: This will change the "IMAP Trash" label to "Trash" within Mail.app (it is still called "IMAP Trash in Gmail). If you didn't "hide" the system "Trash" label to IMAP within Gmail settings, you will see two "Trash" folders in Mail.app now.
- Ensure "Erase Deleted Messages" is set to "Never"
- Viewing
- Enable "Move discarded messages into Archive"
- Note: "All Mail" in Gmail is called "Archive" on Mail.app
Resulting message lifecycle in Mail.app:
- A message is received
- It exists in "Inbox" folder
- It exists in the "Archive" folder ("All Mail" on gMail)
- The message is deleted
- It is no longer in the Inbox
- It is still in the Archive Folder ("All Mail" on gMail)
- It is in the "Trash" folder ("IMAP Trash" on gMail)
- It will NOT be automatically deleted by gMail