Some engines can make use of the sender’s address, for example to figure out the best user id in certain trust models. For verification and signing of mails, it is thus suggested to let the engine know the sender ("From:") address. GPGME provides two functions to accomplish that. Note that the esoteric use of multiple "From:" addresses is not supported.
gpgme_set_sender specifies the sender address for
use in sign and verify operations. address is expected to be
the “addr-spec” part of an address but my also be a complete mailbox
address, in which case this function extracts the “addr-spec” from
NULL for address clears the sender address.
The function returns 0 on success or an error code on failure. The most likely failure is that no valid “addr-spec” was found in address.
gpgme_get_sender returns the current sender
address from the context, or NULL if none was set. The returned
value is valid as long as the ctx is valid and
gpgme_set_sender has not been called again.