Roundcube Webmail plugin for scheduled message send
  • PHP 83.3%
  • HTML 9.4%
  • JavaScript 4%
  • CSS 3.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
LoneStar fa059d13f3 Release SendLater 1.6.1
Document security and reliability fixes, dedicated configuration behavior, sending-claim recovery, and incremental cleanup of old sent messages.
2026-11-10 15:04:23 +01:00
bin Handle invalid SendLater config without web errors 2026-11-10 15:01:03 +01:00
css Make pending messages button skin independent 2026-11-09 22:45:43 +01:00
images Make pending messages button skin independent 2026-11-09 22:45:43 +01:00
js Make pending messages button skin independent 2026-11-09 22:45:43 +01:00
localization Cleaned of temporary files 2025-09-12 09:48:17 +02:00
skins/elastic/templates Make pending messages button skin independent 2026-11-09 22:45:43 +01:00
CHANGELOG.md Release SendLater 1.6.1 2026-11-10 15:04:23 +01:00
composer.json Release SendLater 1.6.1 2026-11-10 15:04:23 +01:00
config.inc.php.dist Handle invalid SendLater config without web errors 2026-11-10 15:01:03 +01:00
LICENSE Code revised with Qwen, fixes for editing messages with attachments, various fixes and structural changes 2025-09-12 09:39:47 +02:00
README.md Release SendLater 1.6.1 2026-11-10 15:04:23 +01:00
sendlater.php Release SendLater 1.6.1 2026-11-10 15:04:23 +01:00

SendLater for Roundcube

SendLater is a Roundcube plugin that stores composed messages in the Roundcube database and sends them at a later date. Users can review, edit, delete, or send pending messages immediately from the mail view.

Features

  • Schedule a composed message using a date and time in the browser's timezone.
  • View and manage pending messages from the mail view.
  • Edit queued messages, including their message body and attachments.
  • Send a pending message immediately, with an atomic status claim to prevent concurrent delivery attempts.
  • Run scheduled delivery from the command line or a cron job.
  • Restore queued message MIME content and attachments when editing.
  • English and Italian interface translations.

Requirements

  • Roundcube Webmail. This release was developed against Roundcube 1.6.10; see the Roundcube plugin API and your deployment for compatibility with other versions.
  • PHP 7.3 or newer (also declared in composer.json).
  • A Roundcube-supported database. The current schema and upgrade queries use MySQL/MariaDB syntax (ENUM, SHOW COLUMNS), so other database backends are not currently supported by this plugin implementation.
  • A working Roundcube SMTP configuration for message delivery.
  • Optional: IMAP superuser authentication if you want SendLater to save a copy of sent messages to the user's Sent folder. This is separate from SMTP delivery.

Installation

Install the plugin in Roundcube's plugins/sendlater directory, either through Composer or by copying the repository there. Add sendlater to the $config['plugins'] list in Roundcube's config/config.inc.php:

$config['plugins'] = ['sendlater']; // Include your other enabled plugins here too.

On initialization, the plugin creates the sendlater table if needed and upgrades the status column to support the sending state. Existing queued records are retained. The standalone schema updater can also be run from the Roundcube installation:

php /path/to/roundcube/plugins/sendlater/bin/update_schema.php

The updater also adds the sending_since column required by sending-claim recovery when upgrading an existing table. Run it once during deployment; the plugin and scheduled sender also apply this migration automatically if it has not already run. This migration is included in version 1.6.1.

The updater and scheduled sender derive the Roundcube root from their location and expect the standard plugins/sendlater/bin installation path.

Configuration

No plugin configuration file is required when the defaults are suitable. To configure SendLater options, copy config.inc.php.dist to config.inc.php in the plugin directory and edit the values. IMAP superuser credentials are needed only if the scheduled sender should save a copy to users' Sent folders:

