Gestion de courriels IMAP

VérifiéPrudence

Gérez les boîtes aux lettres IMAP : listez, lisez et supprimez des courriels avec des scripts Python et une configuration basée sur fichier.

Spar Skills Guide Bot
ProductiviteIntermédiaire
0027/07/2026
Claude Code
#imap#email-management#mail-client#python-script#automation

Recommandé pour

Notre avis

Gère les e-mails IMAP via un script Python : liste des messages, lecture du contenu et suppression par UID.

Points forts

  • Fonctionne avec des fichiers de configuration pour plusieurs comptes
  • Décode les en-têtes RFC 2047 et les corps HTML/texte
  • Parse les corps pour extraire résumés, champs d'incident et URLs
  • Supporte les options de recherche et de filtrage par date

Limites

  • Nécessite un fichier de configuration local avec permissions strictes
  • Ne gère pas l'envoi d'e-mails ni les pièces jointes volumineuses
  • La suppression dépend du support IMAP du serveur
Quand l'utiliser

Utilisez cette compétence pour automatiser la consultation, l'analyse ou le nettoyage de vos boîtes mail IMAP.

Quand l'éviter

Évitez-la si vous avez besoin d'un client mail interactif complet ou si le serveur IMAP nécessite OAuth2 non configuré.

Analyse de sécurité

Prudence
Score qualité88/100

The skill uses Python to connect to IMAP servers, read, and delete emails. It requires sensitive credentials and can modify mailbox state, but all actions are legitimate and explicitly requested. No destructive or obfuscated payloads are present.

Points d'attention
  • The skill requires a configuration file containing IMAP credentials, which if exposed could allow unauthorized email access.
  • It provides a delete mode that permanently removes emails, but this is an intended feature and requires explicit user action.

Exemples

List recent emails
List the latest 10 emails from my default IMAP account using the managing-mails skill.
Read a specific email by UID
Read the full content of email UID 12345 from my inbox using the managing-mails skill, including HTML body.
Delete an email by UID
Delete the email with UID 67890 from my IMAP account using the managing-mails skill, without expunging immediately.

name: managing-mails description: IMAP 프로토콜로 메일함 목록 조회, 본문 읽기, UID 기반 삭제를 수행합니다. 메일 검색, RFC 2047 헤더 디코딩, 파일 기반 설정(MANAGING_MAIL_CONFIG_PATH 또는 --config)으로 메일을 관리해야 할 때 사용하세요. allowed-tools: Bash(python3:*), Read, Write

IMAP 메일 관리 스킬

IMAP 계정 정보를 파일로 로드하여 메일 목록 조회, 본문 읽기, 삭제를 처리합니다.

빠른 시작

  1. 설정 파일 준비
mkdir -p ~/.config/managing-mails
cp mails.example.toml ~/.config/managing-mails/mails.toml
chmod 700 ~/.config/managing-mails
chmod 600 ~/.config/managing-mails/mails.toml
export MANAGING_MAIL_CONFIG_PATH=~/.config/managing-mails/mails.toml
  1. 메일 목록 확인
python3 scripts/imap_read.py --mode list
  1. 특정 UID 본문 읽기
python3 scripts/imap_read.py --mode read --uid 12345
  1. 특정 UID 메일 삭제
python3 scripts/imap_read.py --mode delete --uid 12345

CLI 인터페이스

  • --mode list|read|delete (필수)
  • --account <name> (선택, 미지정 시 default_account)
  • --mailbox <name> (선택, 미지정 시 계정 기본값)
  • --since YYYY-MM-DD (선택, 미지정 시 계정별 default_since_days)
  • --limit N (기본 20)
  • --uid <uid> (mode=read|delete 필수)
  • --query "<search expr>" (선택)
  • --config <path> (선택, 지정 시 최우선)
  • MANAGING_MAIL_CONFIG_PATH (--config 미지정 시 필수 환경변수)
  • --include-html (mode=read에서 HTML 본문 포함)
  • --no-expunge (mode=delete에서 즉시 영구삭제 없이 \Deleted 플래그만 설정)

출력 형식

  • list: [{uid, date, from, subject, flags}]
  • read: {uid, headers, text_body, parsed_body, html_body?, attachments[]}
  • delete: {uid, deleted_flag_set, expunged, remaining_matches[]}

parsed_body는 사람이 읽기 쉬운 본문 파싱 결과를 제공합니다.

  • source: 파싱 원본(text/plain 또는 text/html)
  • summary: 주요 본문 요약(줄바꿈 유지)
  • incident_fields: 장애 문서에서 추출한 핵심 필드(작성자/서비스명/장애 원인/티켓 등)
  • urls: 본문에서 추출한 링크 목록

에러 코드

  • CONFIG_NOT_FOUND
  • CONFIG_PARSE_ERROR
  • CONFIG_SCHEMA_ERROR
  • CONFIG_PERMISSION_DENIED
  • ACCOUNT_NOT_FOUND
  • IMAP_CONNECT_ERROR
  • AUTH_FAILED
  • MAILBOX_NOT_FOUND
  • MESSAGE_NOT_FOUND
  • DELETE_FAILED

세부 동작은 아래 참조 문서를 따릅니다.

  • 제공자 특이사항: references/provider-quirks.md
  • 검색 레시피: references/search-recipes.md
Skills similaires