banner



How To Reset Gmail Account Settings

Your telephone, the iPad, and your laptop offer a 'hard reset' option that resets your device to the default manufacturing plant settings. Once yous perform a factory reset, it erases all the apps, files, and settings and in that location'due south no way to recover the wiped off data.

Nuke Gmail Account - Remove Everything

What is Gmail Manufacturing plant Reset

If you ever need to "factory reset" an old Gmail business relationship that you no longer apply, and outset afresh with a clean slate, Google Scripts can help. The script will perform a series of tasks to completely reset your Gmail account:

  1. Delete all Gmail labels
  2. Delete all Gmail filters
  3. Delete all Draft messages
  4. Delete all email messages in Gmail
  5. Delete all spam messages
  6. Permanently empty your Gmail trash folder
  7. Remove Out-of-Office message
  8. Disables Popular and IMAP
  9. Remove all email signatures in Gmail
  10. Stops all email forwarding

⚠️ Alert: Danger Ahead

Earlier yous proceed, delight sympathise that hard reset is an irreversible process and y'all will not exist able to recover your Gmail data afterwards the reset is complete.

The Google Script is bachelor on Github or you tin can click hither to brand a copy of the script in your Google account. The script uses the official Gmail API to format your Gmail account.

Remove all Gmail Labels

                          const              deleteGmailLabels              =              (              )              =>              {              GmailApp.              getUserLabels              (              )              .              forEach              (              (              label              )              =>              {              label.              deleteLabel              (              )              ;              }              )              ;              }              ;                      

Remove all Gmail Filters

                          const              deleteGmailFilters              =              (              )              =>              {              const              {              filter              :              gmailFilters              }              =              Gmail.Users.Settings.Filters.              listing              (              'me'              )              ;              gmailFilters.              forEach              (              (                              {                id                }                            )              =>              {              Gmail.Users.Settings.Filters.              remove              (              'me'              ,              id)              ;              }              )              ;              }              ;                      

Remove all Gmail Drafts

                          const              deleteGmailDrafts              =              (              )              =>              {              GmailApp.              getDrafts              (              )              .              forEach              (              (              draft              )              =>              {              draft.              deleteDraft              (              )              ;              }              )              ;              }              ;                      

Reset Gmail Settings

Plow off vacation autoresponders, disables IMAP and POP access, removes all e-mail signatures and disables email forwarding.

                          const              resetGmailSettings              =              (              )              =>              {              const              {              Settings              }              =              Gmail.Users;              // Disable Out-of-office              Settings.              updateVacation              (              {              enableAutoReply              :              false              }              ,              'me'              )              ;              // Delete Gmail Signatures              const              {              sendAs              }              =              Settings.SendAs.              list              (              'me'              )              ;              sendAs.              forEach              (              (                              {                sendAsEmail                }                            )              =>              {              Settings.SendAs.              update              (              {              signature              :              ''              }              ,              'me'              ,              sendAsEmail)              ;              }              )              ;              // Disable IMAP              Settings.              updateImap              (              {              enabled              :              faux              }              ,              'me'              )              ;              // Disable Popular              Settings.              updatePop              (              {              accessWindow              :              'disabled'              }              ,              'me'              )              ;              // Disable Auto Forwarding              const              {              forwardingAddresses              =              [              ]              }              =              Settings.ForwardingAddresses.              list              (              'me'              )              ;              forwardingAddresses.              forEach              (              (                              {                forwardingEmail                }                            )              =>              {              Settings.ForwardingAddresses.              remove              (              'me'              ,              forwardingEmail)              ;              }              )              ;              }              ;                      

Delete all Gmail Messages

This will motility all inbox messages, archived message, and spam to the trash binder. Google Scripts can execute for 5 minutes in one batch so we added a check to stop the script if information technology is taking longer to complete.

                          const              startTime              =              Date.              now              (              )              ;              const              isTimeLeft              =              (              )              =>              {              const              ONE_SECOND              =              1000              ;              const              MAX_EXECUTION_TIME              =              ONE_SECOND              *              60              *              5              ;              return              MAX_EXECUTION_TIME              >              Date.              now              (              )              -              startTime;              }              ;              /**  * Motion all Gmail threads to trash folder  */              const              deleteGmailThreads              =              (              )              =>              {              let              threads              =              [              ]              ;              do              {              threads              =              GmailApp.              search              (              'in:all'              ,              0              ,              100              )              ;              if              (threads.length              >              0              )              {              GmailApp.              moveThreadsToTrash              (threads)              ;              Utilities.              sleep              (              thousand              )              ;              }              }              while              (threads.length              &&              isTimeLeft              (              )              )              ;              }              ;              /**  * Movement all Spam e-mail messages to the Gmail Recyle bin  */              const              deleteSpamEmails              =              (              )              =>              {              let              threads              =              [              ]              ;              do              {              threads              =              GmailApp.              getSpamThreads              (              0              ,              x              )              ;              if              (threads.length              >              0              )              {              GmailApp.              moveThreadsToTrash              (threads)              ;              Utilities.              slumber              (              thou              )              ;              }              }              while              (threads.length              &&              isTimeLeft              (              )              )              ;              }              ;                      

Permanently Empty the Trash Folder

                          /**  * Permanetly empty the Trash folder  */              const              emptyGmailTrash              =              (              )              =>              {              let              threads              =              [              ]              ;              do              {              threads              =              GmailApp.              getTrashThreads              (              0              ,              100              )              ;              threads.              forEach              (              (              thread              )              =>              {              Gmail.Users.Threads.              remove              (              'me'              ,              thread.              getId              (              )              )              ;              }              )              ;              }              while              (threads.length              &&              isTimeLeft              (              )              )              ;              }              ;                      

Also run across: Annal Sometime Emails in Gmail

How To Reset Gmail Account Settings,

Source: https://www.labnol.org/code/gmail-factory-reset-200531

Posted by: brownthorm1936.blogspot.com

0 Response to "How To Reset Gmail Account Settings"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel