File: fillxheaders.cc

package info (click to toggle)
gpg-remailer 3.04.07-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 728 kB
  • sloc: cpp: 1,522; sh: 179; makefile: 115; ansic: 23; fortran: 20
file content (23 lines) | stat: -rw-r--r-- 779 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "headers.ih"

void Headers::fillXheaders()
{
    auto iter = begin();

                            // always use the official envelope
    d_xHeaders = R"( -a "X-GPG-remailer-from: )" + 
                        String::escape(iter->substr(iter->find(' '))) + '"';
    
    for (++iter; iter != end(); ++iter)     // visit all remaining headers
    {
        string const &hdr = *iter;

        if (hdr.find("envelope") != string::npos)
            d_xHeaders += R"( -a "X-GPG-remailer-envelope: )" + 
                        String::escape(hdr.substr(hdr.find(' '))) + '"';

        else if (hdr.find("From: ") != string::npos)
            d_xHeaders += R"( -a "X-GPG-remailer-From: )" + 
                        String::escape(hdr.substr(hdr.find(' '))) + '"';
    }
}