# Voorstel mappenstructuur & mailrules

_Gebaseerd op analyse van 11.854 e-mails en jouw beslissingen over 174 mailinglijsten._
_3 niveaus diep: categorie → subcategorie → afzender._

---

## Voorgestelde mappenstructuur

```
INBOX                              ← alleen wat echt jouw actie vraagt

Nieuwsbrieven/
  Leren/
    AI Report
    Ben Tiggelaar
    Brian Keating
    Coursera
    Eva Keiffenheim
    MIT Open Learning
    MIT Technology Review
    Nick Milo
    Storytelling with Data
  Nieuws & Vakbladen/
    Computable
    The Presentation Guru
    Vakblad Crisismanager
  Overig/
    Lendahand
    The Good Roll

Financieel/
  Facturen/
    2024.Q1                        ← automatisch gesorteerd op ontvangstdatum
    2024.Q2                           PDF-facturen worden ook doorgestuurd
    2024.Q3                           naar boekhouding@australius.nl
    2024.Q4
    2025.Q1
    2025.Q2
    2025.Q3
    2025.Q4
    (per jaar aanmaken)
  Bank/
    ABN AMRO
    ICS
    NPEX
    SnelStart
    Tellow
  Verzekering/
    Univé
    VEZA

Werk/
  Opdrachten/
    Circle8
    Flextender
    FutureXL
    Get There
    Huckr
    IMMENS
    Jamie (MeetJamie)
    OneStopSourcing
  Overig/
    BOIP
    Gemeente Groningen

Diensten/
  Hosting/
    Backblaze
    Let's Encrypt
    STRATO
    TransIP
  Software/
    1Password
    CogSci Apps
    Claude
    Cursor
    Kahoot
    Matter
    Microsoft Teams
    MindNode
    Papers
    Perplexity
    Sophos
  Telecom/
    KPN
    Vodafone

Mobiliteit/
  EV/
    Alfen
    Eneco eMobility
    FastNed
    Mitsubishi
    OPnGO
    Shell Recharge
    Tesla
  OV & Reizen/
    Booking.com
    Flitsmeister
    NS

Bestellingen/
  123inkt
  Allekabels
  bol.com
  Coolblue
  DHL
  GLS
  Makro
  Office Centre
  PostNL
  Sligro
  Smartphonehoesjes
  Viking

Technisch/
  DMARC

Archief/
  2023
  2024
  2025

Drafts
Sent
Spam
Trash
```

---

## Vergelijking huidige vs nieuwe structuur

| Huidig | Nieuw |
|---|---|
| `Mailinglists/BASB` | vervalt (afgemeld) |
| `Mailinglists/Ben Tiggelaar` | `Nieuwsbrieven/Leren/Ben Tiggelaar` |
| `Mailinglists/Brian Keating` | `Nieuwsbrieven/Leren/Brian Keating` |
| `Mailinglists/Calmer Notes` | vervalt (afgemeld) |
| `Mailinglists/Eva Keiffenheim` | `Nieuwsbrieven/Leren/Eva Keiffenheim` |
| `Mailinglists/Formspree` | `Nieuwsbrieven/Overig/The Good Roll` (Cole) |
| `Mailinglists/Lendahand` | `Nieuwsbrieven/Overig/Lendahand` |
| `Mailinglists/LYT - Nick Milo` | `Nieuwsbrieven/Leren/Nick Milo` |
| `Mailinglists/MIT Technology Review` | `Nieuwsbrieven/Leren/MIT Technology Review` |
| `Mailinglists/Storytelling with Data` | `Nieuwsbrieven/Leren/Storytelling with Data` |
| `Kennis/Coursera` | `Nieuwsbrieven/Leren/Coursera` |
| `Kennis/Leeslijst` | vervalt of handmatig overzetten |
| `Facturen - te verwerken` | `Financieel/Facturen` |
| `Facturen - verwerkt` | `Financieel/Facturen.Archief` |
| `Hulp/Gespreksverslagen` | `Werk/Opdrachten/...` (handmatig overzetten) |
| `Archief/202x/inkomend` | `Archief/202x` |
| `Archief/202x/verzonden` | `Archief/202x` |
| `Notes` | vervalt (leeg) |
| `Technisch/dmarc` | `Technisch/DMARC` |

---

## Sieve-mailrules

Volgorde is prioriteit: eerste match wint.

