# Mail messages [SOLVED]

## DancesWithWords

How so I fix the mail messages so that they end up in my gmail.com account?

Nov 29 19:00:05 faintfuzzies sSMTP[28666]: Cannot open mail:25

Nov 29 19:00:05 faintfuzzies cron[28661]: (bsh) MAIL (mailed 58 bytes of output but got status 0x0001

)

Nov 29 19:00:09 faintfuzzies crontab[28712]: (root) BEGIN EDIT (root)

Nov 29 19:01:05 faintfuzzies sSMTP[28696]: Unable to connect to "mail" port 25.

Nov 29 19:01:05 faintfuzzies sSMTP[28696]: Cannot open mail:25

Nov 29 19:01:05 faintfuzzies cron[28691]: (bsh) MAIL (mailed 58 bytes of output but got status 0x000Last edited by DancesWithWords on Fri Dec 06, 2013 4:26 am; edited 1 time in total

----------

## TomWij

 *Quote:*   

> Nov 29 19:01:05 faintfuzzies sSMTP[28696]: Unable to connect to "mail" port 25.

 

Can you check if that host name is correct, you can connect to it by other means and that the server on it is running?

----------

## DancesWithWords

 *TomWij wrote:*   

>  *Quote:*   Nov 29 19:01:05 faintfuzzies sSMTP[28696]: Unable to connect to "mail" port 25. 
> 
> Can you check if that host name is correct, you can connect to it by other means and that the server on it is running?

 

faintfuzzies ~ # nmap 192.168.1.147 -sT -p 25

Starting Nmap 6.25 ( http://nmap.org ) at 2013-11-29 20:04 EST

Nmap scan report for localhost (192.168.1.147)

Host is up (0.00011s latency).

PORT   STATE  SERVICE

25/tcp closed smtp

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

faintfuzzies ~ # nmap 192.168.1.147 -sT -p 465

Starting Nmap 6.25 ( http://nmap.org ) at 2013-11-29 20:05 EST

Nmap scan report for localhost (192.168.1.147)

Host is up (0.00010s latency).

PORT    STATE  SERVICE

465/tcp closed smtps

Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

My ssmtp config file:

#

# /etc/ssmtp.conf -- a config file for sSMTP sendmail.

#

# The person who gets all mail for userids < MinUserId

# Make this empty to disable rewriting.

#root=postmaster

root=faintfuzzies.ca@gmail.com

# All mail delivered to userid >= MinUserId goes to user, not root.

#MinUserId=1000

# The place where the mail goes. The actual machine name is required

# no MX records are consulted. Commonly mailhosts are named mail.domain.com

# The example will fit if you are in domain.com and your mailhub is so named.

#mailhub=mail

# Example for SMTP port number 2525

# mailhub=mail.your.domain:2525

# Example for SMTP port number 25 (Standard/RFC)

# mailhub=mail.your.domain        

# Example for SSL encrypted connection

mailhub=smtp.gmail.com:465

# Where will the mail seem to come from?

rewriteDomain=faintfuzzies.ca

# The full hostname

# Gentoo bug #47562

# Commenting the following line will force ssmtp to figure

# out the hostname itself.

# hostname=_HOSTNAME_

hostname=faintfuzzies.ca.localdomain

# Set this to never rewrite the "From:" line (unless not given) and to

# use that address in the "from line" of the envelope.

FromLineOverride=YES

# Use SSL/TLS to send secure messages to server.

#UseTLS=YES

UseSTARTTLS=YES

# Email account and password 

AuthUser=faintfuzzies.ca@gmail.com

AuthPass=PASSWORD

----------

## TomWij

 *Quote:*   

> 25/tcp closed smtp

 

If your server's port is closed, there is no mail server listening on it; you'll want to investigate the server instead of your client.[/quote]

----------

## DancesWithWords

 *TomWij wrote:*   

>  *Quote:*   25/tcp closed smtp 
> 
> If your server's port is closed, there is no mail server listening on it; you'll want to investigate the server instead of your client.

 [/quote]

Well that is a start.  What is and easy to use and configure mail server?

==

DWW

----------

## TomWij

Check if your ISP has one, that's the most common way.

----------

## DancesWithWords

 *TomWij wrote:*   

> Check if your ISP has one, that's the most common way.

 

But that is what I was trying to achieve.  If you check my orginal post Iv'e got my ssmtp.conf set up, but it is not working yet?

==

DWW

----------

## TomWij

Well, 192.168.1.147 is not your ISP; you'll want to replace that by the IP of the ISP's SMTP server.

----------

## DancesWithWords

 *TomWij wrote:*   

> Well, 192.168.1.147 is not your ISP; you'll want to replace that by the IP of the ISP's SMTP server.

 

In my config file I've specified smtp.gmail.com com will that not work?

==

DWW

----------

## TomWij

Now I see it, it somehow doesn't find your config file; that's why it tries the default "mail" instead of what you have specified. :/

Try /etc/ssmtp/ssmtp.conf instead of /etc/ssmtp.conf

----------

## DancesWithWords

 *TomWij wrote:*   

> Now I see it, it somehow doesn't find your config file; that's why it tries the default "mail" instead of what you have specified. :/
> 
> Try /etc/ssmtp/ssmtp.conf instead of /etc/ssmtp.conf

 

Make changes get the following:

Dec  4 20:40:03 faintfuzzies sSMTP[28686]: Creating SSL connection to host

Dec  4 20:40:08 faintfuzzies sSMTP[28649]: Connection lost in middle of processing

Dec  4 20:40:08 faintfuzzies cron[28639]: (root) MAIL (mailed 951 bytes of output but got status 0x0001

----------

## TomWij

That means it is now reading your config, you will now make sure the settings are correct; for example, you might need to set UseTLS=YES to make a successful connection.

----------

## DancesWithWords

 *TomWij wrote:*   

> That means it is now reading your config, you will now make sure the settings are correct; for example, you might need to set UseTLS=YES to make a successful connection.

 

That last suggestion fixed my problem.  All root mail is now being forwarded to my gmail account.  Thanks for your help and patience.

==

DWW

----------

