MoveCapabilities (qwenpawmail_mcp/imap_ops.py)

QwenPaw · packages/qwenpawmail-mcp/src/qwenpawmail_mcp/imap_ops.py · python · Apache-2.0
email

Module exposing: MoveCapabilities, UidExpungeResult, encode_folder, response_detail, check_response, ensure_folder, uid_expunge, move_message

# Source: https://github.com/agentscope-ai/QwenPaw | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# -*- coding: utf-8 -*-
"""Shared, data-safe IMAP mutation primitives.

Both the standalone MCP client and QwenPaw's long-lived mail monitor mutate
mailboxes.  Keeping the destructive part of those operations here prevents
their fallback and error-handling semantics from drifting apart.
"""

from __future__ import annotations

import base64
import email
import imaplib
import re
from dataclasses import dataclass
from typing import Any, Callable, Protocol, cast

from .errors import CapabilityError, MailError

# Connection-level exceptions must be re-raised before the broader
# ``IMAP4.e

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key