$config['sendlater_superuser_host'] = 'localhost';
$config['sendlater_superuser_port'] = 143;
$config['sendlater_superuser_user'] = 'masteruser';
$config['sendlater_superuser_pass'] = 'replace-with-a-secret';
$config['sendlater_superuser_ssl'] = null; // Or the SSL mode expected by Roundcube.
$config['sendlater_sent_retention_days'] = 90;
$config['sendlater_stale_sending_minutes'] = 15;
$config['sendlater_save_sent_messages'] = null;
$config['sendlater_sent_mbox'] = null;

The plugin loads SendLater overrides from plugins/sendlater/config.inc.php in both web requests and the scheduled sender. For options that also exist in Roundcube, the global value is used when the plugin value is null. The distributed template documents each option. Restrict access to this file (for example, mode 600) and ensure it is owned by or readable to the Roundcube PHP process. Use the correct host, port, and TLS settings for your IMAP server. Without the IMAP credentials, SMTP sending still works, but the scheduled sender cannot use the superuser method to save a copy to the Sent folder.

If you previously set sendlater_sent_retention_days or sendlater_stale_sending_minutes in Roundcube's main config, those values remain the fallback when the plugin config leaves the corresponding option null. sendlater_save_sent_messages can override Roundcube's global no_save_sent_messages; when it is null, that global option remains the fallback.

The sender recovers claims left in sending for longer than 15 minutes. Change $config['sendlater_stale_sending_minutes'] in the plugin config to change this lease; choose a value longer than the maximum SMTP delivery time in your deployment. A recovered message is retried, so a process that is still delivering after the lease expires could cause a duplicate.

Each scheduled-sender run also removes up to 500 records whose status is sent and whose scheduled_time is more than 90 days old. This keeps cleanup incremental and uses the scheduled time as the retention reference. Change $config['sendlater_sent_retention_days'] in the plugin config to set a different retention period; values are treated as at least one day.

Set $config['sendlater_save_sent_messages'] to true or false to override Roundcube's global no_save_sent_messages; leave it null to inherit the global setting. SendLater uses each user's sent_mbox preference first, then the plugin's sendlater_sent_mbox override, then Roundcube's global sent_mbox. Set the plugin option to an empty string to disable the global fallback. The retention and stale-claim options similarly inherit same-named values from Roundcube's main config when left null, and otherwise default to 90 days and 15 minutes.

Usage

Schedule a message

  1. Compose a message in Roundcube.
  2. Choose Send Later, select a future date and time, and confirm.
  3. The plugin stores the message and returns to the Roundcube mail view.

Manage pending messages

Open Pending Messages in the mail view to list queued messages. From the list you can edit a message, send it immediately, or delete it. Editing opens the message in Roundcube's compose view with its body and attachments restored. Save it again with Send Later to update its queued content and schedule.

Automatically send due messages

Configure cron to run the sender regularly, for example once per minute:

* * * * * php /path/to/roundcube/plugins/sendlater/bin/send_scheduled.php

Run the same command manually to process due messages. The script loads Roundcube's configuration and database and uses Roundcube's SMTP setup. Ensure the cron environment can run PHP and read the Roundcube installation and its configuration.

Troubleshooting

  • Messages remain pending: Check the cron schedule and the Roundcube/PHP error logs. Confirm the Roundcube SMTP configuration works.
  • Schema errors: Run bin/update_schema.php from the installed plugin path and verify that the Roundcube database user can create and alter tables.
  • Sent copies are missing: SMTP delivery does not depend on IMAP superuser access. To save a copy through the plugin's superuser method, verify the optional credentials and IMAP server configuration.
  • Editing an attachment fails: The plugin reports an error and prevents saving the edited queued message if it cannot restore all stored attachments; reopen the pending message and check Roundcube's logs.

Project files

  • sendlater.php: plugin hooks, UI actions, persistence, and message editing.
  • bin/send_scheduled.php: command-line sender intended for cron.
  • bin/update_schema.php: database schema creation and upgrade utility.
  • localization/: English and Italian translations.
  • js/ and css/: plugin interface assets.

Version and license

Version: 1.6.1. See CHANGELOG.md for release history and upgrade notes. Licensed under GNU GPL v3 or later; see LICENSE.

Author: Luigi Trovato lonestar@lonestar.it.