voxpupuli / puppet-postfix

Puppet postfix module
Apache License 2.0
70 stars 172 forks source link

Extend canonical augeas lens regex #382

Closed giacomd closed 5 months ago

giacomd commented 5 months ago

Pull Request (PR) description

Add support for a wider range of e-mail addresses.

From RFC 3696 (informational only but referring to RFC 2821 and RFC 2822):

   Without quotes, local-parts may consist of any combination of
   alphabetic characters, digits, or any of the special characters

      ! # $ % & ' * + - / = ?  ^ _ ` . { | } ~

   period (".") may also appear, but may not be used to start or end the
   local part, nor may two or more consecutive periods appear.  Stated
   differently, any ASCII graphic (printing) character other than the
   at-sign ("@"), backslash, double quote, comma, or square brackets may
   appear without quoting.  If any of that list of excluded characters
   are to appear, they must be quoted.

Note that due to the format of canonical(5) we can't include addresses starting with # despite being valid e-mail addresses as they are treated as comments. Apart from that exclusion, the defined regexp is a compromise that includes a bit more than allowed (in particular includes addresses with multiple @ and doesn't check for . not being at the start or at the end of the local part, but as discussed at #345 this should be fine.

This Pull Request (PR) fixes the following issues

Fixes #345