Page 1 of 1

HELP: Setting Up email on a ubuntu Server style

Posted: July 30th, 2015, 6:03 pm
by benjamin142
Hi - I have an HP Micro Server running Ubuntu 14.4. I have the OS installed on a 250GB SSD and 4 4TB Drives in software RAID10.

I am trying to set it up so, should there be a problem with one of the internal drives or once i set up back ups, should they fail - for the machine to email me and let me know.

So far the best advice I can find is here: http://www.havetheknowhow.com/Configure ... ssmtp.html

But once I try my 'Test' email to see if its working all i get is: ssmtp: Connection lost in middle of processing

Please can someone let me know what im doing wrong and if this is the correct way to go to about setting up what i need

I am very new to Ubunut.

Thanks

Re: HELP: Setting Up email on a ubuntu Server style

Posted: July 30th, 2015, 7:17 pm
by Ian
Hi,

This is likely a typo in your ssmtp.conf file somewhere. Alternatively it could be you're using the wrong port. Feel free to post your config files for us to take a look (replacing personal info with random chars of course)

Re: HELP: Setting Up email on a ubuntu Server style

Posted: August 11th, 2015, 4:51 pm
by benjamin142
Hi,
So I have tried all 3 ports I think are available with Gmail. 465, 587 and 25. But no luck. I am anxious I may have done something fundamentally wrong, being so green with Ubuntu and only having online instructions to follow.

Should the Root Email and AuthUser be the same email address?

Is this the info you were asking for? Any advice you can help me with would be fantastic. Thank you in advance.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#root=postmaster
root=intranet@ghtyuyu.com - (This is a company address running through gmail but is not @gmail.com does that make a difference?)


# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com:465

AuthUser=intranet@yuu8iyjh.com - (This is a company address running through gmail but is not @gmail.com does that make a difference?)
AuthPass=ffhfhghgh
UseTLS=YES
UseSTARTTLS=YES

# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=ghggkjkj.com


# The full hostname
#hostname=MyMediaServer.home
hostname=intranet@djkgfgf.com

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

Re: HELP: Setting Up email on a ubuntu Server style

Posted: August 11th, 2015, 5:39 pm
by benjamin142
Also to add, when I run the ssmtp test and press ctrl-D i imagine it is supposed to take maximum of 10sec for it to send. When I do it nothing happens for ages. In fact nothing happens. Im just running a test now and literally nothing is happening.

Any advice would be fantastic!

Re: HELP: Setting Up email on a ubuntu Server style

Posted: August 11th, 2015, 5:44 pm
by benjamin142
I just got this after 5mins: ssmtp: Timeout on stdin while reading body

Any thoughts?

Thank you

Re: HELP: Setting Up email on a ubuntu Server style

Posted: August 11th, 2015, 6:49 pm
by Ian
Your point about using a company address running through gmail but it not being a @gmail.com may well be valid. Have you as a test tried using a regular gmail account to see if it works? At least then you'll be able to eliminate that as being an issue.

But other than that your config file looks fine.

Re: HELP: Setting Up email on a ubuntu Server style

Posted: August 14th, 2015, 1:55 pm
by benjamin142
Hi I have discovered that this works: mail -s "hello" "example@example.com" <<EOF
hello
EOF

Which makes me think that ssmtp is actually set up and working? Am I correct?

My next question, is this the appropriate method of email set up to send drive and backup's status updates from the server?

Thanks