Skip to content

zoott28354/thunderbird-ollama-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

75 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Thunderbird Ollama Translator


A Thunderbird addon that translates emails using local Ollama - Complete privacy, no data sent online EVER.

โœจ Features

  • ๐Ÿ  100% Local - No data sent online, EVER
  • ๐ŸŒ 10 Languages - Italian, English, Spanish, French, German, Portuguese, Russian, Japanese, Chinese, Korean
  • ๐Ÿ–ฑ๏ธ Context Menu - Right-click to translate to any language
  • โšก Fast - Uses translategemma model (3GB, optimized for translations)
  • ๐Ÿ”’ Absolute Privacy - Everything processed locally, zero tracking
  • ๐ŸŒ Multilingual interface - The addon is available in 7 languages: ๐Ÿ‡ฎ๐Ÿ‡น Italian, ๐Ÿ‡ฌ๐Ÿ‡ง English, ๐Ÿ‡ฉ๐Ÿ‡ช German, ๐Ÿ‡ซ๐Ÿ‡ท French, ๐Ÿ‡ช๐Ÿ‡ธ Spanish, ๐Ÿ‡ต๐Ÿ‡น Portuguese, ๐Ÿ‡ท๐Ÿ‡บ Russian (automatically adapts to Thunderbird's language)

๐Ÿ“‹ Requirements

  1. Ollama installed on your PC

  2. An Ollama model downloaded

    • Recommended: ollama pull translategemma (3GB, optimized)
    • Alternatives: llama3.2, mistral
  3. Thunderbird 128 or later (ESR and non-ESR)

โš ๏ธ Important note: Before using the addon, you'll need to configure OLLAMA_ORIGINS (see "Initial Configuration" section below).

๐Ÿ“ฆ Installation

Method 1: XPI File (Recommended)

  1. Download the thunderbird-ollama-translator.xpi file
  2. Open Thunderbird
  3. Go to Menu > Tools > Add-ons
  4. Click the gear icon โš™๏ธ in the top right
  5. Select "Install Add-on from file..."
  6. Select the .xpi file
  7. Confirm installation

Method 2: From Folder (Development)

  1. Extract files to a folder
  2. Open Thunderbird
  3. Press Ctrl+Shift+A (or from Menu > Tools > Add-ons)
  4. Click the gear icon โš™๏ธ
  5. Select "Debug Add-ons"
  6. Click "Load Temporary Add-on..."
  7. Select the manifest.json file from the folder

โš™๏ธ Initial Configuration

1. Open addon settings

  • Menu > Tools > Add-ons > "Ollama Translator" > Preferences

2. REQUIRED Configuration: OLLAMA_ORIGINS

Why is it needed? For security reasons, Ollama blocks requests from browser extensions. You must explicitly authorize Thunderbird.

Recommended value (more secure):

OLLAMA_ORIGINS=moz-extension://*

Allows only Firefox/Thunderbird extensions to access Ollama. Blocks all external websites.

How to configure:

Windows (CMD):

setx OLLAMA_ORIGINS "moz-extension://*"

Then close and reopen the terminal and start Ollama:

ollama serve

Linux (permanent):

echo 'export OLLAMA_ORIGINS="moz-extension://*"' >> ~/.bashrc
source ~/.bashrc
ollama serve

macOS (permanent):

echo 'export OLLAMA_ORIGINS="moz-extension://*"' >> ~/.zshrc
source ~/.zshrc
ollama serve

Alternative option (if you also need local apps):

OLLAMA_ORIGINS=moz-extension://*,http://localhost:11434

3. Configure addon

  • Target language: Italian, English, Spanish, French, German, Portuguese, Russian, Japanese, Chinese, Korean
  • Ollama URL: http://localhost:11434 (default)
  • Test connection: Click to verify that Ollama is reachable
  • Model: Select translategemma (recommended) or another installed model

4. Save

  • Click "Save"

๐ŸŽฏ How to Use

Context Menu (Recommended)

  1. Open an email you want to translate
  2. Right-click on the email body
  3. Select "Translate with Ollama โ–ถ" and choose the language
    • The selected language will appear in bold
    • This choice becomes the default
  4. Wait for the message "Translation completed"

Show Original

  • After translation, right-click on the text
  • Select "Show Original" to restore the original text

๐Ÿ”’ Security

โœ… What is Secure

  • No data sent online EVER - Everything is processed locally by Ollama
  • Local connection - Communicates only with localhost:11434
  • No tracking - No statistics, tracking, or remote logs
  • No API key - No API key or registration required
  • Open Source - Fully inspectable code

๐Ÿ” Required Permissions

The addon requires only these Thunderbird permissions:

  • messagesRead - Reads email content
  • messagesModify - Replaces text with translation
  • menus - Adds context menu
  • storage - Saves settings
  • tabs - Injects script into email
  • http://localhost/* - To communicate with local Ollama

No access to external services

No access to:

  • โŒ Address book, calendar, chat
  • โŒ Account credentials
  • โŒ Thunderbird database
  • โŒ File system (except localhost for Ollama)

๐Ÿšจ Troubleshooting

"Error: Ollama error: 403 Forbidden" โš ๏ธ

CAUSE: Ollama blocks requests from browser extensions for security reasons.

COMPLETE SOLUTION:

  1. Stop Ollama if it's running (Ctrl+C in the terminal where ollama serve is running)

  2. Configure the environment variable (recommended value for security):

    Windows (CMD):

    setx OLLAMA_ORIGINS "moz-extension://*"

    Linux:

    echo 'export OLLAMA_ORIGINS="moz-extension://*"' >> ~/.bashrc
    source ~/.bashrc

    macOS:

    echo 'export OLLAMA_ORIGINS="moz-extension://*"' >> ~/.zshrc
    source ~/.zshrc
  3. Close and reopen the terminal, then start Ollama:

    ollama serve
  4. Verify the configuration:

    • Open Thunderbird
    • Go to addon settings
    • Click "Test connection"
    • Should show "Connection successful: X models available"

Note: moz-extension://* allows only Firefox/Thunderbird extensions to access Ollama, blocking external websites (more secure).

๐Ÿ“œ Changelog

v1.5.0

  • Deterministic tab/preview routing โ€” translating from a separate email tab no longer interferes with the preview pane (and vice versa)
  • Context menu now appears only in the email body (not in folder pane or message list)
  • Programmatic messageDisplayScripts registration for broad Thunderbird compatibility (128 ESR to 147+)

v1.0.0

  • Initial release with Ollama-only local translation

๐Ÿ“ License

MIT License - Free to use, modify and distribute.

๐Ÿค Support

If you have problems:

  1. Open the console (Ctrl+Shift+I in a Thunderbird tab)
  2. Right-click on the email > Translate to Italian
  3. Look for blue messages [Translator] in the console
  4. Copy error messages and share them

Happy translating! ๐ŸŽ‰

About

Thunderbird addon to translate emails using local Ollama AI - 100% private, no data sent online

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors