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

attachment in send-email is causing an error "argument list too long" in docker #459

@brotherko

Description

@brotherko

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

  1. mgc login
  2. generate a file that is ~ 200kb
  3. 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions