I was about to report an Emacs bug, and instead of trying to copy stuff from my mail buffer to Gmail, I decided to get mail sending from Emacs to work. I started looking at the manual that comes with Emacs and noticed that I will need the gnutls program to get authentication to work. While trying to build it, I learnt that it required libcrypt. While trying to build that, I learnt that it required libgpg-error.
Right now I find that I’m getting a compilation error in the gnutls-2.6.4 code. I finished building and installing libgcrypt-1.4.4 and libgpg-error-1.7.
Compilation fails here:
cipher-libgcrypt.c: In function `wrap_gcry_cipher_init': cipher-libgcrypt.c:84: error: `GCRY_CIPHER_CAMELLIA128' undeclared (first use in this function) cipher-libgcrypt.c:84: error: (Each undeclared identifier is reported only once cipher-libgcrypt.c:84: error: for each function it appears in.) cipher-libgcrypt.c:90: error: `GCRY_CIPHER_CAMELLIA256' undeclared (first use in this function)
When I try configure --disable-camellia, I’m getting a different error:
mac-libgcrypt.c: In function `wrap_gcry_hash_init': mac-libgcrypt.c:123: error: `GCRY_MD_SHA224' undeclared (first use in this function) mac-libgcrypt.c:123: error: (Each undeclared identifier is reported only once mac-libgcrypt.c:123: error: for each function it appears in.)
The reason was simple: I needed the latest libgcrypt, but I also had an old library installed in
/opt/local which I had to uninstall, first.
Anyway, after a lot of compiling, I finally have a
gnutls-cli and I’m ready to test SendingMail using SmtpAuth from Emacs.
I tried the following config:
(setq send-mail-function 'smtpmail-send-it smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 587 smtpmail-starttls-credentials `((,smtpmail-smtp-server , smtpmail-smtp-service nil nil)) smtpmail-auth-credentials "~/.netrc")
It wouldn’t work at first, but restarting Emacs did help, so I guess some of these variables need to be set before libraries are loaded.