```sieve
require ["fileinto", "imap4flags", "envelope", "address", "comparator-i;ascii-casemap"];

# ── 1. Facturen (altijd eerst, vóór nieuwsbrieven/diensten) ──────────────────
#
# Vereiste extensies: date, variables, foreverypart, mime, copy, fileinto, redirect
# Als de server date+variables niet ondersteunt → gebruik het Python-script
# (zie fase 3) dat kwartaalindeling en forwarding via IMAP afhandelt.
#
if anyof (
    header :contains "Subject" ["factuur", "invoice", "rekening", "nota",
                                 "betaalverzoek", "receipt", "orderbevestiging",
                                 "order confirmation", "betaling ontvangen",
                                 "payment received", "uw factuur", "your invoice",
                                 "je factuur"]
) {
    # Kwartaal bepalen op basis van ontvangstdatum
    if currentdate :matches "year" "*"  { set "jaar" "${1}"; }
    if anyof (currentdate :is "month" "1",
              currentdate :is "month" "2",
              currentdate :is "month" "3")  { set "kwartaal" "Q1"; }
    elsif anyof (currentdate :is "month" "4",
                 currentdate :is "month" "5",
                 currentdate :is "month" "6") { set "kwartaal" "Q2"; }
    elsif anyof (currentdate :is "month" "7",
                 currentdate :is "month" "8",
                 currentdate :is "month" "9") { set "kwartaal" "Q3"; }
    else                                      { set "kwartaal" "Q4"; }

    # PDF-bijlage → doorsturen naar boekhouding (alleen nieuwe mail, geen terugwerkende kracht)
    foreverypart {
        if anyof (
            header :mime :param "filename" :matches "Content-Disposition" ["*.pdf", "*.PDF"],
            header :mime :is "Content-Type" "application/pdf"
        ) {
            redirect :copy "boekhouding@australius.nl";
            break;
        }
    }

    fileinto "Financieel.Facturen.${jaar}.${kwartaal}";
    stop;
}

# ── 2. Bank ──────────────────────────────────────────────────────────────────
if address :domain :is "From" ["nl.abnamro.com", "abnamro.nl"] {
    fileinto "Financieel.Bank.ABN AMRO"; stop;
}
if address :domain :is "From" ["icscards.nl", "icsmarketing.icscards.nl",
                                "service.icscards.nl"] {
    fileinto "Financieel.Bank.ICS"; stop;
}
if address :domain :is "From" ["npex.nl"] {
    fileinto "Financieel.Bank.NPEX"; stop;
}
if address :domain :is "From" ["snelstart.nl"] {
    fileinto "Financieel.Bank.SnelStart"; stop;
}
if address :domain :is "From" ["tellow.nl"] {
    fileinto "Financieel.Bank.Tellow"; stop;
}

# ── 3. Verzekering ───────────────────────────────────────────────────────────
if address :domain :is "From" ["unive.nl", "nieuwsbrief.unive.nl"] {
    fileinto "Financieel.Verzekering.Univé"; stop;
}
if address :domain :is "From" ["heinenoord.nl"] {
    fileinto "Financieel.Verzekering.VEZA"; stop;
}

# ── 4. Werk / Opdrachten ─────────────────────────────────────────────────────
if address :domain :is "From" ["flextender.nl"] {
    fileinto "Werk.Opdrachten.Flextender"; stop;
}
if address :domain :is "From" ["onestopsourcing.nl"] {
    fileinto "Werk.Opdrachten.OneStopSourcing"; stop;
}
if address :domain :is "From" ["immens.nu"] {
    fileinto "Werk.Opdrachten.IMMENS"; stop;
}
if address :domain :is "From" ["circle8.nl"] {
    fileinto "Werk.Opdrachten.Circle8"; stop;
}
if address :domain :is "From" ["getthere.nl"] {
    fileinto "Werk.Opdrachten.Get There"; stop;
}
if address :domain :is "From" ["huckr.ai"] {
    fileinto "Werk.Opdrachten.Huckr"; stop;
}
if address :domain :is "From" ["hey.meetjamie.ai"] {
    fileinto "Werk.Opdrachten.Jamie"; stop;
}
if address :domain :is "From" ["futurexl.nl"] {
    fileinto "Werk.Opdrachten.FutureXL"; stop;
}
if address :domain :is "From" ["boip.int"] {
    fileinto "Werk.Overig.BOIP"; stop;
}
if address :domain :is "From" ["groningen.nl", "groningenbereikbaar.nl"] {
    fileinto "Werk.Overig.Gemeente Groningen"; stop;
}

# ── 5. Mobiliteit / EV ───────────────────────────────────────────────────────
if address :domain :is "From" ["eneco-emobility.com", "eneco.nl"] {
    fileinto "Mobiliteit.EV.Eneco eMobility"; stop;
}
if address :domain :is "From" ["shellrecharge.com"] {
    fileinto "Mobiliteit.EV.Shell Recharge"; stop;
}
if address :domain :is "From" ["fastned.nl"] {
    fileinto "Mobiliteit.EV.FastNed"; stop;
}
if address :domain :is "From" ["opngo.com"] {
    fileinto "Mobiliteit.EV.OPnGO"; stop;
}
if address :domain :is "From" ["tesla.com"] {
    fileinto "Mobiliteit.EV.Tesla"; stop;
}
if address :domain :is "From" ["mmsn.nl"] {
    fileinto "Mobiliteit.EV.Mitsubishi"; stop;
}
if address :domain :is "From" ["alfen.com"] {
    fileinto "Mobiliteit.EV.Alfen"; stop;
}

# ── 6. Mobiliteit / OV & Reizen ──────────────────────────────────────────────
if address :domain :is "From" ["ns.nl", "email.ns.nl"] {
    fileinto "Mobiliteit.OV & Reizen.NS"; stop;
}
if address :domain :is "From" ["booking.com"] {
    fileinto "Mobiliteit.OV & Reizen.Booking.com"; stop;
}
if address :domain :is "From" ["flitsmeister.nl"] {
    fileinto "Mobiliteit.OV & Reizen.Flitsmeister"; stop;
}

# ── 7. Bestellingen & bezorging ──────────────────────────────────────────────
if address :domain :is "From" ["postnl.nl", "edm.postnl.nl",
                                "notificatie.postnl.nl"] {
    fileinto "Bestellingen.PostNL"; stop;
}
if address :domain :is "From" ["dhlparcel.nl", "dhlecommerce.nl"] {
    fileinto "Bestellingen.DHL"; stop;
}
if address :domain :is "From" ["gls-netherlands.com"] {
    fileinto "Bestellingen.GLS"; stop;
}
if address :domain :is "From" ["bol.com", "feedback.bol.com"] {
    fileinto "Bestellingen.bol.com"; stop;
}
if address :domain :is "From" ["coolblue.nl", "coolblue.eu"] {
    fileinto "Bestellingen.Coolblue"; stop;
}
if address :domain :is "From" ["allekabels.nl"] {
    fileinto "Bestellingen.Allekabels"; stop;
}
if address :domain :is "From" ["vikingdirect.nl", "delivery.vikingdirect.nl",
                                "online.vikingdirect.nl"] {
    fileinto "Bestellingen.Viking"; stop;
}
if address :domain :is "From" ["123inkt.nl", "m.123inkt.nl"] {
    fileinto "Bestellingen.123inkt"; stop;
}
if address :domain :is "From" ["officecentre.nl"] {
    fileinto "Bestellingen.Office Centre"; stop;
}
if address :domain :is "From" ["sligro.nl"] {
    fileinto "Bestellingen.Sligro"; stop;
}
if address :domain :is "From" ["makro.nl"] {
    fileinto "Bestellingen.Makro"; stop;
}
if address :domain :is "From" ["smartphonehoesjes.nl"] {
    fileinto "Bestellingen.Smartphonehoesjes"; stop;
}

# ── 8. Diensten / Hosting ────────────────────────────────────────────────────
if address :domain :is "From" ["strato.com", "news.strato.com",
                                "marketingradar.strato.com"] {
    fileinto "Diensten.Hosting.STRATO"; stop;
}
if address :domain :is "From" ["transip.nl"] {
    fileinto "Diensten.Hosting.TransIP"; stop;
}
if address :domain :is "From" ["letsencrypt.org"] {
    fileinto "Diensten.Hosting.Let's Encrypt"; stop;
}
if address :domain :is "From" ["backblaze.com"] {
    fileinto "Diensten.Hosting.Backblaze"; stop;
}

# ── 9. Diensten / Telecom ────────────────────────────────────────────────────
if address :domain :is "From" ["kpn.com", "campagnes.kpn.com"] {
    fileinto "Diensten.Telecom.KPN"; stop;
}
if address :domain :is "From" ["zakelijk.vodafone.nl", "vodafone.nl"] {
    fileinto "Diensten.Telecom.Vodafone"; stop;
}

# ── 10. Diensten / Software ──────────────────────────────────────────────────
if address :domain :is "From" ["cursor.com"] {
    fileinto "Diensten.Software.Cursor"; stop;
}
if address :domain :is "From" ["1password.com"] {
    fileinto "Diensten.Software.1Password"; stop;
}
if address :domain :is "From" ["home.sophos.com", "cleverbridge.com"] {
    fileinto "Diensten.Software.Sophos"; stop;
}
if address :domain :is "From" ["cogsciapps.com"] {
    fileinto "Diensten.Software.CogSci Apps"; stop;
}
if address :domain :is "From" ["claude.com"] {
    fileinto "Diensten.Software.Claude"; stop;
}
if address :domain :is "From" ["microsoft365.com"] {
    fileinto "Diensten.Software.Microsoft Teams"; stop;
}
if address :domain :is "From" ["getmatter.com"] {
    fileinto "Diensten.Software.Matter"; stop;
}
if address :domain :is "From" ["mindnode.com"] {
    fileinto "Diensten.Software.MindNode"; stop;
}
if address :domain :is "From" ["papersapp.com"] {
    fileinto "Diensten.Software.Papers"; stop;
}
if address :domain :is "From" ["team.kahoot.com"] {
    fileinto "Diensten.Software.Kahoot"; stop;
}
if address :domain :is "From" ["perplexity.ai"] {
    fileinto "Diensten.Software.Perplexity"; stop;
}

# ── 11. Nieuwsbrieven / Leren ────────────────────────────────────────────────
if address :domain :is "From" ["coursera.org", "email.coursera.org",
                                "m.mail.coursera.org", "m.learn.coursera.org"] {
    fileinto "Nieuwsbrieven.Leren.Coursera"; stop;
}
if address :domain :is "From" ["technologyreview.com",
                                "fulfillment.technologyreview.com"] {
    fileinto "Nieuwsbrieven.Leren.MIT Technology Review"; stop;
}
if address :domain :is "From" ["mit.edu"] {
    fileinto "Nieuwsbrieven.Leren.MIT Open Learning"; stop;
}
if address :domain :is "From" ["storytellingwithdata.com"] {
    fileinto "Nieuwsbrieven.Leren.Storytelling with Data"; stop;
}
if address :domain :is "From" ["linkingyourthinking.com"] {
    fileinto "Nieuwsbrieven.Leren.Nick Milo"; stop;
}
if anyof (
    address :domain :is "From" ["evakeiffenheim.com"],
    header :contains "List-ID" "evakeiffenheim"
) {
    fileinto "Nieuwsbrieven.Leren.Eva Keiffenheim"; stop;
}
if address :domain :is "From" ["tiggelaar.nl"] {
    fileinto "Nieuwsbrieven.Leren.Ben Tiggelaar"; stop;
}
if address :domain :is "From" ["briankeating.com"] {
    fileinto "Nieuwsbrieven.Leren.Brian Keating"; stop;
}
if address :domain :is "From" ["beehiiv.com", "mail.beehiiv.com"] {
    fileinto "Nieuwsbrieven.Leren.AI Report"; stop;
}
if address :domain :is "From" ["elizabethbutlermd.com"] {
    fileinto "Nieuwsbrieven.Leren.Elizabeth Butler"; stop;
}

# ── 12. Nieuwsbrieven / Nieuws & Vakbladen ───────────────────────────────────
if address :domain :is "From" ["crisismanager.nl"] {
    fileinto "Nieuwsbrieven.Nieuws & Vakbladen.Vakblad Crisismanager"; stop;
}
if address :domain :is "From" ["jaarbeurs.nl"] {
    fileinto "Nieuwsbrieven.Nieuws & Vakbladen.Computable"; stop;
}
if address :domain :is "From" ["presentation-guru.com"] {
    fileinto "Nieuwsbrieven.Nieuws & Vakbladen.The Presentation Guru"; stop;
}

# ── 13. Nieuwsbrieven / Overig ───────────────────────────────────────────────
if address :domain :is "From" ["lendahand.com"] {
    fileinto "Nieuwsbrieven.Overig.Lendahand"; stop;
}
if address :domain :is "From" ["thegoodroll.nl"] {
    fileinto "Nieuwsbrieven.Overig.The Good Roll"; stop;
}

# ── 14. Technisch ────────────────────────────────────────────────────────────
if anyof (
    header :contains "Subject" ["DMARC", "SPF", "DKIM"],
    header :contains "From" "dmarc"
) {
    fileinto "Technisch.DMARC"; stop;
}
if anyof (
    header :contains "Subject" ["delivery failed", "undeliverable",
                                 "mailer-daemon", "mail delivery"],
    address :is "From" "mailer-daemon@australius.nl"
) {
    fileinto "Technisch"; stop;
}
```

