メインコンテンツにスキップ

MailCat

Auto Gmail Rules Manager

AI Summary

MailCat

A Google Apps Script that automatically labels, organizes, deletes and backs up Gmail messages from multiple banks and e-payment services.

Target Users

Beginner-to-intermediate GAS users who hold several online bank/e-payment accounts and want Gmail statements to be organized automatically.

Problems Solved

Manually creating filters and managing the flood of bank / payment notifications in Gmail is time-consuming and error-prone.

Tags

Main Features

1
Automatic labeling of bank/payment emails

The Bank_Label function inspects sender/subject and applies Gmail labels based on user-defined bank codes.

2
Scheduled auto-deletion

Bank_AutoRemove moves login alerts and other low-value messages to Trash after a user-defined number of days.

3
Automatic archiving of transactions

Bank_AutoArchive archives processed transaction messages, keeping them searchable but out of the inbox.

4
Save e-statement attachments to Drive

Bank_AutoSave backs up e-statement attachments to a designated folder in Google Drive.

Usage Examples

Label bank notification emails

The snippet below sets your own bank list and invokes Bank_Label() to organize the inbox.

/**
 * 1) Define the bank codes you use
 * 2) Run Bank_Label() manually or via trigger
 */
function setupAndLabel() {
  // Override the array defined in bank.gs
  var BankList_Own = ['008', '013', '803']; // 008=Hua Nan, 013=Cathay, 803=Union Bank

  // Label the latest 100 threads in the inbox (Bank_Label is implemented in the library)
  Bank_Label();
}

Add this to your Apps Script project and run setupAndLabel, or bind it to an hourly trigger for continuous automatic labeling.