Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/isleshocky77/google-mail-attachment-downloader

This script downloads all attachments from Google Mail (Gmail) Emails for a given query.
https://github.com/isleshocky77/google-mail-attachment-downloader

attachments downloader gmail google mail

Last synced: about 1 month ago
JSON representation

This script downloads all attachments from Google Mail (Gmail) Emails for a given query.

Awesome Lists containing this project

README

        

# Google Mail Attachment Downloader

This script downloads all attachments from Google Mail (Gmail) Emails for a given query.

## Installation

```shell
git clone https://github.com/isleshocky77/google-mail-attachment-downloader.git
cd google-mail-attachment-downloader
composer install
```

### Google Apps Authentication

You must create a [Google Cloud Application](https://console.cloud.google.com/), get the credentials and place them at `auth/credentials.json`.
On first run it will ask you to go a url to authorize the application with instructions.

## Usage

```shell
./bin/console -vvv gmail-file-downloader:download-attachments --query="label:emails-i-need"

# Multiple query criteria
./bin/console -vvv gmail-file-downloader:download-attachments --query="label:emails-i-need" --query="from:[email protected]"
```

### Continuing

The verbose email will print out page numbers with a page token. If you need to stop or there is an error
you can pick up where it left with the following

```shell
./bin/console -vvv gmail-file-downloader:download-attachments --query="label:emails-i-need" --starting-page-token=06638643197320647210
```

## Development

### Tools

```shell
./bin/php-cs-fixer fix
./bin/phpstan
./bin/phpmd src/ text phpmd.xml.dist
./bin/psalm --show-info=true
```