Update sendemail and notify email address lists

This commit is contained in:
Ross Scroggs
2024-04-01 19:36:12 -07:00
parent 0a21f2c959
commit 1ba9f73fbd
6 changed files with 38 additions and 16 deletions

View File

@@ -114,6 +114,10 @@ Verify whether the super admin you'll be using is in an OU where reauthenticatio
* Click "OVERRIDE"
* Follow the steps below to mark GAM as a trusted app
Additional steps may be required if errors are encountered.
* [Authorize a super admin to create projects](#authorize-a-super-admin-to-create-projects)
* [Authorize GAM to create projects](#authorize-gam-to-create-projects)
## Headless computers and Cloud Shells
With many thanks to Jay, `gam oauth create` now uses a new client access authentication flow
as required by Google for headless computers/cloud shells; this is required as of February 28, 2022.

View File

@@ -10,6 +10,14 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
### 6.72.06
Updated the following commands to properly handle emailaddress lists containing addresses of the form: `'First Last<firstlast@domain.com>'`.
```
gam <UserTypeEntity> sendemail recipient|to <RecipientEntity> [cc <RecipientEntity>] [bcc <RecipientEntity>] [singlemessage]
gam create|update user ... notify <EmailAddressList>
```
### 6.72.05
Cleaned up code for all commands that display Chat objects.

View File

@@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.72.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.72.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
MacOS Sonoma 14.2.1 x86_64
@@ -1006,7 +1006,7 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.72.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.72.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.72.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.72.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
MacOS Sonoma 14.2.1 x86_64
@@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information
```
gam version timeoffset
GAMADV-XTD3 6.72.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.72.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
MacOS Sonoma 14.2.1 x86_64
@@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information
```
gam version extended
GAMADV-XTD3 6.72.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.72.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
MacOS Sonoma 14.2.1 x86_64
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.72.05
Latest: 6.72.06
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.72.05
6.72.06
```
In Linux/MacOS you can do:
```
@@ -82,7 +82,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 6.72.05 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.72.06 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.2 64-bit final
MacOS Sonoma 14.2.1 x86_64

View File

@@ -2,6 +2,14 @@
Merged GAM-Team version
6.72.06
Updated the following commands to properly handle emailaddress lists containing addresses of the form: `'First Last<firstlast@domain.com>'`.
```
gam <UserTypeEntity> sendemail recipient|to <RecipientEntity> [cc <RecipientEntity>] [bcc <RecipientEntity>] [singlemessage]
gam create|update user ... notify <EmailAddressList>
```
6.72.05
Cleaned up code for all commands that display Chat objects.

View File

@@ -14533,7 +14533,7 @@ def doSendEmail(users=None):
if checkArgumentPresent('select'):
_, recipients = getEntityToModify(defaultEntityType=Cmd.ENTITY_USERS)
return [normalizeEmailAddressOrUID(emailAddress, noUid=True) for emailAddress in recipients]
return getNormalizedEmailAddressEntity()
return getNormalizedEmailAddressEntity(shlexSplit=True)
body = {}
notify = {'subject': '', 'message': '', 'html': False, 'charset': UTF8, 'password': ''}
@@ -41205,7 +41205,7 @@ def getUserAttributes(cd, updateCmd, noUid=False):
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if myarg == 'notify':
notify['recipients'] = getNormalizedEmailAddressEntity()
notify['recipients'] = getNormalizedEmailAddressEntity(shlexSplit=True)
elif myarg == 'subject':
notify['subject'] = getString(Cmd.OB_STRING)
elif myarg in SORF_MSG_FILE_ARGUMENTS:
@@ -57799,7 +57799,8 @@ def moveDriveFile(users):
GAPI.TARGET_USER_ROLE_LIMITED_BY_LICENSE_RESTRICTION,
GAPI.CANNOT_MOVE_TRASHED_ITEM_INTO_TEAMDRIVE,
GAPI.CANNOT_MOVE_TRASHED_ITEM_OUT_OF_TEAMDRIVE,
GAPI.CROSS_DOMAIN_MOVE_RESTRICTION],
GAPI.CROSS_DOMAIN_MOVE_RESTRICTION,
GAPI.STORAGE_QUOTA_EXCEEDED],
fileId=folderId,
addParents=newParentId, removeParents=removeParents,
body=body, fields=None, supportsAllDrives=True)
@@ -57811,7 +57812,7 @@ def moveDriveFile(users):
except (GAPI.badRequest, GAPI.insufficientParentPermissions, GAPI.fileOwnerNotMemberOfTeamDrive, GAPI.fileOwnerNotMemberOfWriterDomain,
GAPI.fileWriterTeamDriveMoveInDisabled, GAPI.targetUserRoleLimitedByLicenseRestriction,
GAPI.cannotMoveTrashedItemIntoTeamDrive, GAPI.cannotMoveTrashedItemOutOfTeamDrive,
GAPI.crossDomainMoveRestriction) as e:
GAPI.crossDomainMoveRestriction, GAPI.storageQuotaExceeded) as e:
entityActionFailedWarning([Ent.USER, user, Ent.DRIVE_FOLDER, folderName], str(e), j, jcount)
except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
userSvcNotApplicableOrDriveDisabled(user, str(e), i, count)
@@ -57926,20 +57927,21 @@ def moveDriveFile(users):
GAPI.CANNOT_MOVE_TRASHED_ITEM_INTO_TEAMDRIVE,
GAPI.CANNOT_MOVE_TRASHED_ITEM_OUT_OF_TEAMDRIVE,
GAPI.TEAMDRIVES_SHORTCUT_FILE_NOT_SUPPORTED,
GAPI.CROSS_DOMAIN_MOVE_RESTRICTION],
GAPI.CROSS_DOMAIN_MOVE_RESTRICTION,
GAPI.STORAGE_QUOTA_EXCEEDED],
fileId=childId, addParents=newParentId, removeParents=removeParents,
body=body, fields='', supportsAllDrives=True)
entityModifierItemValueListActionPerformed(kvList, Act.MODIFIER_TO,
[Ent.DRIVE_FOLDER, newParentNameId, entityType, f'{newChildName}({childId})'],
k, kcount)
_incrStatistic(statistics, STAT_FILE_COPIED_MOVED)
return
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.unknownError, GAPI.badRequest,
GAPI.targetUserRoleLimitedByLicenseRestriction,
GAPI.cannotMoveTrashedItemIntoTeamDrive, GAPI.cannotMoveTrashedItemOutOfTeamDrive,
GAPI.teamDrivesShortcutFileNotSupported) as e:
GAPI.teamDrivesShortcutFileNotSupported, GAPI.storageQuotaExceeded) as e:
entityActionFailedWarning(kvList, str(e), k, kcount)
_incrStatistic(statistics, STAT_FILE_FAILED)
copyMoveOptions['retainSourceFolders'] = True
except (GAPI.insufficientFilePermissions, GAPI.insufficientParentPermissions,
GAPI.fileOwnerNotMemberOfTeamDrive, GAPI.fileOwnerNotMemberOfWriterDomain,
GAPI.fileWriterTeamDriveMoveInDisabled,
@@ -57949,7 +57951,7 @@ def moveDriveFile(users):
_incrStatistic(statistics, STAT_FILE_FAILED)
else:
_makeMoveShortcut(drive, user, k, kcount, entityType, childId, childName, newParentId, newParentName)
copyMoveOptions['retainSourceFolders'] = True
copyMoveOptions['retainSourceFolders'] = True
def _recursiveFolderMove(drive, user, i, count, j, jcount,
source, targetChildren, newFolderName, newParentId, newParentName, mergeParentModifiedTime, atTop):