Added optional argument charset <Charset> to emlfile <FileName>

This commit is contained in:
Ross Scroggs
2024-01-07 21:38:02 -08:00
parent 3088570449
commit 0abf2ceeca
9 changed files with 48 additions and 33 deletions

View File

@@ -456,12 +456,6 @@
<Marker> ::= <String>
<MatterItem> ::= <UniqueID>|<String>
<MatterState> ::= open|closed|deleted
<MessageContent> ::=
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
(emlfile <FileName>)
<MessageID> ::= <String>
<Namespace> ::= <String>
<NotesName> ::= notes/<String>

View File

@@ -11,6 +11,11 @@ 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.67.08
Added optional argument `charset <Charset>` to `emlfile <FileName>` in `gam <UserTypeEntity> draft|import|insert message`;
the default value is `ascii`.
### 6.67.07
Updated `gam <UserTypeEntity> delete message` to handle this error:

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.67.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.67.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64
@@ -1002,7 +1002,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.67.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.67.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -54,8 +54,7 @@ Added the option `mailbox <EmailAddress>` to `gam sendemail` to allow specifying
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
(emlfile <FileName>)
(gcsdoc|gcshtml <StorageBucketObjectName>)
```
```
<Time> ::=

View File

@@ -171,8 +171,7 @@
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
(emlfile <FileName>)
```
(emlfile <FileName> [charset <Charset>]))
## Message queries with dates
```
query <QueryGmail> [querytime<String> <Date>]*
@@ -211,8 +210,8 @@ You can have GAM do the substitutions for you with the `matchlabel <LabelName>`
Add a draft message to a user's mailbox.
```
gam <UserTypeEntity> draft message
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
<MessageContent>
(attach <FileName> [charset <Charset>])*
(embedimage <FileName> <String>)*
```
@@ -221,7 +220,7 @@ gam <UserTypeEntity> draft message
* `file|htmlfile <FileName> [charset <Charset>]` - Read the message from `<FileName>`
* `gdoc|ghtml <UserGoogleDoc>` - Read the message from `<UserGoogleDoc>`
* `gcsdoc|gcshtml <StorageBucketObjectName>` - Read the message from the Google Cloud Storage file `<StorageBucketObjectName>`
* `emlfile <FileName>` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file.
* `emlfile <FileName> [charset <Charset>]` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file. The default `chatser` is `ascii`.
The `<SMTPDateHeader> <Time>` argument requires `<Time>` values which will be converted to RFC2822 dates. If you have these headers with values that
are not in `<Time>` format, use the argument `header <SMTPDateHeader> <String>`.
@@ -244,9 +243,9 @@ Your command line will have: `embedimage file1.jpg image1` embedimage file2.jpg
Import a message into a user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP.
```
gam <UserTypeEntity> import message
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
(addlabel <LabelName>)* [labels <LabelNameList>]
<MessageContent>
(attach <FileName> [charset <Charset>])*
(embedimage <FileName> <String>)*
[deleted [<Boolean>]] [checkspam [<Boolean>]] [processforcalendar [<Boolean>]]
@@ -257,7 +256,7 @@ gam <UserTypeEntity> import message
* `file|htmlfile <FileName> [charset <Charset>]` - Read the message from `<FileName>`
* `gdoc|ghtml <UserGoogleDoc>` - Read the message from `<UserGoogleDoc>`
* `gcsdoc|gcshtml <StorageBucketObjectName>` - Read the message from the Google Cloud Storage file `<StorageBucketObjectName>`
* `emlfile <FileName>` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message.
* `emlfile <FileName> [charset <Charset>]` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message. The default `chatser` is `ascii`.
When `emlfile` is not specified:
* If `to` is not specified, it is set to the user email addresses in `<UserTypeEntity>`.
@@ -292,9 +291,9 @@ Your command line will have: `embedimage file1.jpg image1` embedimage file2.jpg
Insert a message into a user's mailbox similar to IMAP APPEND, bypassing most scanning and classification.
```
gam <UserTypeEntity> insert message
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
(addlabel <LabelName>)* [labels <LabelNameList>]
<MessageContent>
(attach <FileName> [charset <Charset>])*
(embedimage <FileName> <String>)*
[deleted [<Boolean>]]
@@ -305,7 +304,7 @@ gam <UserTypeEntity> insert message
* `file|htmlfile <FileName> [charset <Charset>]` - Read the message from `<FileName>`
* `gdoc|ghtml <UserGoogleDoc>` - Read the message from `<UserGoogleDoc>`
* `gcsdoc|gcshtml <StorageBucketObjectName>` - Read the message from the Google Cloud Storage file `<StorageBucketObjectName>`
* `emlfile <FileName>` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file.
* `emlfile <FileName> [charset <Charset>]` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file. The default `chatser` is `ascii`.
When `emlfile` is not specified:
* If `to` is not specified, it is set to the user email addresses in `<UserTypeEntity>`.

