Skip to content

Users Gmail Forwarding

Kim Nilsson edited this page Jul 16, 2019 · 12 revisions

Users - Gmail - Forwarding

API documentation

Definitions

<FalseValues>= false|off|no|disabled|0
<TrueValues> ::= true|on|yes|enabled|1
<DomainName> ::= <String>(.<String>)+
<EmailAddress> ::= <String>@<DomainName>
<EmailAddressList> ::= "<EmailAddress>(,<EmailAddress>)*"
<EmailAddressEntity> ::= <EmailAddressList>|<FileSelector>|<CSVkmdSelector>|<CSVDataSelector>

Introduction

An email address must be defined as a forwarding address before it can be used to forward. A user can have multiple forwarding addresses, none or one of them can be active at a time.

Manage forwarding addresses

gam <UserTypeEntity> add forwardingaddress|forwardingaddresses <EmailAddressEntity>
gam <UserTypeEntity> delete forwardingaddress|forwardingaddresses <EmailAddressEntity>

Display forwarding addresses

gam <UserTypeEntity> info forwardingaddress|forwardingaddresses <EmailAddressEntity>
gam <UserTypeEntity> show forwardingaddress|forwardingaddresses
gam <UserTypeEntity> print forwardingaddress|forwardingaddresses [todrive <ToDriveAttribute>*]

Manage forwarding

gam <UserTypeEntity> forward <FalseValues>
gam <UserTypeEntity> forward <TrueValues> keep|leaveininbox|archive|delete|trash|markread <EmailAddress>

Display forwarding

gam <UserTypeEntity> show forward|forwards
gam <UserTypeEntity> print forward|forwards [enabledonly] [todrive <ToDriveAttribute>*]

  • enabledonly - Do not display users with forwarding disabled.

Here's an example of how to get a list of all users with forwarding enabled and send that list to a Google Sheet, and to use multiprocessing to speed it up a little. Limiting the number of parallel threads to 5 to not be rate-limited by the API.

gam config auto_batch_min 1 num_threads 5 redirect csv ./forwards.csv multiprocess all users print forwards enabledonly todrive

Update History

Installation

Configuration

Notes and Information

Definitions

Command Processing

Collections

Client Access

Special Service Account Access

Service Account Access

Clone this wiki locally