mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
sysutils/mail-backup: make setup fully functional
This commit is contained in:
@@ -13,7 +13,6 @@ use OPNsense\Backup\MailerSettings;
|
||||
*/
|
||||
class Mailer extends Base implements IBackupProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* get required (user interface) fields for backup connector
|
||||
* @return array configuration fields, types and description
|
||||
@@ -204,7 +203,8 @@ class Mailer extends Base implements IBackupProvider
|
||||
return $attachmentName;
|
||||
}
|
||||
|
||||
function import_key($gpgPublicKey) {
|
||||
function import_key($gpgPublicKey)
|
||||
{
|
||||
$descriptorspec = array(
|
||||
0 => array("pipe", "r"),
|
||||
1 => array("pipe", "w"),
|
||||
@@ -222,7 +222,8 @@ class Mailer extends Base implements IBackupProvider
|
||||
}
|
||||
}
|
||||
|
||||
function encrypt_data($confdata, $gpgEmail) {
|
||||
function encrypt_data($confdata, $gpgEmail)
|
||||
{
|
||||
$descriptorspec = array(
|
||||
0 => array("pipe", "r"),
|
||||
1 => array("pipe", "w"),
|
||||
@@ -245,7 +246,7 @@ class Mailer extends Base implements IBackupProvider
|
||||
break;
|
||||
}
|
||||
$config .= $string;
|
||||
} while(true);
|
||||
} while (true);
|
||||
fclose($pipes[1]);
|
||||
file_put_contents("backup", $config);
|
||||
|
||||
|
||||
+13
-16
@@ -1,18 +1,19 @@
|
||||
<model>
|
||||
<mount>//system/backup/mailer</mount>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
<description>OPNsense Mailer Backup Settings</description>
|
||||
<items>
|
||||
<Enabled type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
<default>0</default>
|
||||
<Required>Y</Required>
|
||||
</Enabled>
|
||||
<Receiver type="EmailField">
|
||||
<Constraints>
|
||||
<check001>
|
||||
<ValidationMessage>Please provide an e-mail address.</ValidationMessage>
|
||||
<type>DependConstraint</type>
|
||||
<addFields>
|
||||
<field1>enabled</field1>
|
||||
<field1>Enabled</field1>
|
||||
</addFields>
|
||||
</check001>
|
||||
</Constraints>
|
||||
@@ -20,27 +21,23 @@
|
||||
<SmtpHost type="HostnameField">
|
||||
<Constraints>
|
||||
<check001>
|
||||
<ValidationMessage>Please provide an e-mail server.</ValidationMessage>
|
||||
<type>DependConstraint</type>
|
||||
<addFields>
|
||||
<field1>enabled</field1>
|
||||
<field1>Enabled</field1>
|
||||
</addFields>
|
||||
</check001>
|
||||
</Constraints>
|
||||
</SmtpHost>
|
||||
<SmtpPort type="IntegerField">
|
||||
<Constraints>
|
||||
<check001>
|
||||
<type>DependConstraint</type>
|
||||
<addFields>
|
||||
<field1>enabled</field1>
|
||||
</addFields>
|
||||
</check001>
|
||||
</Constraints>
|
||||
<SmtpPort type="PortField">
|
||||
<default>25</default>
|
||||
<Required>Y</Required>
|
||||
</SmtpPort>
|
||||
<SmtpTLS type="BooleanField">
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
</SmtpTLS>
|
||||
<SelfSigned type="BooleanField"/>
|
||||
<SmtpUsername type="TextField"/>
|
||||
<SmtpPassword type="TextField"/>
|
||||
<GpgEmail type="EmailField"/>
|
||||
|
||||
Reference in New Issue
Block a user