View File

@@ -4,7 +4,7 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.67.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.67.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
@@ -16,7 +16,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.67.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.67.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
@@ -28,7 +28,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.67.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.67.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.67.07
Latest: 6.67.08
echo $?
1
```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.67.07
6.67.08
```
In Linux/MacOS you can do:
```
@@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 6.67.07 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.67.08 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64

View File

@@ -480,8 +480,7 @@ If an item contains spaces, it should be surrounded by ".
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
(emlfile <FileName>)
(gcsdoc|gcshtml <StorageBucketObjectName>)
<MessageID> ::= <String>
<Namespace> ::= <String>
<NotesName> ::= notes/<String>
@@ -4412,6 +4411,12 @@ gam print schema|schemas [todrive <ToDriveAttribute>*]
# Send Email
<MessageContent> ::=
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
gam sendemail [recipient|to] <RecipientEntity>
[from <EmailAddress>] [mailbox <EmailAddress>] [replyto <EmailAddress>]
[cc <RecipientEntity>] [bcc <RecipientEntity>] [singlemessage]
@@ -6932,22 +6937,29 @@ gam <UserTypeEntity> print labels|label [todrive <ToDriveAttribute>*]
x400-trace
<SMTPHeaderList> ::= "<SMTPDateHeader>|<SMTPHeader>(,<SMTPDateHeader>|<SMTPHeader>)*"
<MessageContent> ::=
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)|
(emlfile <FileName> [charset <Charset>])
gam <UserTypeEntity> draft message
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
(attach <FileName> [charset <CharSet>])*
(embedimage <FileName> <String>)*
gam <UserTypeEntity> import message
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
(addlabel <LabelName>)* [labels <LabelNameList>]
<MessageContent> (replace <Tag> <UserReplacement>)*
(attach <FileName> [charset <CharSet>])*
(embedimage <FileName> <String>)*
[deleted [<Boolean>]] [checkspam|nevermarkspam [<Boolean>]] [processforcalendar [<Boolean>]]
gam <UserTypeEntity> insert message
<MessageContent> (replace <Tag> <UserReplacement>)*
(<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
(addlabel <LabelName>)* [labels <LabelNameList>]
<MessageContent> (replace <Tag> <UserReplacement>)*
(attach <FileName> [charset <CharSet>])*
(embedimage <FileName> <String>)*
[deleted [<Boolean>]]

View File

@@ -2,6 +2,11 @@
Merged GAM-Team version
6.67.08
Added optional argument `charset <Charset>` to `emlfile <FileName>` in `gam <UserTypeEntity> draft|import|insert message`;
the default value is `ascii`.
6.67.07
Updated `gam <UserTypeEntity> delete message` to handle this error:

View File

@@ -66261,7 +66261,8 @@ def _draftImportInsertMessage(users, operation):
emlFile = False
elif myarg == 'emlfile':
filename = getString(Cmd.OB_FILE_NAME)
msgText = readFile(filename, encoding='ascii')
encoding = getString(Cmd.OB_CHAR_SET) if checkArgumentPresent('charset') else 'ascii'
msgText = readFile(filename, encoding=encoding)
emlFile = True
internalDateSource = 'dateHeader'
elif myarg == 'replace':
@@ -66400,17 +66401,17 @@ def _draftImportInsertMessage(users, operation):
entityActionFailedWarning([Ent.USER, user], str(e), i, count)
# gam <UserTypeEntity> draft message
# (<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
# <MessageContent> (replace <Tag> <UserReplacement>)*
# (<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
# (attach <FileName> [charset <CharSet>])*
# (embedimage <FileName> <String>)*
def draftMessage(users):
_draftImportInsertMessage(users, 'draft')
# gam <UserTypeEntity> import message
# <MessageContent> (replace <Tag> <UserReplacement>)*
# (<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
# (addlabel <LabelName>)* [labels <LabelNameList>]
# <MessageContent> (replace <Tag> <UserReplacement>)*
# (attach <FileName> [charset <CharSet>])*
# (embedimage <FileName> <String>)*
# [deleted [<Boolean>]] [nevermarkspam [<Boolean>]] [processforcalendar [<Boolean>]]
@@ -66418,9 +66419,9 @@ def importMessage(users):
_draftImportInsertMessage(users, 'import')
# gam <UserTypeEntity> insert message
# <MessageContent> (replace <Tag> <UserReplacement>)*
# (<SMTPDateHeader> <Time>)* (<SMTPHeader> <String>)* (header <String> <String>)*
# (addlabel <LabelName>)* [labels <LabelNameList>]
# <MessageContent> (replace <Tag> <UserReplacement>)*
# (attach <FileName> [charset <CharSet>])*
# (embedimage <FileName> <String>)*
# [deleted [<Boolean>]]