Skip to content

rabsym/freescout-syncnow

Repository files navigation

SyncNow for FreeScout

Force immediate IMAP synchronization for individual mailboxes on demand, using FreeScout's native fetch engine.

The Problem

In FreeScout installations with many mailboxes, the sequential fetch cycle can take several minutes to complete. This creates two common scenarios where waiting is not acceptable:

  • Time-sensitive emails: 2FA codes, password resets, and similar emails expire before the target mailbox is reached in the fetch cycle.
  • On-demand refresh: The installation runs infrequent fetch intervals (5–10 minutes or more) which works well for normal workloads, but occasionally a specific mailbox needs an immediate update — a client is waiting, an important email just arrived, or a deadline is approaching.

The Solution

SyncNow adds a "Sync Now" button to each IMAP mailbox. When clicked, it immediately triggers a full synchronization for that specific mailbox as a background process, without waiting for the general fetch cycle or interfering with it.

Requirements

  • FreeScout >= 1.8.131
  • PHP >= 8.0

Installation

  1. Download the latest release from GitHub Releases
  2. Extract to Modules/SyncNow/
  3. Activate the module in FreeScout's Modules page — migrations run automatically

Configuration

Go to Manage » Settings » SyncNow to configure:

  • Sync Cooldown — Minimum seconds between forced syncs for the same mailbox. Set to 0 to disable. Administrators bypass this limit. Default: 60 seconds.
  • History Retention — Number of days to keep sync history records. Set to 0 to keep records indefinitely. Default: 90 days.
  • History Limit — Maximum number of records shown in the mailbox history view. Default: 100.

Permissions

By default only administrators can trigger forced syncs. To allow regular users:

  1. Go to Manage » Users » [User] » Permissions
  2. Enable "Force sync mailboxes"

The user must also have access to the mailbox they want to sync.

PHP Binary

In web/FPM environments, the PHP binary is auto-detected. If auto-detection fails, set the path explicitly in your .env file:

SYNCNOW_PHP_BINARY=/usr/bin/php8.2

Usage

  1. Navigate to any IMAP mailbox
  2. Click "Sync Now" in the sidebar menu
  3. The sync page opens showing the last sync summary and history
  4. Click the "Sync Now" button to trigger an immediate sync
  5. A modal opens with a real-time log of the fetch operation
  6. On completion, the result summary shows status, emails fetched, and duration
  7. Close the modal — the page reloads automatically to reflect the new sync

Global History

Administrators can view the sync history across all mailboxes, with filters by mailbox, user, and status. This view is accessible from the Settings page (Manage » Settings » SyncNow).

Usage and Modifications

Feel free to use and modify this module for your needs! This is open source software and you're encouraged to adapt it to your requirements.

Contributing & Support

Contributions are welcome! If you have ideas for improvements or find any issues:

  • Bug Reports, Questions & Feature Requests: GitHub Issues
  • Pull Requests: Code contributions are appreciated
  • Documentation: Help improve the docs

Support the Project

If you find this module useful and would like to support its development, please feel free to sponsor this project via GitHub Sponsors.

Your support helps maintain and improve this project. Thank you! 🙏

Credits

  • Developer: Raimundo Alba
  • GitHub: @rabsym
  • Built for: FreeScout — The free self-hosted help desk & shared mailbox

⭐ If you find this module useful, please star it on GitHub!

License

GNU Affero General Public License v3.0 — see the LICENSE file for details.


Changelog

v1.3.0 — 24 March 2026

Settings page (cooldown, retention, history limit). Cooldown enforcement with countdown. Global sync history for administrators. Security improvements.

v1.2.0 — 17 March 2026

Control centre index page. Global history view. Automatic page reload on modal close.

v1.1.0 — 10 March 2026

Real-time modal with live log. Audit log table. Per-mailbox history. PHP CLI auto-detection. Localization.

v1.0.0 — 3 March 2026

Initial release. Forced IMAP sync using FreeScout's native fetch engine. Sync Now button. Per-user permission control.

About

Force immediate IMAP synchronization for individual mailboxes on demand. Designed for time-sensitive scenarios such as 2FA code emails where waiting for the general fetch cycle would cause codes to expire and for installations running infrequent fetch intervals where an immediate refresh of a specific mailbox is occasionally needed.

Topics

Resources

License

Stars

Watchers

Forks

Packages