You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ponymail.apache.org by GitBox <gi...@apache.org> on 2021/11/27 01:56:52 UTC

[GitHub] [incubator-ponymail-foal] sebbASF opened a new issue #162: Use email.headerregistry classes?

sebbASF opened a new issue #162:
URL: https://github.com/apache/incubator-ponymail-foal/issues/162


   The headerregistry classes [1] look useful for parsing, especially for address types which are rather complicated.
   
   In particular the AddressHeader handles multiple addresses, and splits the address into display and email.
   
   MessageID was added in 3.8, but does not trim leading spaces. That is trivial to fix.
   
   [1] https://docs.python.org/3.7/library/email.headerregistry.html


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ponymail.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ponymail-foal] sebbASF commented on issue #162: Use email.headerregistry classes?

Posted by GitBox <gi...@apache.org>.
sebbASF commented on issue #162:
URL: https://github.com/apache/incubator-ponymail-foal/issues/162#issuecomment-980656074


   Note: unless the compat32 policy is used, the values returned from msg.get() are already instances of BaseHeader.
   
   However the code does not yet use the additional features.
   For example one can do something like this:
   
   ```
   if isinstance(val, email.headerregistry.AddressHeader):
       msg_metadata[key] = []
       for addr in val.addresses:
           msg_metadata[key].append(str(addr))
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ponymail.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ponymail-foal] sebbASF commented on issue #162: Use email.headerregistry classes?

Posted by GitBox <gi...@apache.org>.
sebbASF commented on issue #162:
URL: https://github.com/apache/incubator-ponymail-foal/issues/162#issuecomment-986045973


   Further experimentation shows that the new policies are stricter when parsing headers.
   This could be a problem, especially when importing older emails.
   
   It will be difficult to maintain compatibility with earlier versions and with mod_mbox.
   This is especially true of Message-ID and References (though the latter does not yet have a header parser).
   It might be necessary to override the parsers for these headers


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ponymail.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-ponymail-foal] sebbASF commented on issue #162: Use email.headerregistry classes?

Posted by GitBox <gi...@apache.org>.
sebbASF commented on issue #162:
URL: https://github.com/apache/incubator-ponymail-foal/issues/162#issuecomment-980631015


   It looks like policy=compat32 does not use the headerregistry, so this would need to be taken into account if the option is to be kept.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ponymail.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org