mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
add smtp to frontend (#2802)
* add smtp to frontend * left align headers * just email * change all to email * fix test-smtp api * types * fix email from and login address handling --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -25,9 +25,9 @@ export const customSmtp = InputSpec.of<InputSpecOf<SmtpValue>, never>({
|
||||
name: "From Address",
|
||||
required: true,
|
||||
default: null,
|
||||
placeholder: "<name>test@example.com",
|
||||
placeholder: "Example Name <test@example.com>",
|
||||
inputmode: "email",
|
||||
patterns: [Patterns.email],
|
||||
patterns: [Patterns.emailWithName],
|
||||
}),
|
||||
login: Value.text({
|
||||
name: "Login",
|
||||
|
||||
10
sdk/base/lib/osBindings/TestSmtpParams.ts
Normal file
10
sdk/base/lib/osBindings/TestSmtpParams.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type TestSmtpParams = {
|
||||
server: string
|
||||
port: number
|
||||
from: string
|
||||
to: string
|
||||
login: string
|
||||
password: string | null
|
||||
}
|
||||
@@ -186,6 +186,7 @@ export { SignAssetParams } from "./SignAssetParams"
|
||||
export { SignerInfo } from "./SignerInfo"
|
||||
export { SmtpValue } from "./SmtpValue"
|
||||
export { StartStop } from "./StartStop"
|
||||
export { TestSmtpParams } from "./TestSmtpParams"
|
||||
export { UnsetPublicParams } from "./UnsetPublicParams"
|
||||
export { UpdatingState } from "./UpdatingState"
|
||||
export { VerifyCifsParams } from "./VerifyCifsParams"
|
||||
|
||||
@@ -52,6 +52,11 @@ export const email: Pattern = {
|
||||
description: "Must be a valid email address",
|
||||
}
|
||||
|
||||
export const emailWithName: Pattern = {
|
||||
regex: regexes.emailWithName.source,
|
||||
description: "Must be a valid email address, optionally with a name",
|
||||
}
|
||||
|
||||
export const base64: Pattern = {
|
||||
regex: regexes.base64.source,
|
||||
description:
|
||||
|
||||
@@ -26,8 +26,12 @@ export const torUrl =
|
||||
// https://ihateregex.io/expr/ascii/
|
||||
export const ascii = /^[ -~]*$/
|
||||
|
||||
//https://ihateregex.io/expr/email/
|
||||
export const email = /[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+/
|
||||
// https://www.regular-expressions.info/email.html
|
||||
export const email = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/
|
||||
|
||||
export const emailWithName = new RegExp(
|
||||
`(${email.source})|([^<]*<(${email.source})>)`,
|
||||
)
|
||||
|
||||
//https://rgxdb.com/r/1NUN74O6
|
||||
export const base64 =
|
||||
|
||||
Reference in New Issue
Block a user