mail: robustes Decoding gegen unbekannte Charsets (x-unknown); OAuth-Token 30 Tage

- _safe_decode() faengt LookupError bei unbekannten/kaputten Mail-Charsets
  (z.B. 'x-unknown') ab, Fallback utf-8 -> latin-1. Verhindert Crash der
  Mail-Suche/Read bei einzelnen kaputt-kodierten Mails.
- common.py: OAuth access_token Lifetime 24h -> 30 Tage (weniger Re-Auth in claude.ai)
- .gitignore: *.before-* Backups ausschliessen

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
root
2026-06-17 09:37:15 +02:00
parent a811e87029
commit 56d92c153b
3 changed files with 21 additions and 5 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ async def oauth_token(request: Request):
return JSONResponse({"error": "unsupported_grant_type"}, status_code=400)
access_token = secrets.token_urlsafe(48)
expires_in = 86400
expires_in = 2592000 # 30 days
tokens = _load_access_tokens()
# Cleanup expired
now = time.time()