Skip to content

Commit

Permalink
fix(autoconf-validation): If autoconfig does not respond with full se…
Browse files Browse the repository at this point in the history
…ttings, do not auto-attempt configuration check
  • Loading branch information
andris9 committed Aug 29, 2024
1 parent 4d53462 commit cdc5765
Show file tree
Hide file tree
Showing 18 changed files with 528 additions and 411 deletions.
23 changes: 18 additions & 5 deletions lib/routes-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -6679,7 +6679,17 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
'accounts/register/imap-server',
{
values,
autoTest: values._source && values.imap_auth_user && values.smtp_auth_user && values.imap_auth_pass && values.smtp_auth_pass && true
autoTest:
values._source &&
values.imap_auth_user &&
values.smtp_auth_user &&
values.imap_auth_pass &&
values.smtp_auth_pass &&
values.imap_host &&
values.smtp_host &&
values.imap_port &&
values.smtp_port &&
true
},
{
layout: 'public'
Expand Down Expand Up @@ -6821,14 +6831,15 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
payload: Joi.object({
imap_auth_user: Joi.string().empty('').trim().max(1024).required(),
imap_auth_pass: Joi.string().empty('').max(1024).required(),
imap_host: Joi.string().hostname().required().example('imap.gmail.com').description('Hostname to connect to'),
imap_host: Joi.string().hostname().required().example('imap.gmail.com').description('Hostname to connect to').label('IMAP host'),
imap_port: Joi.number()
.integer()
.min(1)
.max(64 * 1024)
.required()
.example(993)
.description('Service port number'),
.description('Service port number')
.label('IMAP port'),
imap_secure: Joi.boolean()
.truthy('Y', 'true', '1', 'on')
.falsy('N', 'false', 0, '')
Expand All @@ -6851,13 +6862,15 @@ ${Buffer.from(data.content, 'base64url').toString('base64')}
.max(64 * 1024)
.required()
.example(465)
.description('Service port number'),
.description('Service port number')
.label('SMTP host'),
smtp_secure: Joi.boolean()
.truthy('Y', 'true', '1', 'on')
.falsy('N', 'false', 0, '')
.default(false)
.example(true)
.description('Should connection use TLS. Usually true for port 465')
.label('SMTP port')
})
}
}
Expand Down Expand Up @@ -9341,7 +9354,7 @@ ${now}`,
data = JSON.parse(data);

if (!data || typeof data !== 'object' || data.act !== 'unsub') {
throw new Error('Invalid input');
throw new Error(gt.gettext('Invalid input'));
}

// throws if account does not exist
Expand Down
3 changes: 2 additions & 1 deletion lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const v8 = require('node:v8');
const { reverse: dnsReverse } = require('dns').promises;
const googleCrawlerRanges = require('../data/google-crawlers.json');
const { resolvePublicInterfaces } = require('pubface');
const { gt } = require('./translations');

const { fetch: fetchCmd, Agent } = require('undici');
const fetchAgent = new Agent({ connect: { timeout: FETCH_TIMEOUT } });
Expand Down Expand Up @@ -727,7 +728,7 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEV3QUiYsp13nD9suD1/ZkEXnuMoSg
err
});

let message = 'Invalid input';
let message = gt.gettext('Invalid input');
let error = Boom.boomify(new Error(message), { statusCode: 400 });
error.output.payload.fields = details;

Expand Down
14 changes: 10 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sbom.json

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions static/licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,12 @@ <h1>EmailEngine v2.45.1</h1><p>EmailEngine includes code from the following soft
</tr>
<tr>
<td><a href="https://npmjs.com/package/@root/asn1">@root/asn1</a></td>
<td>1.0.0</td>
<td>1.0.2</td>
<td>MPL-2.0</td>
<td>AJ ONeal</td>
<td>coolaj86@gmail.com</td>
<td>aj@therootcompany.com</td>
<td>
<a href="https://git.rootprojects.org/root/asn1.js">git.rootprojects.org/root/asn1.js</a>
<a href="https://github.com/therootcompany/asn1.js">github.com/therootcompany/asn1.js</a>
</td
</tr>
<tr>
Expand Down Expand Up @@ -885,6 +885,16 @@ <h1>EmailEngine v2.45.1</h1><p>EmailEngine includes code from the following soft
</td
</tr>
<tr>
<td><a href="https://npmjs.com/package/@types/root__asn1">@types/root__asn1</a></td>
<td>1.0.5</td>
<td>MIT</td>
<td></td>
<td></td>
<td>
<a href="https://github.com/DefinitelyTyped/DefinitelyTyped">github.com/DefinitelyTyped/DefinitelyTyped</a>
</td
</tr>
<tr>
<td><a href="https://npmjs.com/package/@ungap/structured-clone">@ungap/structured-clone</a></td>
<td>1.2.0</td>
<td>ISC</td>
Expand Down
Binary file modified translations/de.mo
Binary file not shown.
Loading

0 comments on commit cdc5765

Please sign in to comment.