use same line seperator for output as input in dkimsign

Bug #1808686 reported by meeuw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dkimpy
Fix Released
Low
Scott Kitterman

Bug Description

Hi, I'm using dkimsign to sign my mail but it forces <cr><lf> when the input has only <lf> line separators. I've created this patch to fix it:

https://github.com/meeuw/dkimpy/compare/linesep?expand=1

(I cannot find how git push to launchpad)

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1808686] [NEW] use same line seperator for output as input in dkimsign

On Sunday, December 16, 2018 12:19:55 PM you wrote:
> Public bug reported:
>
> Hi, I'm using dkimsign to sign my mail but it forces <cr><lf> when the
> input has only <lf> line separators. I've created this patch to fix it:
>
> https://github.com/meeuw/dkimpy/compare/linesep?expand=1
>
> (I cannot find how git push to launchpad)

You push to a new branch in your own account namespace and then you can make a
merge request. It looks like http://tuxdiary.com/2015/05/02/launchpad-git/
has some hints.

I'm fine with the concept, but I think it needs more work.

As far as the change in dkimsign.py, I'd rather see '\r\n' the default of the
check. As an example, a single long line with no newline at the end should be
folded the same as before the change.

Arcsign.py will need the same changes.

For the internal dkim/__init__.py changes, I'm fine with the API extension,
but for class DomainSigner(object), it should be added to the @param list (I
know there are others missing too, but let's not make it worse).

Finally, it needs a test case in dkim/tests/test_dkim.py, so we know this
works. It needs to pass on at least python2.7, python3.6, and python3.7.
Testing python3.3 - 3.5 would be nice.

Thanks,

Scott K

Revision history for this message
meeuw (dick-mrns) wrote :

Thanks for your review, I've created a merge request, could you please have a look at it?

Changed in dkimpy:
milestone: none → 0.9.2
assignee: nobody → Scott Kitterman (kitterman)
importance: Undecided → Low
status: New → In Progress
Changed in dkimpy:
status: In Progress → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

2019-04-14 Version 0.9.2
    - Fix the arcsign script so it works with the current API (Note: the new
      srv_id option is the authserv_id to use in the ARC signatures - Only AR
      fields with an authserv-id that matches srv_id will be considered for
      ARC signing)
    - Fix cv=none processing for initial signature in chain
    - Add additional text documenting use of srv_id for ARC signing to
      docstrings and man 1 arcsign (LP: #1808301)
    - Use same line seperator for output as input in dkimsign/arcsign
      (LP: #1808686)
    - Refactor canonicalization.py strip_trailing_lines to avoid using re for
      more consistent processing across python versions (Thanks to Jonathan
      Bastien-Filiatrault for the change)
    - Refactor header folding for more consistent results, including reduced
      stray whitespace (Also Jonathan Bastien-Filiatrault)
    - Don't log message headers and body unless explicitely requested. This
      should also reduce memory usage on large messages. (Jonathan
      Bastien-Filiatrault)
    - Clarify the crlf does not count towards line length in fold
    - Adjust fold maxlen to one shorter for lines after the first, since they
      already have a leading space (LP: #1823008)

Changed in dkimpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.