curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl and PGP/GPG

From: Alain Reymond <al1.reymond_at_gmail.com>
Date: Fri, 25 May 2018 18:30:21 +0200

Hello Patrick,

Thank you for your answer.
We use HTML because we found it easy to use sendgrid to send emails. But
we can easily change to SMTP.
My concern was how can I create an email using curl (like we do now),
attach files, encrypt and send it.
We would like to use gpg. A message encrypted with gpg is easy to
decrypt with Thunderbid/Enigmail as it is automatically recognized as an
gpg-encrypted email.
Thank you for the links. I'll have a look at it.

Regards,

Alain

Le 25/05/2018 à 17:32, Patrick Monnerat a écrit :
>
> On 05/25/2018 02:53 PM, Alain Reymond wrote:
>> Hello,
> Hi Alain,
>> is there a way to use cURL to send emails encrypted with GPG ?
> Yes, providing you handle the encryption yourself and feed curl with
> the already encrypted data. There's no data encryption support built
> in libcurl and you have to use some external logic/libraries to format
> and encrypt your data.
>> I would like to send emails to people having a pgp key. The email is
>> composed of a text + html body and attached files (pdf or doc).
>> A C program receives the different elements (from, to, subject, body
>> text, body html, and list of attachments) and uses curl_formadd to
>> prepare the mail which is later sent via an html service.
> So you don't want to send an SMTP mail ! What you describe is actually
> an HTML form submission.
> The actual data formatting is thus dependent of what your HTTP server
> expects and how it combines the input data to create the RFC822 mail.
>
> As a hint, you can read RFC 3156, as long as the data expected by your
> HTTP server can be compatible with this standard.
>
> You can use the mime api rather than the formadd api (which is
> deprecated) to fill-in the form fields. See
> https://curl.haxx.se/libcurl/c/curl_mime_init.html.
>> My question is : how can I encrypt the email using pgp ?
> Maybe have a look at https://www.gnupg.org/related_software/gpgme/
>
> Patrick
> -------------------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette:   https://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-05-25