198 |
if (!(p = strchr (s, '<')) || !(q = strchr (s, '>'))) |
if (!(p = strchr (s, '<')) || !(q = strchr (s, '>'))) |
199 |
continue; |
continue; |
200 |
buf = (char * )calloc (1, (q-s)-(p-s)+2); |
buf = (char * )calloc (1, (q-s)-(p-s)+2); |
201 |
|
if (!buf) |
202 |
|
BUG (0); |
203 |
strncpy (buf, s+(p-s)+1, (q-s)-(p-s)-1); |
strncpy (buf, s+(p-s)+1, (q-s)-(p-s)-1); |
204 |
gpgme_recipients_add_name (r, buf); |
gpgme_recipients_add_name (r, buf); |
205 |
safe_free (buf); |
safe_free (buf); |
308 |
} |
} |
309 |
|
|
310 |
msg = (MapiMessage *)calloc (1, sizeof * msg); |
msg = (MapiMessage *)calloc (1, sizeof * msg); |
311 |
|
if (!msg) |
312 |
|
BUG (0); |
313 |
p = msg->lpszSubject = strdup (subject); |
p = msg->lpszSubject = strdup (subject); |
314 |
if (!p) |
if (!p) |
315 |
BUG (0); |
BUG (0); |
318 |
BUG (0); |
BUG (0); |
319 |
n = msg->nRecipCount = gpgme_recipients_count (rset); |
n = msg->nRecipCount = gpgme_recipients_count (rset); |
320 |
recip = (MapiRecipDesc *)calloc (n+1, sizeof * recip); |
recip = (MapiRecipDesc *)calloc (n+1, sizeof * recip); |
321 |
|
if (!recip) |
322 |
|
BUG (0); |
323 |
|
|
324 |
gpgme_recipients_enum_open (rset, &ctx); |
gpgme_recipients_enum_open (rset, &ctx); |
325 |
while ((s = gpgme_recipients_enum_read (rset, &ctx))) { |
while ((s = gpgme_recipients_enum_read (rset, &ctx))) { |
337 |
if (nfiles) { |
if (nfiles) { |
338 |
msg->nFileCount = nfiles; |
msg->nFileCount = nfiles; |
339 |
attch = (MapiFileDesc *)calloc (nfiles+1, sizeof * attch); |
attch = (MapiFileDesc *)calloc (nfiles+1, sizeof * attch); |
340 |
|
if (!attch) |
341 |
|
BUG (0); |
342 |
for (i=0; i < nfiles; i++) { |
for (i=0; i < nfiles; i++) { |
343 |
char * p = secure_attachment (rset, *files); |
char * p = secure_attachment (rset, *files); |
344 |
if (!p) |
if (!p) |
438 |
return FALSE; |
return FALSE; |
439 |
} |
} |
440 |
msgbuf = (char * )calloc (1, n+2); |
msgbuf = (char * )calloc (1, n+2); |
441 |
|
if (!msgbuf) |
442 |
|
BUG (0); |
443 |
GetDlgItemText (dlg, IDC_PMAIL_MSG, msgbuf, n+1); |
GetDlgItemText (dlg, IDC_PMAIL_MSG, msgbuf, n+1); |
444 |
mapi_send_message (rset, msgbuf, subject, NULL, 0); |
mapi_send_message (rset, msgbuf, subject, NULL, 0); |
445 |
safe_free (msgbuf); |
safe_free (msgbuf); |