short version: I'm trying to send mail with Mutt. It fails and says "Alarm clock". What does that mean, how do I fix it?
long version: I have an ubuntu server running tiny tiny rss. It sends daily email digests using php's mail() function. I want that to work. I have a domain with google apps, so I want mail to be sent from [email protected]. I tried postfix and sendmail, but I failed to configure them properly (and I think since they're MTAs they're overkill anyway). I hear (read: hope) that mutt can be used to replace sendmail for php's purposes. So to the end of sending mail from mutt, I made a .muttrc for my own gmail account, and sending worked fine. So I suspect mutt is installed correctly. However, when I change my configuration to work for my domain name, it doesn't work. here's my new .muttrc:
set from = "[email protected]"
set realname = "vassago"
set imap_user = "[email protected]"
set imap_pass = <password>
set smtp_url="smtp://[email protected]:587/"
set smtp_pass=<password>
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed ="+[Gmail]/Drafts"
set header_cache = ~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates
set move = no
set imap_keepalive = 900
if I just run mutt, I can see the emails show up. I've tried deleting the lines with smtp_url and smtp_pass, but that didn't work either. With this configuration, I run
echo "hi again" | mutt -s "test03 from mutt" <my email address>
some time passes, "Alarm clock" prints, and the program returns, mail ostensibly not sent. What am I doing wrong?
The culprit was smtp_url. I changed the line:
now it works. I still have no idea what "Alarm clock" means.
Actually, "Alarm clock" is a mutt error message relating to timeout.
Lately, I have been plagued with that cutesey "Alarm clock" error indication while trying to debug my mutt ".muttrc" file. The main problem turned out to be a combination of the "set smtp_url" parameter and msmtp's connect_timeout parameter. Local internet service is spotty at best, and thus the timeout problems.
MAIN PROBLEM: When I sent a multi-line text file to mutt via the command line: cat report.out | mutt -s "Summary" "[email protected]" mutt repeatedly blew up with the cryptic message Alarm clock I wasted considerable time chasing the problem within mutt. There WAS one problem, but the main culprit was in .msmtprc instead. Fix it first.
MSMTP BACKGROUND: But first, some background. I'm running msmtp, and thought that it was working fine: for example, the cmd line cat report.out | msmtp -a default [email protected] did as expected, sending the last line of the file without a subject.
Here is a copy of .msmtprc. I have included the trick to enable secure smtps:
----------------------------------------------------------------
----------------------------------------------------------------
Typing in msmtp --serverinfo gives all sorts of information, such as (showing top two lines only): SMTP server at smtp.gmail.com (qo-in-f109.1e100.net [173.194.66.109]), port 465: smtp.gmail.com ESMTP w44sm25263807qta.4 - gsmtp which demonstrates that smtps is configured correctly (so far). If it were not configured correctly, you would get the following: msmtp: the server sent an empty reply msmtp: could not send mail (account default from /home/owner/.msmtprc)
After tinkering with msmtp.rc I resumed testing, jumping back and forth between msmtp and mutt. The program occasionally worked, but not reproduceably. In retrospect, this should have suggested a timeout problem. (I'll omit lots of grief here.) Let's cut to the chase and add the following line to .msmtprc (which fixed the problem): set connect_timeout = 300 Be sure to test any changes with msmtp --serverinfo before plowing ahead. The msmtp server MUST work before you can straighten out mutt.
MUTT PROBLEM/SOLUTION: Next, I made a correction to .muttrc by including the host name in the smtp_url argument. I commented out: # set hostname=gmail.com and inserted the hostname into the url: set smtp_url = "smtps://[email protected]@smtp.gmail.com:465
RESULTS: Once I added the .msmtprc timeout line and fixed the .muttrc host_name problem mentioned above, it all ran fine, consistently albeit slowly. The slowness is due to a lousy internet connection. There are two large hospitals which do major data dumps twice a day, tying up the trunk. Plus, due to lousy infrastructure out here in the suburbs, seems like every time a cloud goes over the connection goes down. Please write your senators and congressman in favor of internet neutrality.