# Frequent Contacts Ranker

Paste an mbox export and rank who you email most, weighted by frequency and recency. Export a paste-ready contact list, CSV or JSON — all in your browser.

## Run it

- **CLI:** `gizza tool frequent-contacts-ranker "From 1@x Mon Sep 03 10:00:00 +0000 2018
From: Alice Example <alice@example.com>
To: Bob <bob@example.org>, Carol <carol@example.net>
Date: Mon, 3 Sep 2018 10:00:00 +0000

Hi both.

From 2@x Tue Sep 04 09:30:00 +0000 2018
From: Bob <bob@example.org>
To: alice@example.com
Cc: Dave <dave@example.com>
Date: Tue, 4 Sep 2018 09:30:00 +0000

Sounds good."`
- **Web:** https://gizza.ai/tools/frequent-contacts-ranker/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/frequent-contacts-ranker/tool.json

## Inputs

- `mbox` — Mailbox text (mbox or raw messages) _(field)_
- `count` — Whose addresses to rank _(field)_
- `include_cc` — Count Cc and Bcc recipients _(field)_
- `exclude` — Exclude addresses and domains _(field)_
- `skip_automated` — Skip noreply / mailer-daemon senders _(field)_
- `half_life_days` — Recency half-life (days, 0 = pure frequency) _(field)_
- `min_messages` — Minimum messages per contact _(field)_
- `limit` — How many contacts to show (0 = all) _(field)_
- `sort` — Row order _(field)_
- `format` — Output shape _(field)_

## Output

