# Suggestion: Djigzo should trim off whitespace in the beginning and/or end of any PGP header lines.

**URL:** <https://community.ciphermail.com/t/suggestion-djigzo-should-trim-off-whitespace-in-the-beginning-and-or-end-of-any-pgp-header-lines/459>\
**Category:** Gateway\
**Created:** [September 9, 2015, 4:10pm UTC](https://community.ciphermail.com/t/suggestion-djigzo-should-trim-off-whitespace-in-the-beginning-and-or-end-of-any-pgp-header-lines/459 "2015-09-09T16:10:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Nielsen1](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sebastian\_Nielsen1](https://community.ciphermail.com/u/Sebastian_Nielsen1)\
**Post date:** [September 9, 2015, 4:10pm UTC](https://community.ciphermail.com/t/suggestion-djigzo-should-trim-off-whitespace-in-the-beginning-and-or-end-of-any-pgp-header-lines/459/1 "2015-09-09T16:10:06Z")

</div>

Sometimes, a space, tab, linefeed or any other whitespace appears directly before or after the “-----BEGIN ....-----“ and “----END ....-----“ header lines when copying and pasting PGP messages from a PGP application into a webmail. An example is copying a encrypted message by double clicking a HTML table cell and pasting this in a conventional mail client, or copying and pasting from a PGP application into a webmail client. Then a space will be appended in the beginning and end, which is basically invisible for the naked eye.

This causes messages to not get decrypted or verified properly in ciphermail.

Any idea of fix? Both a temporarly fix I could implement right now, and a more permanent fix.

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [September 10, 2015, 11:10am UTC](https://community.ciphermail.com/t/suggestion-djigzo-should-trim-off-whitespace-in-the-beginning-and-or-end-of-any-pgp-header-lines/459/2 "2015-09-10T11:10:23Z")

</div>

Any fix, be it a quick fix or permanent fix, requires some code change.  
It's probably one line so if you are able to compile the code yourself I  
can tell you which line you can change to see whether it works.

Could you add a JIRA entry for this ([https://jira.djigzo.com](https://jira.djigzo.com)).

Kind regards,

Martijn Brinkers

> **···**
>
> On 09/09/2015 06:10 PM, Sebastian Nielsen wrote:
> 
> > Sometimes, a space, tab, linefeed or any other whitespace appears  
> > directly before or after the “-----BEGIN ....-----“ and “----END  
> > ....-----“ header lines when copying and pasting PGP messages from a  
> > PGP application into a webmail. An example is copying a encrypted  
> > message by double clicking a HTML table cell and pasting this in a  
> > conventional mail client, or copying and pasting from a PGP  
> > application into a webmail client. Then a space will be appended in  
> > the beginning and end, which is basically invisible for the naked  
> > eye.
> > 
> > This causes messages to not get decrypted or verified properly in  
> > ciphermail.
> > 
> > Any idea of fix? Both a temporarly fix I could implement right now,  
> > and a more permanent fix.
> 
> --  
> CipherMail email encryption
> 
> Open source email encryption gateway with support for S/MIME, OpenPGP  
> and PDF messaging.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
