1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-04-21 12:17:05 +02:00

Chore: Tag names now allow . and must be a minimum of 1 character

This commit is contained in:
Ralph Slooten 2024-03-02 00:13:18 +13:00
parent 85473762c5
commit 23b1261cf9
3 changed files with 6 additions and 6 deletions

View File

@ -85,7 +85,7 @@ var (
SMTPCLITags string SMTPCLITags string
// ValidTagRegexp represents a valid tag // ValidTagRegexp represents a valid tag
ValidTagRegexp = regexp.MustCompile(`^([a-zA-Z0-9\-\ \_]){3,}$`) ValidTagRegexp = regexp.MustCompile(`^([a-zA-Z0-9\-\ \_\.]){1,}$`)
// SMTPTags are expressions to apply tags to new mail // SMTPTags are expressions to apply tags to new mail
SMTPTags []AutoTag SMTPTags []AutoTag

View File

@ -10,7 +10,7 @@ import (
var ( var (
// Invalid tag characters regex // Invalid tag characters regex
tagsInvalidChars = regexp.MustCompile(`[^a-zA-Z0-9\-\ \_]`) tagsInvalidChars = regexp.MustCompile(`[^a-zA-Z0-9\-\ \_\.]`)
// Regex to catch multiple spaces // Regex to catch multiple spaces
multiSpaceRe = regexp.MustCompile(`(\s+)`) multiSpaceRe = regexp.MustCompile(`(\s+)`)

View File

@ -301,7 +301,7 @@ export default {
<tr v-if="message.ReplyTo && message.ReplyTo.length" class="small"> <tr v-if="message.ReplyTo && message.ReplyTo.length" class="small">
<th class="text-nowrap">Reply-To</th> <th class="text-nowrap">Reply-To</th>
<td class="privacy text-body-secondary text-break"> <td class="privacy text-body-secondary text-break">
<span v-for="( t, i ) in message.ReplyTo "> <span v-for="(t, i) in message.ReplyTo">
<template v-if="i > 0">,</template> <template v-if="i > 0">,</template>
<span class="text-spaces">{{ t.Name }}</span> <span class="text-spaces">{{ t.Name }}</span>
&lt;<a :href="searchURI(t.Address)" class="text-body-secondary"> &lt;<a :href="searchURI(t.Address)" class="text-body-secondary">
@ -337,11 +337,11 @@ export default {
<select class="form-select small tag-selector" v-model="messageTags" multiple <select class="form-select small tag-selector" v-model="messageTags" multiple
data-full-width="false" data-suggestions-threshold="1" data-allow-new="true" data-full-width="false" data-suggestions-threshold="1" data-allow-new="true"
data-clear-end="true" data-allow-clear="true" data-placeholder="Add tags..." data-clear-end="true" data-allow-clear="true" data-placeholder="Add tags..."
data-badge-style="secondary" data-regex="^([a-zA-Z0-9\-\ \_]){3,}$" data-badge-style="secondary" data-regex="^([a-zA-Z0-9\-\ \_\.]){1,}$"
data-separator="|,|"> data-separator="|,|">
<option value="">Type a tag...</option> <option value="">Type a tag...</option>
<!-- you need at least one option with the placeholder --> <!-- you need at least one option with the placeholder -->
<option v-for=" t in mailbox.tags " :value="t">{{ t }}</option> <option v-for="t in mailbox.tags" :value="t">{{ t }}</option>
</select> </select>
<div class="invalid-feedback">Invalid tag name</div> <div class="invalid-feedback">Invalid tag name</div>
</td> </td>
@ -491,7 +491,7 @@ export default {
</button> </button>
<div class="d-none d-lg-block ms-auto me-3" v-if="showMobileButtons"> <div class="d-none d-lg-block ms-auto me-3" v-if="showMobileButtons">
<template v-for=" vals, key in responsiveSizes "> <template v-for="_, key in responsiveSizes">
<button class="btn" :disabled="scaleHTMLPreview == key" :title="'Switch to ' + key + ' view'" <button class="btn" :disabled="scaleHTMLPreview == key" :title="'Switch to ' + key + ' view'"
v-on:click="scaleHTMLPreview = key"> v-on:click="scaleHTMLPreview = key">
<i class="bi" :class="'bi-' + key"></i> <i class="bi" :class="'bi-' + key"></i>