ssmtp to get crontab to send me mail, but cannot get the ssmpt files correct

Asked by petermat

I wish to use ssmtp to get crontab to send me mail, but cannot get the ssmpt files correct. I am running Ubuntu 10.10.

Evolution sends mail OK using the following info

eddress = <email address hidden>, server is smtp.telus.net
---------------------
and /etc/ssmtp/ssmtp.conf reads

<email address hidden>
mailhub=smtp.telus.net:25
<email address hidden>
rewriteDomain=
AuthUser=petematt
AuthPass=<my password at telus (as used ok by evolution to send mail)>
FromLineOverride=YES
---------------------

and /etc/ssmtp/revaliases reads

root:<email address hidden>:smtp.telus.net:25
localusername:<email address hidden>:smtp.telus.net:25
----------------------------

but if I test this with the command

sudo ssmtp <email address hidden>
message
Ctrl+D

(with or without the sudo) I get
ssmtp: 501 EHLO requires valid address (<email address hidden>)

and a search for EHLO turns up nothing.

Anyone spot my mistake(s) please?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cron Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

I suspect the error to be in this line of /etc/ssmtp/ssmtp.conf

<email address hidden>

<email address hidden> is no hostname but an e-mail address. Try changing it to a hostname (although I do not know to which value).

Most probably hostname=localhost or hostname=127.0.0.1 or hostname=telus.net are reasonable values to try, or the name you have given your machine (as shown by the command hostname).

Revision history for this message
petermat (petermat) said :
#2

Looks like that was part of the problem. Having tried both the response to "hostname" and using "telus.net" either way I now have the following dialogue

peter@Acer-2:~$ sudo ssmtp <email address hidden>
message
[Ctrl+D]
ssmtp: Server didn't like our AUTH LOGIN (500 5.5.1 command unrecognized)

This looks to me like an incorrect password or username, but as I already said, the ones I have entered are ones that work for Outlook and Evolution. Are they supposed to be in quotes or anything after the "="?

Or am I guessing off in the wrong direction?

Petermat

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

Googling your error message let me suppose that smtp.telus.net does not like the identification/authorization method that is used by ssmtp. ("AUTH LOGIN ... command unrecognized")

I found indications that commenting out the AuthUser and AuthPass lines by putting a '#' in front might help.

Revision history for this message
petermat (petermat) said :
#4

Manfred - thanks for your efforts. Your Googling + mine solved it.

Just doing as you suggested stopped the error message, but no email was received. Something I tried earlier without success on its own, but now worked in conjunction with your suggestion, is that there has to be to/from/subject - like this

peter@Acer-2:~$ sudo ssmtp <email address hidden>
TO:<email address hidden>
FROM:<email address hidden>
SUBJECT:test4
message text
Ctrl+D

Just TO, or TO and FROM do not work - all three does work.

Peter

Revision history for this message
petermat (petermat) said :
#5

Thanks Manfred Hampl, that solved my question.