Skip to content

email support only works for small email bodies #127

Description

@tarasglek

I tried sending email with a small attachment and it failed:

{"time":"2025-10-12T12:01:04.419338607Z","level":"ERROR","msg":"failed to send email","error":"fork/exec /usr/local/bin/deno: argument list too long"}

Turns out we send email body inside json passed on cmdline:

execve("/usr/local/bin/deno", ["/usr/local/bin/deno", "run", "--allow-net", "--allow-import", "--allow-env", "--allow-sys", "--no-prompt", "--quiet", "--allow-read=/smallweb/email-body,/usr/local/bin/deno,/home/smallweb/.cache/deno/npm/registry.npmjs.org", "--allow-write=/smallweb/email-body/data", "/home/smallweb/.cache/smallweb/sandbox/0.28.3/mod.ts", "{\"command\":\"email\",\"entrypoint\":\"file:///smallweb/email-body/main.ts\",\"msg\":\".....lots of bytes here

i think we could change mod.ts to take it via stdin or tmpfile, what do you think? I think tmpfile makes most sense since reading email into ram by golang isn't good for OOM either, eg if attachment is a video.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions