This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Description
There is a limit in linux that only allow certain amount of bytes in the argument of a single command
I'm not sure if this is an issue with my specific my environment but a 200KB attachment could break this limit
To reproduce
- mgc login
- generate a file that is ~ 200kb
- update the command in
contentBytes then run it
mgc users send-mail post \
--body '{
"message": {
"subject": "hi",
"body": {
"contentType": "text",
"content": "test"
},
"toRecipients": [
{
"emailAddress": {
"address": "[email protected]"
}
}
],
"attachments": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"name": "screenshot.png",
"contentBytes": "'"$(cat ./file.png | base64)"'",
"contentId": "screenshot"
}]
},
"saveToSentItems": "false"
}'
Fix
Allow user to supply the their --body payload in a separate file like what CURL did? see @filename in the below doc
https://everything.curl.dev/http/post/simple.html