repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | # Message Composition with MML (MIME Meta Language) |
| #2 | |
| #3 | Himalaya uses MML for composing emails. MML is a simple XML-based syntax that compiles to MIME messages. |
| #4 | |
| #5 | ## Basic Message Structure |
| #6 | |
| #7 | An email message is a list of **headers** followed by a **body**, separated by a blank line: |
| #8 | |
| #9 | ``` |
| #10 | From: sender@example.com |
| #11 | To: recipient@example.com |
| #12 | Subject: Hello World |
| #13 | |
| #14 | This is the message body. |
| #15 | ``` |
| #16 | |
| #17 | ## Headers |
| #18 | |
| #19 | Common headers: |
| #20 | - `From`: Sender address |
| #21 | - `To`: Primary recipient(s) |
| #22 | - `Cc`: Carbon copy recipients |
| #23 | - `Bcc`: Blind carbon copy recipients |
| #24 | - `Subject`: Message subject |
| #25 | - `Reply-To`: Address for replies (if different from From) |
| #26 | - `In-Reply-To`: Message ID being replied to |
| #27 | |
| #28 | ### Address Formats |
| #29 | |
| #30 | ``` |
| #31 | To: user@example.com |
| #32 | To: John Doe <john@example.com> |
| #33 | To: "John Doe" <john@example.com> |
| #34 | To: user1@example.com, user2@example.com, "Jane" <jane@example.com> |
| #35 | ``` |
| #36 | |
| #37 | ## Plain Text Body |
| #38 | |
| #39 | Simple plain text email: |
| #40 | ``` |
| #41 | From: alice@localhost |
| #42 | To: bob@localhost |
| #43 | Subject: Plain Text Example |
| #44 | |
| #45 | Hello, this is a plain text email. |
| #46 | No special formatting needed. |
| #47 | |
| #48 | Best, |
| #49 | Alice |
| #50 | ``` |
| #51 | |
| #52 | ## MML for Rich Emails |
| #53 | |
| #54 | ### Multipart Messages |
| #55 | |
| #56 | Alternative text/html parts: |
| #57 | ``` |
| #58 | From: alice@localhost |
| #59 | To: bob@localhost |
| #60 | Subject: Multipart Example |
| #61 | |
| #62 | <#multipart type=alternative> |
| #63 | This is the plain text version. |
| #64 | <#part type=text/html> |
| #65 | <html><body><h1>This is the HTML version</h1></body></html> |
| #66 | <#/multipart> |
| #67 | ``` |
| #68 | |
| #69 | ### Attachments |
| #70 | |
| #71 | Attach a file: |
| #72 | ``` |
| #73 | From: alice@localhost |
| #74 | To: bob@localhost |
| #75 | Subject: With Attachment |
| #76 | |
| #77 | Here is the document you requested. |
| #78 | |
| #79 | <#part filename=/path/to/document.pdf><#/part> |
| #80 | ``` |
| #81 | |
| #82 | Attachment with custom name: |
| #83 | ``` |
| #84 | <#part filename=/path/to/file.pdf name=report.pdf><#/part> |
| #85 | ``` |
| #86 | |
| #87 | Multiple attachments: |
| #88 | ``` |
| #89 | <#part filename=/path/to/doc1.pdf><#/part> |
| #90 | <#part filename=/path/to/doc2.pdf><#/part> |
| #91 | ``` |
| #92 | |
| #93 | ### Inline Images |
| #94 | |
| #95 | Embed an image inline: |
| #96 | ``` |
| #97 | From: alice@localhost |
| #98 | To: bob@localhost |
| #99 | Subject: Inline Image |
| #100 | |
| #101 | <#multipart type=related> |
| #102 | <#part type=text/html> |
| #103 | <html><body> |
| #104 | <p>Check out this image:</p> |
| #105 | <img src="cid:image1"> |
| #106 | </body></html> |
| #107 | <#part disposition=inline id=image1 filename=/path/to/image.png><#/part> |
| #108 | <#/multipart> |
| #109 | ``` |
| #110 | |
| #111 | ### Mixed Content (Text + Attachments) |
| #112 | |
| #113 | ``` |
| #114 | From: alice@localhost |
| #115 | To: bob@localhost |
| #116 | Subject: Mixed Content |
| #117 | |
| #118 | <#multipart type=mixed> |
| #119 | <#part type=text/plain> |
| #120 | Please find the attached files. |
| #121 | |
| #122 | Best, |
| #123 | Alice |
| #124 | <#part filename=/path/to/file1.pdf><#/part> |
| #125 | <#part filename=/path/to/file2.zip><#/part> |
| #126 | <#/multipart> |
| #127 | ``` |
| #128 | |
| #129 | ## MML Tag Reference |
| #130 | |
| #131 | ### `<#multipart>` |
| #132 | Groups multiple parts together. |
| #133 | - `type=alternative`: Different representations of same content |
| #134 | - `type=mixed`: Independent parts (text + attachments) |
| #135 | - `type=related`: Parts that reference each other (HTML + images) |
| #136 | |
| #137 | ### `<#part>` |
| #138 | Defines a message part. |
| #139 | - `type=<mime-type>`: Content type (e.g., `text/html`, `application/pdf`) |
| #140 | - `filename=<path>`: File to attach |
| #141 | - `name=<name>`: Display name for attachment |
| #142 | - `disposition=inline`: Display inline instead of as attachment |
| #143 | - `id=<cid>`: Content ID for referencing in HTML |
| #144 | |
| #145 | ## Composing from CLI |
| #146 | |
| #147 | ### Interactive compose |
| #148 | Opens your `$EDITOR`: |
| #149 | ```bash |
| #150 | himalaya message write |
| #151 | ``` |
| #152 | |
| #153 | ### Reply (opens editor with quoted message) |
| #154 | ```bash |
| #155 | himalaya message reply 42 |
| #156 | himalaya message reply 42 --all # reply-all |
| #157 | ``` |
| #158 | |
| #159 | ### Forward |
| #160 | ```bash |
| #161 | himalaya message forward 42 |
| #162 | ``` |
| #163 | |
| #164 | ### Send from stdin |
| #165 | ```bash |
| #166 | cat message.txt | himalaya template send |
| #167 | ``` |
| #168 | |
| #169 | ### Prefill headers from CLI |
| #170 | ```bash |
| #171 | himalaya message write \ |
| #172 | -H "To:recipient@example.com" \ |
| #173 | -H "Subject:Quick Message" \ |
| #174 | "Message body here" |
| #175 | ``` |
| #176 | |
| #177 | ## Tips |
| #178 | |
| #179 | - The editor opens with a template; fill in headers and body. |
| #180 | - Save and exit the editor to send; exit without saving to cancel. |
| #181 | - MML parts are compiled to proper MIME when sending. |
| #182 | - Use `himalaya message export --full` to inspect the raw MIME structure of received emails. |
| #183 |