foundata/identity_from_config

在每个登录时自动填充和维护用户身份,基于静态配置文件中的相应数据。

v1.0.1 2024-05-13 23:22 UTC

This package is auto-updated.

Last update: 2024-09-14 00:20:03 UTC


README

A Roundcube 插件,用于在每个登录时自动填充和维护用户电子邮件身份,基于插件配置文件中的相应数据。主要用例是维护共享邮箱(如 info@example.com)的身份,以一致且简单的方式,例如在使用 共享 IMAP 命名空间 时。

您可以将此插件与 identity_from_directory 结合使用,该插件使用 LDAP 或 Active Directory 来维护电子邮件身份。

目录

安装

使用 Composer 安装

以下命令通过 Composer插件包 安装到 plugins/identity_from_config

php composer.phar require --update-no-dev -o "foundata/identity_from_config:*"

如果您想从 Git 使用当前的开发版本,请使用 -o "foundata/identity_from_config:dev-main"。当 Composer 询问您是否要在 Roundcube 配置中启用插件时,请用 y 确认。或者,您可以手动将 identity_from_config 添加到 Roundcube 的 $config['plugins'] 数组中。

现在您可以 配置 插件了。

从发布归档安装

下载最新的 identity_from_config-vX.Y.Z.tar.gz 归档文件(不要使用 Github 为每个发布自动创建的“源代码”存档)。将其提取到 plugins/,所有文件都必须位于 plugins/identity_from_config/ 中。

如果您在目标服务器上有 shell,以下是一个有用的片段

# set Rouncube's installation path, adapt if needed
roundcube_install_dir="/var/lib/roundcube"

# get version number of the latest release
version="$(curl -s -L https://api.github.com/repos/foundata/roundcube-plugin-identity-from-config/releases/latest | jq -r '.tag_name' | sed -e 's/^v//g')"
printf '%s\n' "${version}"

# download
curl -L "https://github.com/foundata/roundcube-plugin-identity-from-config/releases/download/v${version}/identity_from_config-v${version}.tar.gz" \
  > "/tmp/identity_from_config.tar.gz"

# extract and cleanup
cd "${roundcube_install_dir}/plugins" && tar -xzvf "/tmp/identity_from_config.tar.gz" && rm "/tmp/identity_from_config.tar.gz"

配置 插件并将 identity_from_config 添加到 Roundcube 的 $config['plugins'] 数组中以启用它。

更新

使用 Composer 更新

以下命令通过 Composer 更新 插件包

php composer.phar update --no-dev -o "foundata/identity_from_config:*"`

从发布归档更新

更新就像覆盖现有文件一样简单。只需再次遵循 安装说明 即可获取最新版本。这应该是一个低风险操作,因为此插件不执行数据库模式更改,并且该项目遵循 语义版本化。变更日志 changelog 将通知您在升级期间可能需要的任何手动操作,通常仅适用于主要版本增量。

配置

  • 将模板 config.inc.php.dist 复制到 config.inc.php(Composer 可能已经为您做了这件事)
  • 现在根据需要编辑 plugins/identity_from_config/config.inc.php。每个配置值都有详细的 内联注释 描述。

一些额外的说明

  • 所有插件操作仅在用户登录时触发。因此,请退出并重新登录以测试新的配置。
  • 此插件在技术上与Roundcube的$config['identities_level']配置选项的所有值兼容。然而,1(用户可以编辑所有参数,但不能编辑电子邮件地址,以及不能在UI中添加或删除身份)或3(用户可以编辑所有参数,但不能编辑电子邮件地址,且不能在UI中添加或删除身份)更有意义。

identity_from_directory插件一起使用时

请确保排除由identity_from_config插件创建的身份,不要将其包括在identity_from_directory插件的未管理身份自动清理中

  1. 编辑/plugins/identity_from_directory/config.inc.php
  2. $config['identity_from_directory_exclude_delete_unmanaged_regex']设置为一个合适的值,例如'/^(office|info)@example\.(com|net)$/im',这将排除电子邮件地址为office@example.cominfo@example.comoffice@example.netinfo@example.net的身份,从而防止自动清理(不区分大小写)

兼容性

  • Roundcube 1.6或更高版本。
  • PHP 7.4或更高版本。
  • 没有特殊的数据库要求。此插件不修改数据库架构,而是使用Roundcube内置的动作和钩子来处理身份数据。

该插件可能与上述列出的旧版本兼容,但尚未测试且不支持。我们建议使用最新稳定的Roundcube版本和PHP 8.x,这是该插件测试最多的。

许可、版权

版权所有(c)2024,foundata GmbH(《https://foundata.com》)

本项目采用GNU通用公共许可证v3.0或更高版本许可(SPDX-License-Identifier: GPL-3.0-or-later),请参阅LICENSES/GPL-3.0-or-later.txt获取全文。

.reuse/dep5文件以人类和机器可读的格式提供了详细的许可和版权信息。这包括可能受不同许可或使用条款约束的部分,例如第三方组件。该存储库符合REUSE规范,您可以使用reuse spdx创建SPDX软件物料清单(SBOM)

REUSE status

作者信息

该项目由foundata创建并维护。如果您喜欢它,您可能会给他们买一杯咖啡