---

## Te maken mappen (nieuw)

De volgende mappen moeten aangemaakt worden op de IMAP-server
(het maak-script doet dit automatisch):

```
Nieuwsbrieven
Nieuwsbrieven.Leren
Nieuwsbrieven.Leren.AI Report
Nieuwsbrieven.Leren.Ben Tiggelaar
Nieuwsbrieven.Leren.Brian Keating
Nieuwsbrieven.Leren.Coursera
Nieuwsbrieven.Leren.Elizabeth Butler
Nieuwsbrieven.Leren.Eva Keiffenheim
Nieuwsbrieven.Leren.MIT Open Learning
Nieuwsbrieven.Leren.MIT Technology Review
Nieuwsbrieven.Leren.Nick Milo
Nieuwsbrieven.Leren.Storytelling with Data
Nieuwsbrieven.Nieuws & Vakbladen
Nieuwsbrieven.Nieuws & Vakbladen.Computable
Nieuwsbrieven.Nieuws & Vakbladen.The Presentation Guru
Nieuwsbrieven.Nieuws & Vakbladen.Vakblad Crisismanager
Nieuwsbrieven.Overig
Nieuwsbrieven.Overig.Lendahand
Nieuwsbrieven.Overig.The Good Roll
Financieel
Financieel.Facturen
Financieel.Facturen.2023.Q1
Financieel.Facturen.2023.Q2
Financieel.Facturen.2023.Q3
Financieel.Facturen.2023.Q4
Financieel.Facturen.2024.Q1
Financieel.Facturen.2024.Q2
Financieel.Facturen.2024.Q3
Financieel.Facturen.2024.Q4
Financieel.Facturen.2025.Q1
Financieel.Facturen.2025.Q2
Financieel.Facturen.2025.Q3
Financieel.Facturen.2025.Q4
Financieel.Bank
Financieel.Bank.ABN AMRO
Financieel.Bank.ICS
Financieel.Bank.NPEX
Financieel.Bank.SnelStart
Financieel.Bank.Tellow
Financieel.Verzekering
Financieel.Verzekering.Univé
Financieel.Verzekering.VEZA
Werk
Werk.Opdrachten
Werk.Opdrachten.Circle8
Werk.Opdrachten.Flextender
Werk.Opdrachten.FutureXL
Werk.Opdrachten.Get There
Werk.Opdrachten.Huckr
Werk.Opdrachten.IMMENS
Werk.Opdrachten.Jamie
Werk.Opdrachten.OneStopSourcing
Werk.Overig
Werk.Overig.BOIP
Werk.Overig.Gemeente Groningen
Diensten
Diensten.Hosting
Diensten.Hosting.Backblaze
Diensten.Hosting.Let's Encrypt
Diensten.Hosting.STRATO
Diensten.Hosting.TransIP
Diensten.Software
Diensten.Software.1Password
Diensten.Software.CogSci Apps
Diensten.Software.Claude
Diensten.Software.Cursor
Diensten.Software.Kahoot
Diensten.Software.Matter
Diensten.Software.Microsoft Teams
Diensten.Software.MindNode
Diensten.Software.Papers
Diensten.Software.Perplexity
Diensten.Software.Sophos
Diensten.Telecom
Diensten.Telecom.KPN
Diensten.Telecom.Vodafone
Mobiliteit
Mobiliteit.EV
Mobiliteit.EV.Alfen
Mobiliteit.EV.Eneco eMobility
Mobiliteit.EV.FastNed
Mobiliteit.EV.Mitsubishi
Mobiliteit.EV.OPnGO
Mobiliteit.EV.Shell Recharge
Mobiliteit.EV.Tesla
Mobiliteit.OV & Reizen
Mobiliteit.OV & Reizen.Booking.com
Mobiliteit.OV & Reizen.Flitsmeister
Mobiliteit.OV & Reizen.NS
Bestellingen
Bestellingen.123inkt
Bestellingen.Allekabels
Bestellingen.bol.com
Bestellingen.Coolblue
Bestellingen.DHL
Bestellingen.GLS
Bestellingen.Makro
Bestellingen.Office Centre
Bestellingen.PostNL
Bestellingen.Sligro
Bestellingen.Smartphonehoesjes
Bestellingen.Viking
Archief.2023
Archief.2024
Archief.2025
```
