diff --git a/code/web/services/Admin/SMTPSettings.php b/code/web/services/Admin/SMTPSettings.php
new file mode 100644
index 0000000000..5bbcc2f007
--- /dev/null
+++ b/code/web/services/Admin/SMTPSettings.php
@@ -0,0 +1,81 @@
+limit(($page - 1) * $recordsPerPage, $recordsPerPage);
+ $this->applyFilters($object);
+ $object->find();
+ $objectList = [];
+ while ($object->fetch()) {
+ $objectList[$object->id] = clone $object;
+ }
+ return $objectList;
+ }
+
+ function getDefaultSort(): string {
+ return 'id asc';
+ }
+
+ function canSort(): bool {
+ return false;
+ }
+
+ function getObjectStructure($context = ''): array {
+ return SMTPSetting::getObjectStructure($context);
+ }
+
+ function getPrimaryKeyColumn(): string {
+ return 'id';
+ }
+
+ function getIdKeyColumn(): string {
+ return 'id';
+ }
+
+ function getAdditionalObjectActions($existingObject): array {
+ return [];
+ }
+
+ function getInstructions(): string {
+ return '';
+ }
+
+ function getBreadcrumbs(): array {
+ $breadcrumbs = [];
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home');
+ $breadcrumbs[] = new Breadcrumb('/Admin/Home#system_admin', 'System Administration');
+ $breadcrumbs[] = new Breadcrumb('/Admin/SMTPSettings', 'SMTP Settings');
+ return $breadcrumbs;
+ }
+
+ function getActiveAdminSection(): string {
+ return 'email';
+ }
+
+ function canView(): bool {
+ return UserAccount::userHasPermission('Administer SMTP');
+ }
+
+
+}
\ No newline at end of file
diff --git a/code/web/sys/Account/User.php b/code/web/sys/Account/User.php
index 165639c008..7699e2da4c 100644
--- a/code/web/sys/Account/User.php
+++ b/code/web/sys/Account/User.php
@@ -3503,6 +3503,7 @@ public function getAdminActions() {
$sections['email']->addAction(new AdminAction('Email Templates', 'Templates for various emails sent from Aspen Discovery.', '/Admin/EmailTemplates'), ['Administer All Email Templates', 'Administer Library Email Templates']);
$sections['email']->addAction(new AdminAction('Amazon SES Settings', 'Settings to allow Aspen Discovery to send emails via Amazon SES.', '/Admin/AmazonSesSettings'), 'Administer Amazon SES');
$sections['email']->addAction(new AdminAction('Send Grid Settings', 'Settings to allow Aspen Discovery to send emails via SendGrid.', '/Admin/SendGridSettings'), 'Administer SendGrid');
+ $sections['email']->addAction(new AdminAction('SMTP Settings', 'Settings to allow Aspen Discovery to send emails via an SMTP server.', '/Admin/SMTPSettings'), 'Administer SMTP');
$sections['ils_integration'] = new AdminSection('ILS Integration');
$indexingProfileAction = new AdminAction('Indexing Profiles', 'Define how records from the ILS are loaded into Aspen Discovery.', '/ILS/IndexingProfiles');
diff --git a/code/web/sys/DBMaintenance/user_updates.php b/code/web/sys/DBMaintenance/user_updates.php
index 12dd7900b6..e6158e5e18 100644
--- a/code/web/sys/DBMaintenance/user_updates.php
+++ b/code/web/sys/DBMaintenance/user_updates.php
@@ -406,6 +406,7 @@ function getUserUpdates() {
,('System Administration', 'Administer Permissions', '', 15, 'Allows configuration of the roles within Aspen Discovery and what each role can do. Give to trusted users, this has security implications.')
,('System Administration', 'Run Database Maintenance', '', 20, 'Controls if the user can run database maintenance or not.')
,('System Administration', 'Administer SendGrid', '', 30, 'Controls if the user can change SendGrid settings. This has potential security and cost implications.')
+ ,('System Administration', 'Administer SMTP', '', 30, 'Controls if the user can change SMTP settings.')
,('System Administration', 'Administer System Variables','', 40, 'Controls if the user can change system variables.')
,('Reporting', 'View System Reports', '', 0, 'Controls if the user can view System Reports that show how Aspen Discovery performs and how background tasks are operating. Includes Indexing Logs and Dashboards.')
,('Reporting', 'View Indexing Logs', '', 10, 'Controls if the user can view Indexing Logs for the ILS and eContent.')
diff --git a/code/web/sys/DBMaintenance/version_updates/24.06.00.php b/code/web/sys/DBMaintenance/version_updates/24.06.00.php
index 4f497d3f5f..aaf312cc9a 100644
--- a/code/web/sys/DBMaintenance/version_updates/24.06.00.php
+++ b/code/web/sys/DBMaintenance/version_updates/24.06.00.php
@@ -144,6 +144,34 @@ function getUpdates24_06_00(): array {
],
], //full_text_limiter
+ //pedro - PTFS-Europe
+ 'smtp_settings' => [
+ 'title' => 'SMTP Settings',
+ 'description' => 'Allow configuration of SMTP to send mail from',
+ 'sql' => [
+ "CREATE TABLE smtp_settings (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ name varchar(80) NOT NULL,
+ host varchar(80) NOT NULL DEFAULT 'localhost',
+ port int(11) NOT NULL DEFAULT 25,
+ ssl_mode enum('disabled','ssl','tls') NOT NULL,
+ from_address varchar(80) DEFAULT NULL,
+ user_name varchar(80) DEFAULT NULL,
+ password varchar(80) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB",
+ ],
+ ], //smtp_settings
+
+ 'permissions_create_administer_smtp' => [
+ 'title' => 'Create Administer SMTP Permission',
+ 'description' => 'Controls if the user can change SMTP settings',
+ 'sql' => [
+ "INSERT INTO permissions (sectionName, name, requiredModule, weight, description) VALUES ('Primary Configuration', 'Administer SMTP', '', 30, 'Controls if the user can change SMTP settings.')",
+ "INSERT INTO role_permissions(roleId, permissionId) VALUES ((SELECT roleId from roles where name='opacAdmin'), (SELECT id from permissions where name='Administer SMTP'))",
+ ],
+ ], //permissions_create_administer_smtp
+
//other
diff --git a/code/web/sys/Email/SMTPSetting.php b/code/web/sys/Email/SMTPSetting.php
new file mode 100644
index 0000000000..930f9aed2f
--- /dev/null
+++ b/code/web/sys/Email/SMTPSetting.php
@@ -0,0 +1,87 @@
+ [
+ 'property' => 'id',
+ 'type' => 'label',
+ 'label' => 'Id',
+ 'description' => 'The unique id',
+ ],
+ 'name' => [
+ 'property' => 'name',
+ 'type' => 'text',
+ 'label' => 'Server name',
+ 'description' => 'The name of the server',
+ 'default' => 'heyo',
+ 'required' => true,
+ ],
+ 'host' => [
+ 'property' => 'host',
+ 'type' => 'text',
+ 'label' => 'Host',
+ 'description' => 'The SMTP host',
+ 'default' => 'localhost',
+ 'required' => true,
+ ],
+ 'port' => [
+ 'property' => 'port',
+ 'type' => 'integer',
+ 'label' => 'Port',
+ 'description' => 'The utilized port',
+ 'default' => '25',
+ 'required' => true,
+ ],
+ 'ssl_mode' => [
+ 'property' => 'ssl_mode',
+ 'type' => 'enum',
+ 'values' => [
+ 'disabled' => 'Disabled',
+ 'ssl' => 'SSL',
+ 'tls' => 'StartTLS',
+ ],
+ 'label' => 'SSL mode',
+ 'description' => 'SSL mode',
+ ],
+ 'from_address' => [
+ 'property' => 'from_address',
+ 'type' => 'text',
+ 'label' => 'From',
+ 'description' => 'The \'From:\' e-mail address',
+ 'default' => '',
+ 'required' => true,
+ ],
+ 'user_name' => [
+ 'property' => 'user_name',
+ 'type' => 'text',
+ 'label' => 'Username',
+ 'description' => 'The username',
+ 'default' => '',
+ 'required' => true,
+ ],
+ 'password' => [
+ 'property' => 'password',
+ 'type' => 'storedPassword',
+ 'label' => 'Password',
+ 'description' => 'The password',
+ 'default' => '',
+ ],
+ ];
+ }
+
+ function getActiveAdminSection(): string {
+ return 'system_admin';
+ }
+}
\ No newline at end of file
diff --git a/install/aspen.sql b/install/aspen.sql
index cf86c32bf5..b96acb6881 100644
--- a/install/aspen.sql
+++ b/install/aspen.sql
@@ -4681,6 +4681,18 @@ CREATE TABLE `slow_page` (
PRIMARY KEY (`id`),
KEY `year` (`year`,`month`,`module`,`action`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+DROP TABLE IF EXISTS smtp_settings;
+CREATE TABLE `smtp_settings` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `host` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'localhost',
+ `port` int(11) NOT NULL DEFAULT 25,
+ `ssl_mode` enum('disabled','ssl','tls') NOT NULL,
+ `from_address` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `user_name` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ `password` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
DROP TABLE IF EXISTS springshare_libcal_events;
CREATE TABLE `springshare_libcal_events` (
`id` int(11) NOT NULL AUTO_INCREMENT,