{"record":{"id":"c557911dc7b3ebed","repo":"odysseus-dev/odysseus","slug":"mail-operation-failed","errorCode":null,"errorMessage":"Mail operation failed","messagePattern":"Mail operation failed","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"routes/email_routes.py","lineNumber":3378,"sourceCode":"                    seen = used_names.get(arcname, 0)\n                    used_names[arcname] = seen + 1\n                    if seen:\n                        arcname = f\"{stem}-{seen + 1}{suffix}\"\n                    zf.write(str(filepath), arcname)\n            zip_buf.seek(0)\n            if not zip_buf.getbuffer().nbytes:\n                raise HTTPException(status_code=404, detail=\"No downloadable attachments\")\n            zip_name = _safe_attachment_zip_name(f\"email-{uid}-attachments.zip\", \"attachments.zip\")\n            return StreamingResponse(\n                zip_buf,\n                media_type=\"application/zip\",\n                headers={\"Content-Disposition\": f'attachment; filename=\"{zip_name}\"'},\n            )\n        except HTTPException:\n            raise\n        except Exception as e:\n            logger.error(f\"Failed to download attachments zip {uid}: {e}\")\n            raise HTTPException(status_code=500, detail=\"Mail operation failed\")\n\n    @router.get(\"/inline-image/{uid}\")\n    async def inline_image(\n        uid: str,\n        cid: str = Query(...),\n        folder: str = Query(\"INBOX\"),\n        account_id: str | None = Query(None),\n        owner: str = Depends(require_owner),\n    ):\n        \"\"\"Serve an inline MIME image by Content-ID after the user explicitly clicks Load.\"\"\"\n        want = (cid or \"\").strip().strip(\"<>\")\n        if not want:\n            raise HTTPException(status_code=400, detail=\"Missing image Content-ID\")\n        try:\n            with _imap(account_id, owner=owner) as conn:\n                conn.select(_q(folder), readonly=True)\n                status, msg_data = _imap_uid_fetch(conn, uid, \"(RFC822)\")\n            if status != \"OK\":","sourceCodeStart":3360,"sourceCodeEnd":3396,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/email_routes.py#L3360-L3396","documentation":"Error \"Mail operation failed\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Check the mail server connection and account credentials, then retry.","Review server logs for the underlying IMAP/SMTP error."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}