| name | lore-kernel-retrieval |
| description | Use when needing to fetch Linux kernel patches or mailing list threads from lore.kernel.org, especially when encountering Anubis anti-bot protection, or when converting email patches to git-am ready format. Trigger for any task involving kernel patch retrieval, lore.kernel.org access, public-inbox mbox downloads, or b4 tool usage. |
lore.kernel.org Patch Retrieval
Overview
lore.kernel.org archives Linux kernel mailing lists via public-inbox. It is protected by Anubis, a proof-of-work anti-bot system. Anubis whitelists curl/wget by default, making direct CLI retrieval the most reliable path. Browser-like User-Agents trigger JavaScript challenges.
When to Use
- Retrieving a single patch or patch series from lore.kernel.org
- Converting email-based patches to
git am ready format
- Bypassing Anubis blocks on lore.kernel.org or other Anubis-protected public-inbox instances
- Batch-syncing kernel mailing list archives for offline review
Quick Reference
| Goal | Command | Notes |
|---|
| Download thread mbox (gzip) | curl -L "<url>/t.mbox.gz" | gunzip | Default curl UA bypasses Anubis |
| Get git-am ready mbox | b4 am <msgid> | Sorts patches, adds trailers |
| Apply directly to branch | b4 shazam <msgid> | Runs git am automatically |
| Raw single message | wget -qO- "<url>/raw" | Full headers included |
| Clone full list archive | git clone https://lore.kernel.org/<list>/.git | For offline bulk access |
| Incremental sync | lei q -I https://lore.kernel.org/all ... | Requires public-inbox package |
URL Patterns
Thread mbox (gzip): https://lore.kernel.org/<list>/<msgid>/t.mbox.gz
Raw message: https://lore.kernel.org/<list>/<msgid>/raw
Web view: https://lore.kernel.org/<list>/<msgid>/
Redirect (any list): https://lore.kernel.org/r/<msgid>
Method 1: Direct Download (Simplest, Anubis-Bypassed)
curl -L "https://lore.kernel.org/linux-mm/20260422005608.342028-1-fmayle@google.com/t.mbox.gz" \
| gunzip > thread.mbox
wget -qO- "https://lore.kernel.org/linux-mm/20260422005608.342028-1-fmayle@google.com/raw"
Method 1b: Helper Script (fetch-lore-patch.sh)
A reusable script at @fetch-lore-patch.sh wraps both b4 (preferred) and curl fallback:
./fetch-lore-patch.sh 20260422005608.342028-1-fmayle@google.com ./output/
Method 2: b4 Tool (Recommended for Patch Series)
pip install b4
b4 am 20260422005608.342028-1-fmayle@google.com
b4 shazam 20260422005608.342028-1-fmayle@google.com
b4 mbox 20260422005608.342028-1-fmayle@google.com
b4 automatically:
- Fetches
t.mbox.gz from lore
- Sorts patches by
[PATCH n/m] counters
- Merges
Reviewed-by / Acked-by trailers from replies
- Outputs
./<slug>.mbx ready for git am
Method 3: public-inbox git / lei (Bulk/Offline)
git clone https://lore.kernel.org/linux-mm/.git
lei q -I https://lore.kernel.org/all -o ~/Mail/linux-mm \
'f:author@example.com AND rt:1.week.ago..'
Anubis Bypass Details
Anubis rules (default configuration):
- User-Agent containing
Mozilla → Challenge issued
- User-Agent
curl/*, wget/*, python-requests/* → Allowed
- Missing
Accept-Encoding or Accept-Language → Increases suspicion weight
After passing a challenge, Anubis sets cookie within.website-x-cmd-anubis-auth (JWT, ~7 days).
Common Mistakes
| Mistake | Why It Fails |
|---|
curl -A "Mozilla/5.0..." | Triggers Anubis JS PoW challenge; fails in headless environments |
Using requests.get() with default Python UA | Often blocked; use requests with no custom UA or use curl |
Forgetting gunzip on t.mbox.gz | Returns binary gzip data instead of mbox text |
Passing full URL to b4 am | b4 expects Message-ID or https://lore.kernel.org/r/<msgid>; full path may confuse parser |
Using 1-a.patch endpoint | Returns 403 Forbidden; use /raw or /t.mbox.gz instead |
Example: Complete Retrieval Workflow
MSGID="20260422005608.342028-1-fmayle@google.com"
curl -L "https://lore.kernel.org/linux-mm/${MSGID}/t.mbox.gz" | gunzip > thread.mbox
b4 am "${MSGID}"