Message.getAutocryptHeader

Creates a new #GMimeAutocryptHeader based on the relevant Autocrypt header associated with the sender of an e-mail message.

If the message has no sender in the From: field, or has more than one sender, then this function will return null. Autocrypt should ignore the message entirely.

If there is one sender, but no single Autocrypt header is found that matches that e-mail address, a #GMimeAutocryptHeader will be returned for the sender, but it will be incomplete (see #g_mime_autocrypt_header_is_complete).

Note that the following types of Autocrypt headers will not be returned by this function:

  • headers that do not match an address in "From:"
  • unparseable headers
  • headers with unknown critical attributes
  • duplicate valid headers for the sender's address

The returned Autocrypt header will have its effective_date set to the earliest of either:

  • the Date: header of the message or
  • now (or the current time, if now is null)
class Message
getAutocryptHeader

Parameters

now glib.date_time.DateTime

a #GDateTime object, or null

Return Value

Type: gmime.autocrypt_header.AutocryptHeader

a new #GMimeAutocryptHeader object, or null if the message should be ignored for purposes of Autocrypt.