Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] Question about a complex setting I want to add

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: Luc Didry <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-developpers] Question about a complex setting I want to add
  • Date: Mon, 19 Nov 2018 13:29:51 +0900

On Fri, 16 Nov 2018 12:23:25 +0100
Luc Didry <address@concealed> wrote:

> Hello,
>
> I want to work on https://github.com/sympa-community/sympa/issues/296,
> that suggests a domains correction feature. For ex., automatically
> change addresses in gmail.fr to the correct domain, gmail.com.
>
> I need a way to let the admin give a complex setting like that:
> domain_correction {
> gmail.com => ['gmail.*'],
> wanadoo.fr => ['wandoo.fr', 'wanado.fr']
> }
>
> As you can see, I want to not only handle a simple substitution of
> text, but with a sort of a globbing feature (just globbing, I think
> regexes would be too error-prone).
>
> I already succeded to add a setting that has a comma-separated list as
> value, and split it to use it, but what I want to do is more complex.
>
> This is what I consider:
> - adding a boolean setting to use the domain correction or not
> - having the perl structure in a file in the `default` directory, so
> it can be overriden (so the real configuration of the feature would
> be in it, not in `sympa.conf`)
> - when using the domain correction, that file would be read and used
>
> What do you think?

I feel wildcard may be overkill. For example:
- gmail.de, gmail.com.br, gmail.co.kr etc. are registered by Google,
- gmail.us, gmail.co.jp, gmail.ne.jp etc. are registered by the other
organizations.
"gmail.*" will match with all of them and might replace them with
"gmail.com".

Exact matching or suffix matching seems better: Like Postfix's access
table for host name patterns (See Postfix's access(5) manpage).

On file format, lists' config is suggestive. Below is an example using
array of paragraphs (See also "Structure of configuration" in
Sympa::Config):

```
domain_correction
from gmail.de
to gmail.com

domain_correction
from gmail.com.br
to gmail.com

domain_correction
from gmail.co.kr
to gmail.com

domain_correction
from wandoo.fr
to wanadoo.fr

domain_correction
from wanado.fr
to wanadoo.fr
```

Currently sympa.conf is less expressive (I plan to integrate it into
Sympa::Config scheme above). Separate configuration file may be
required at the present.


Regards,
-- Soji

> --
> Luc
> "La route est longue, mais la voie est libre…" https://framasoft.org
>
> Framasoft ne vit que par vos dons (déductibles des impôts). Merci d'avance
> pour votre soutien https://soutenir.framasoft.org
>
>
>
>


--
株式会社 コンバージョン
ITソリューション部 システムソリューション1グループ 池田荘児
〒140-0014 東京都品川区大井1-49-15 アクセス大井町ビル4F
e-mail address@concealed TEL 03-6429-2880
https://www.conversion.co.jp/



Archive powered by MHonArc 2.6.19+.

Top of Page