234 |
} |
} |
235 |
|
|
236 |
|
|
|
#if 0 |
|
|
/* Send a public key stored in @keyfile with the keyid @keyid |
|
|
via the MAPI mechanism to a mail recipient. |
|
|
Return value: SUCCESS_SUCCESS on succes. */ |
|
|
int |
|
|
mapi_send_pubkey2 (const char *keyid, char *keyfile) |
|
|
{ |
|
|
LHANDLE hd; |
|
|
const char * fmt; |
|
|
char * keyinf = NULL; |
|
|
int rc; |
|
|
|
|
|
if (!init) |
|
|
return 0; |
|
|
|
|
|
fmt = _("GPG Public Key of %s"); |
|
|
keyinf = new char[strlen (fmt) + strlen (keyid) + 2]; |
|
|
if (!keyinf) |
|
|
BUG (0); |
|
|
sprintf (keyinf, fmt, keyid); |
|
|
rc = mapi_logon (0, NULL, NULL, MAPI_LOGON_UI, 0, &hd); |
|
|
if (rc != SUCCESS_SUCCESS) { |
|
|
MessageBox (NULL, _("MAPI Login failed."), "MAPI", MB_ICONWARNING|MB_OK); |
|
|
goto fail; |
|
|
} |
|
|
rc = mapi_send_documents (0, ";", keyfile, keyinf, 0); |
|
|
if (rc == MAPI_E_USER_ABORT) |
|
|
rc = SUCCESS_SUCCESS; |
|
|
if (rc != SUCCESS_SUCCESS) |
|
|
MessageBox (NULL, _("Could not sent mail."), "MAPI", MB_ICONERROR|MB_OK); |
|
|
|
|
|
fail: |
|
|
mapi_logoff (hd, 0, 0, 0); |
|
|
free_if_alloc (keyinf); |
|
|
return rc; |
|
|
} |
|
|
#endif |
|
|
|
|
237 |
|
|
238 |
int |
int |
239 |
mapi_send_pubkey (const char *keyid, char *keyfile) |
mapi_send_pubkey (const char *keyid, char *keyfile) |