Commit 0be1b7f9 authored by Robert Labudda's avatar Robert Labudda
Browse files

findpgpkey: there can be multiple headers in an email

parent 864f555a
...@@ -301,15 +301,24 @@ if __name__ == '__main__': ...@@ -301,15 +301,24 @@ if __name__ == '__main__':
continue continue
eprint(f'Found {header} header') eprint(f'Found {header} header')
value = eml[header].strip() value = eml[header].strip()
if value.lower().startswith('0x'): if ';' in value:
eprint(f'... found ID {value}') values = [v.strip() for v in value.split(';')]
keyids.append(value[2:]) else:
if '://' in value: values = [value]
urls.append(value) values = [v.split('=', 1)[1] if '=' in v else v for v in values[:]]
eprint(f'... found URL {value}')
if ''.join([ch for ch in value if ch in string.hexdigits]) == value: for value in values:
eprint(f'... found ID {value}') if value.lower().startswith('0x'):
keyids.append(value) eprint(f'... found ID {value}')
keyids.append(value[2:])
if '://' in value:
if value.startswith('<') and value.endswith('>'):
value = value[1:-1]
urls.append(value)
eprint(f'... found URL {value}')
if ''.join([ch for ch in value if ch in string.hexdigits]) == value:
eprint(f'... found ID {value}')
keyids.append(value)
if len(keyids) > 0: if len(keyids) > 0:
eprint('Trying to find ID on keybase and keyservers') eprint('Trying to find ID on keybase and keyservers')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment