Configuring Gmail in gnus in Aquamacs - emacs

I'm a new emacs user, and I'm trying to get gnus working with mi gmail account with Aquamacs.
So far, I've been able to set it up to receive my mail. The problem is when I try to send an e-mail. I get this error:
No Gnus is good news
No more unread newsgroups
Mark set
Sending...
Sending via mail...
No STARTTLS program was available (tried 'gnutls-cli')
ad-Orig-error: Sending failed; SMTP protocol error
I understand that 'gnutls-cli' is necessary, and that it is not included in Aquamacs. I've found this guide to install it http://www.gnu.org/s/gnutls/manual/gnutls.html, but I'm not sure how I have to proceed, since I'm using MacOs and not Linux (although both are UNIX OS)
My question is: what do I exactly have to do to be able to send emails?

You could install opensll and configure Gnus to use it instead of
gnus-tls.
From the Gnus Manual:
`nntp-open-ssl-stream'
Opens a connection to a server over a "secure" channel. To use
this you must have OpenSSL (http://www.openssl.org) or SSLeay
(ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL) installed. You then
define a server as follows:
;; "snews" is port 563 and is predefined in our `/etc/services'
;; however, `openssl s_client -port' doesn't like named ports.
;;
(nntp "snews.bar.com"
(nntp-open-connection-function nntp-open-ssl-stream)
(nntp-port-number 563)
(nntp-address "snews.bar.com"))

Related

Sending simple email via MacOs 12 Terminal with mail (mail_version = 3.2.2)

I would like my MacOS "server" (basic mac mini with OS12.1 installed)
to be able to send emails using my current (paid) email provider.
Some theory first.
I am aware about this fine article (http://hints.macworld.com/article.php?story=20081217161612647)
What puzzles me is how on earth will "fresh out of box" mac be able to send even ONE email without being (mail-server) configured first. In other words to what email server will it send my email?
Discovered the very useful command mailq that will show the current status of all current emails being processed.
I understood that the command mail will send an email:
echo "this is the body" | mail -s "this is the subject" "myself#myserver.lu"
I understand, mail is using postfix in the background.
This will show the version of postfix (mine is mail_version = 3.2.2)
postconf mail_version
Is it possible to update postfix on macos?
Did anyone managed to enable the log on mail_version 3.2.2?
I get this warning:
postconf: warning: /etc/postfix/main.cf: unused parameter: maillog_file=/var/log/postfix.log
without the log it is a bit difficult to see what went wrong during email send...
thanks in advance for some MAC related input.

I cannot send mail with SwiftMailer or PHPMailer from Localhost using gmail

I have recently been unable to send out mails through php on localhost. I use PHPMailer and SwiftMailer in different parts of the application.
With SwiftMailer I get this:
Connection could not be established with host smtp.gmail.com [ #0]
With PHPMailer, the message is:
SMTP Error: Could not connect to SMTP host.
My settings on SwiftMailer look like this:
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername(APP_GMAIL_EMAIL)
->setPassword(APP_GMAIL_PWD);
I have gone through several threads here at SO and elsewhere, and tried many 'fixes' but the error messages remain the same. Some "solutions" I've tried are:
Enable OpenSSL inphp.ini (It was previously off)
Change smtp.gmail.com to smtp.googlemail.com
Replace smtp.gmail.com with certain gmail IP addresses
Replace smtp.gmail.com with gethostbyname('smtp.gmail.com')
Add ->setSourceIp('0.0.0.0') to the instantiation code above, after setUsername and setPassword
This code was previously working, and I'm not sure what could have broken the function. As part of troubleshooting, I have just confirmed that a similar code on Linux shared hosting is emailing satisfactorily, suggesting that the problem is somehow from my environment. Thus, I even tried different sources of internet access, in case it's an ISP thing.
How can I crack this nut?
I have been able to overcome the problem, at least with SwiftMailer. The solution must have arisen after my PHP upgrade from 5.2.5 to 5.6, which is the version I have currently. The insight came from this page:
https://github.com/swiftmailer/swiftmailer/issues/544
If you are using PHP 5.6, the error does occur because of the "SSL
context options" used for the stream context in swiftmailer. IN PHP
5.6 verify_peer and verify_peer_name the default was set to TRUE, so PHP checks the SSL certificate. It is currently not possible to
disable it in swiftmailer using some options.
You could disable the SSL check by modifying the function
"_establishSocketConnection" in StreamBuffer.php. Add these lines
before stream_socket_client command:
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;
It would be great if these options could be set without hacking the
code.
Thanks to https://stackoverflow.com/a/29448735/2554788 who first pointed me to the said post.
By the way, the path to StreamBuffer.php is:
\lib\classes\Swift\Transport
A word of warning though: this solution is based on hacking the code inside a class, and will probably fail, say, after upgrading SwiftMailer versions (in which case you'd need to go back and hack the code again).
Perhaps, more current versions of SwiftMailer have put their acts together in PHP 5.6 (I use SwiftMailer 5.1 currently). I intend to try an upgrade ASAP, hoping there has been an elegant fix for this issue.

Emacs mail mode copy sent messages

In Mail-mode (C-x m) how can I get a copy of sent messages saved in my IMAP Sent folder? I am using msmtp to send mail. I have the Arch Linux msmtp-mta package installed so that it can use the sendmail command as an alias to msmtp. In my init.el I have (setq mail-user-agent 'sendmail-user-agent). I'm not sure if I need to configure Emacs or something on my mail server in order to get a copy of sent messages saved.

failing while sending bug email in emacs

C-cC-c,get this info:
Sending...terminated by signal: Broken pipe
I find paste a long file in text mode is wrong(GUI version is OK),
and want to send a bug email.
what should i config? sending mail in emacs is cool!
thanks!
Emacs uses the /usr/sbin/sendmail command (specified by the sendmail-program variable) to deliver email you compose. You might be getting the error because your sendmail command is not working properly.
To resolve the issue you could try using the sendmail command directly (try man sendmail) to verify it really works. If it doesn't work properly, you should fix it and sending email from Emacs should start working.

Using MailDir as a Backend for Gnus

I am using offlineimap to sync my gmail account to a locak maildir, then using gnus to read that directory everything is fine but gnus uses its own flags for marking read unread status of messages and they are not synced back to gmail. is there a way to force gnus to use standart maildir flags?
I use offlineimap and dovecot to download and serve my mail locally. I also use GNUS. Getting dovecot to work kept me from using GNUS for quite a while since GNUS's support for maildir is so lousy. This is what I needed to make dovecot work:
mail_location = maildir:~/Mail:LAYOUT=fs:INBOX=~/Mail/INBOX
One of the really nice parts of my solution is that I have a real and working offline sync, so that when the network is unavailable (approximate 80% of the time while on campus) I still can check and sort my mail.
This has been fixed in nnmaildir in Gnus trunk as of 2012-09-05. The fix appeared in the Gnus version released with Emacs 24.3.
A solution is to use a local imap server (as dovecot) to look at your maildir, and to use gnus to access to this imap server.
AFAIK, the situation has not improved about nnmaildir and gnus since this.
For this exact situation, I'm now using mutt, setting Emacs as its editor.
Here is everything the official manual has to say about maildirs and GNUS - I personally couldn't find there what you're looking for, but then again I'm a mew user, maybe you'll notice something I didn't. I hear, though, that Wanderlust has the best maildir support of all the Emacs mail readers.