mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 04:46:38 +03:00
Allow multiple localpart catch all separators, e.g. both "+" and "-", for addresses you+anything@example.com and you-anything@example.com
The original config option stays, and we still use it for the common case where we have a single separator. The "+" is configured by default. It is optional, just like the new option "LocalpartCatchallSeparators" (plural). When parsing the config file, we combine LocalpartCatchallSeparator and LocalpartCatchallSeparators into a single list LocalpartCatchallSeparatorsEffective, which we use throughout the code. For issue #301 by janc13
This commit is contained in:
@ -228,8 +228,8 @@ type EventStart struct {
|
||||
// the webmail client can decide if an address matches the addresses of the
|
||||
// account.
|
||||
type DomainAddressConfig struct {
|
||||
LocalpartCatchallSeparator string // Can be empty.
|
||||
LocalpartCaseSensitive bool
|
||||
LocalpartCatchallSeparators []string // Can be empty.
|
||||
LocalpartCaseSensitive bool
|
||||
}
|
||||
|
||||
// EventViewMsgs contains messages for a view, possibly a continuation of an
|
||||
@ -764,7 +764,7 @@ func serveEvents(ctx context.Context, log mlog.Log, accountPath string, w http.R
|
||||
domainAddressConfigs := map[string]DomainAddressConfig{}
|
||||
for _, a := range addresses {
|
||||
dom, _ := mox.Conf.Domain(a.Domain)
|
||||
domainAddressConfigs[a.Domain.ASCII] = DomainAddressConfig{dom.LocalpartCatchallSeparator, dom.LocalpartCaseSensitive}
|
||||
domainAddressConfigs[a.Domain.ASCII] = DomainAddressConfig{dom.LocalpartCatchallSeparatorsEffective, dom.LocalpartCaseSensitive}
|
||||
}
|
||||
|
||||
// Write first event, allowing client to fill its UI with mailboxes.
|
||||
|
Reference in New Issue
Block a user