- Ranked contacts (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `mbox` — Mailbox text (mbox or raw messages)
- `count` — Whose addresses to rank
- `include_cc` — Count Cc and Bcc recipients
- `exclude` — Exclude addresses and domains
- `skip_automated` — Skip noreply / mailer-daemon senders
- `half_life_days` — Recency half-life (days, 0 = pure frequency)
- `min_messages` — Minimum messages per contact
- `limit` — How many contacts to show (0 = all)
- `sort` — Row order
- `format` — Output shape

Example: `https://gizza.ai/tools/frequent-contacts-ranker/?mbox=From%201%40x%20Mon%20Sep%2003%2010%3A00%3A00%20%2B0000%202018%0AFrom%3A%20Alice%20Example%20%3Calice%40example.com%3E%0ATo%3A%20Bob%20%3Cbob%40example.org%3E%2C%20Carol%20%3Ccarol%40example.net%3E%0ADate%3A%20Mon%2C%203%20Sep%202018%2010%3A00%3A00%20%2B0000%0A%0AHi%20both.%0A%0AFrom%202%40x%20Tue%20Sep%2004%2009%3A30%3A00%20%2B0000%202018%0AFrom%3A%20Bob%20%3Cbob%40example.org%3E%0ATo%3A%20alice%40example.com%0ACc%3A%20Dave%20%3Cdave%40example.com%3E%0ADate%3A%20Tue%2C%204%20Sep%202018%2009%3A30%3A00%20%2B0000%0A%0ASounds%20good.&count=both&include_cc=true&exclude=me%40example.com%2C%20%40newsletter.example.net&skip_automated=true&half_life_days=180&min_messages=1&limit=25&sort=score&format=report`

---

## About this tool

Frequent address lists drift. A one-off launch thread can crowd out the person you wrote to every
week, and an old coworker can stay in autocomplete long after you stopped emailing them. This tool
rebuilds that list from a mailbox export: paste an mbox file or a batch of raw email messages, then
rank the people in the headers by both frequency and recency.

The parser reads only the mail headers it needs — `From`, `To`, `Cc`, `Bcc` and `Date`. Message
bodies and attachments are ignored. Addresses are case-folded so `Bob@Example.org` and
`bob@example.org` become one row, while the most common display name is kept for paste-ready output.
Use **Exclude addresses and domains** for your own address and internal/list domains, otherwise your
own address often ranks first.

The default score is recency-weighted: every message contributes
`0.5^(age_days / half_life_days)`, measured from the newest dated message in the paste. That means
the same archive produces the same list next month, and recent conversations rise above ancient
bulk threads. Set the half-life to `0` when you want a pure message-count ranking.

### Worked example

Input:

```text
From 1@x Mon Sep 03 10:00:00 +0000 2018
From: Alice Example <alice@example.com>
To: Bob <bob@example.org>, Carol <carol@example.net>
Date: Mon, 3 Sep 2018 10:00:00 +0000

Hi both.

From 2@x Tue Sep 04 09:30:00 +0000 2018
From: Bob <bob@example.org>
To: alice@example.com
Cc: Dave <dave@example.com>
Date: Tue, 4 Sep 2018 09:30:00 +0000

Sounds good.

From 3@x Wed Sep 05 08:00:00 +0000 2018
From: Alice Example <alice@example.com>
To: Bob <bob@example.org>
Date: Wed, 5 Sep 2018 08:00:00 +0000

Slides attached.
```

With `alice@example.com` excluded, the default report is:

```text
Top 3 of 3 contacts · 3 messages · 2018-09-03 → 2018-09-05 · half-life 180 days, clocked from 2018-09-05

#  contact                    msgs  to  from  last seen   score
1  Bob <bob@example.org>         3   2     1  2018-09-05  100.0
2  Dave <dave@example.com>       1   1     0  2018-09-04   33.3
3  Carol <carol@example.net>     1   1     0  2018-09-03   33.2
```

Switch **Output shape** to **Paste-ready Name <address> lines** when you want a compact address-book
seed list, or to CSV/JSON when you want to audit the counts elsewhere.

### Limits and edge cases

- One run parses at most 5000 messages.
- The tool expects text input: an mbox export or raw RFC 5322 messages. It does not connect to Gmail,
  Outlook, IMAP or a local mailbox database.
- Messages without parseable addresses are skipped. If every address is excluded, automated, or below
  the minimum-message threshold, the run reports that filtering removed everything.
- Dates are used for recency only. Undated messages still count, but they receive no recency boost and
  do not set the date range.
- `skip_automated` removes common machine senders such as `noreply`, `mailer-daemon`, `postmaster`
  and `bounce` addresses. Turn it off when you are intentionally ranking newsletters or alerts.

## FAQ

<details>
<summary>What should I paste into the mailbox box?</summary>

Paste an mbox export from a mail client or service such as Gmail Takeout, Thunderbird or Apple Mail.
A single raw `.eml` message also works, and multiple raw messages can be pasted back to back when
they have standard headers. The tool splits mbox messages on the classic `From ` postmark line at
column 0.

</details>

<details>
<summary>How do I keep my own address out of the ranking?</summary>

Put your address in **Exclude addresses and domains**, for example `me@example.com`. You can also
exclude a whole domain with `@example.com` or `example.com`. Exclusions are useful for dropping your
own account, internal aliases, mailing-list domains or shared helpdesk addresses before scoring.

</details>

<details>
<summary>What does the half-life slider change?</summary>

It controls how quickly old conversations fade. With the default 180-day half-life, a message six
months older than the newest message in the archive counts about half as much as a new one. Lower
values favour very recent contacts; higher values behave more like a lifetime frequency count. Set
it to `0` to disable recency weighting entirely.

</details>

<details>
<summary>Should I rank recipients, senders or both?</summary>

Use **recipients** for an autocomplete list of people you write to. Use **senders** to see who writes
to you most often, or to find noisy newsletters by turning off automated-sender filtering. Use
**both** when you want a general relationship-strength list; the report still shows separate `to`
and `from` counts.

</details>

<details>
<summary>Does this upload or read my real mailbox account?</summary>

No. The page runs the parser in WebAssembly on the text you paste, and the CLI reads only the input
you give it. It does not log in to a mail provider, read contacts from an account, or upload the
mailbox anywhere.

</details>

## Related tools

- [Email network analyzer](https://gizza.ai/tools/email-network-analyzer/): Paste an mbox, .eml, or raw headers and get a sender-to-recipient network: top senders, recipients, correspondents, and links, plus CSV, JSON, GraphML, and DOT.
- [Parse a Postal Address](https://gizza.ai/tools/address-parse/): Parse a freeform postal address into street, unit, city, region, postcode, and country fields. Local, rule-based, and browser-only.
- [Authorization Header Decoder](https://gizza.ai/tools/authorization-header-decode/): Decode an HTTP Authorization header: Basic to username and password, Bearer token structure, Digest and AWS SigV4 params. Free, in your browser.
- [Basic Auth Header Generator](https://gizza.ai/tools/basic-auth-header-generator/): Generate an HTTP Basic Authorization header from a username and password — base64(user:pass) per RFC 7617. Runs in your browser, nothing is sent, free.
- [Calendar Free/Busy Overlap](https://gizza.ai/tools/calendar-freebusy-overlap/): Paste two .ics calendars and list the time slots where both are free — working hours, minimum meeting length, timezones and DST handled. Free and in-browser.
