tessl install tessl/github-python--cpython@3.13.0CPython is the reference implementation of the Python programming language providing the core interpreter, runtime system, and comprehensive standard library.
Agent Success
Agent success rate when using this tile
96%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.07x
Baseline
Agent success rate without this tile
90%
Builds MIME emails, bridges HTTP requests to SMTP delivery, and parses inbound messages using the standard library's advanced networking features.
/send that accepts POST JSON payloads with email details, responds with HTTP 202 and a short JSON acknowledgement once the payload is queued for delivery, and triggers asynchronous send using the provided SMTP configuration. @test/send are rejected with HTTP 405. @test@generates
from dataclasses import dataclass
from typing import List, Optional, Dict, Any
@dataclass
class SMTPConfig:
host: str
port: int
username: str
password: str
use_tls: bool
timeout: float
@dataclass
class EmailPayload:
sender: str
to: List[str]
cc: Optional[List[str]]
subject: str
text_body: str
attachment_path: Optional[str] = None
@dataclass
class ParsedMessage:
subject: str
sender: str
recipients: List[str]
text_body: str
attachments: List[Dict[str, Any]]
class MailRelay:
def __init__(self, smtp: SMTPConfig, host: str = "127.0.0.1", port: int = 0):
...
async def start(self) -> int:
"""Starts HTTP listener, returning the bound port."""
async def stop(self) -> None:
"""Stops HTTP listener and pending deliveries."""
async def deliver(self, payload: EmailPayload) -> str:
"""Sends immediately via SMTP, returning a server acknowledgement string."""
def parse_eml(self, raw_message: bytes) -> ParsedMessage:
"""Parses raw message bytes into structured data."""Provides HTTP serving primitives, email composition/parsing, secure SMTP clients, and event loop tools needed for asynchronous network handling.