# ssmtp / mail problem

## hitchhiker04

I'm having trouble sending mail to root

```
# /etc/logcheck/logcheck.sh

send-mail: Cannot open mail:25

Can't send mail: sendmail process failed with error code 1
```

I check using telnet and nmap, it appears that the smtp port is not open

```
# telnet localhost 25

Trying 127.0.0.1...

telnet: Unable to connect to remote host: Connection refused
```

So anyone know how to fix this?

----------

## kashani

Your default Gentoo install includes a packages called ssmtp. What this does is install a /usr/sbin/sendmail binary which accepts email from scripts, binaries, etc. If you've configured it correctly it'll then send the mail to your ISP's mail server for relaying. ssmtp cannot deliver mail locally. I'd guess that your program is trying to connect to port 25 which is empty since ssmtp is not a daemon or that ssmtp is not configured so when your program attempts to use /usr/sbin/sendmail it throws errors.

kashani

----------

## hitchhiker04

Im trying to configure /etc/ssmtp/ssmtp.conf

the default had " mailhub = mail", i think this is one of the problems but what do i change it to?

----------

## kashani

mailhub is going to be the name of the server that is actually going to relay the mail. If you run your own mail server put that in your config. Or  say if you're using an earthlink connection than it maybe smtp.earthlink.com or something similar. You'll need to consult your ISP to find the name of their smtp server.

kashani

----------

