# [Solved] ssmtp root= doesnt work

## trumee

Hello,

I have setup the root= alias in /etc/ssmtp/ssmtp.conf but it is getting ignored by ssmtp. 

My config file has root=myroot@gmail.conf defined:

```

#

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

#

# The person who gets all mail for userids < MinUserId

# Make this empty to disable rewriting.

Debug=YES

root=myroot@gmail.com

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

MinUserId=1000

mailhub=smtp.gmail.com:587

# Where will the mail seem to come from?

#rewriteDomain=

# hostname=_HOSTNAME_

#FromLineOverride=YES

UseSTARTTLS=YES

UseTLS=YES

#TLSCert=/etc/ssl/certs/ssmtp.pem

AuthUser=someuser@gmail.com

AuthPass=somepass

```

I send an email to root as

```

echo "Test" | mail -s "time 2:15" root

```

But in the debug log the user myroot@gmail.com doesnt appear in the RCPT, instead i get root@tvbox.at.myplace??

```

Nov 27 02:20:32 tvbox sSMTP[17090]: Set Root="myroot@gmail.com"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set MinUserId="1000"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set MailHub="smtp.gmail.com"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set RemotePort="587"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set UseSTARTTLS="True"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set UseTLS="True"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set AuthUser="someuser@gmail.com"

Nov 27 02:20:32 tvbox sSMTP[17090]: Set AuthPass="somepass"

Nov 27 02:20:32 tvbox sSMTP[17090]: Creating SSL connection to host

Nov 27 02:20:32 tvbox sSMTP[17090]: 220 smtp.gmail.com ESMTP q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:32 tvbox sSMTP[17090]: EHLO tvbox

Nov 27 02:20:33 tvbox sSMTP[17090]: 250 SMTPUTF8

Nov 27 02:20:33 tvbox sSMTP[17090]: STARTTLS

Nov 27 02:20:33 tvbox sSMTP[17090]: 220 2.0.0 Ready to start TLS

Nov 27 02:20:33 tvbox sSMTP[17090]: SSL connection using RSA_AES_128_CBC_SHA1

Nov 27 02:20:33 tvbox sSMTP[17090]: EHLO tvbox

Nov 27 02:20:34 tvbox sSMTP[17090]: 250 SMTPUTF8

Nov 27 02:20:34 tvbox sSMTP[17090]: AUTH LOGIN

Nov 27 02:20:34 tvbox sSMTP[17090]: 334 VXNlcmhfghfghdU6

Nov 27 02:20:34 tvbox sSMTP[17090]: bGtvcmNzMS5jbhgfgdsdsrftYWlsLmNvbQ==

Nov 27 02:20:34 tvbox sSMTP[17090]: 334 UGFzcfghghmQ6

Nov 27 02:20:34 tvbox sSMTP[17090]: ZGREQ1lCY3QwQXNRdHVY

Nov 27 02:20:35 tvbox sSMTP[17090]: 235 2.7.0 Accepted

Nov 27 02:20:35 tvbox sSMTP[17090]: MAIL FROM:<root@tvbox>

Nov 27 02:20:35 tvbox sSMTP[17090]: 250 2.1.0 OK q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:35 tvbox sSMTP[17090]: RCPT TO:<root@tvbox.at.myplace>

Nov 27 02:20:35 tvbox sSMTP[17090]: 250 2.1.5 OK q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:35 tvbox sSMTP[17090]: DATA

Nov 27 02:20:36 tvbox sSMTP[17090]: 354  Go ahead q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:36 tvbox sSMTP[17090]: Received: by tvbox (sSMTP sendmail emulation); Fri, 27 Nov 2015 02:20:32 +0530

Nov 27 02:20:36 tvbox sSMTP[17090]: From: "root" <root@tvbox>

Nov 27 02:20:36 tvbox sSMTP[17090]: Date: Fri, 27 Nov 2015 02:20:32 +0530

Nov 27 02:20:36 tvbox sSMTP[17090]: Subject: time 2:15

Nov 27 02:20:36 tvbox sSMTP[17090]: To: <root@tvbox.at.myplace>

Nov 27 02:20:36 tvbox sSMTP[17090]: X-Mailer: mail (GNU Mailutils 2.99.98)

Nov 27 02:20:36 tvbox sSMTP[17090]: 

Nov 27 02:20:36 tvbox sSMTP[17090]: Test

Nov 27 02:20:37 tvbox sSMTP[17090]: .

Nov 27 02:20:37 tvbox sSMTP[17090]: 250 2.0.0 OK 1448571037 q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:37 tvbox sSMTP[17090]: QUIT

Nov 27 02:20:38 tvbox sSMTP[17090]: 221 2.0.0 closing connection q129sm29322849pfq.19 - gsmtp

Nov 27 02:20:38 tvbox sSMTP[17090]: Sent mail for root@tvbox (221 2.0.0 closing connection q129sm29322849pfq.19 - gsmtp) uid=0 username=root outbytes=395

```

Last edited by trumee on Sat Nov 28, 2015 6:13 pm; edited 1 time in total

----------

## DawgG

root in ssmtp.conf is the alias for local root; so the email-acct that should receive root's email.

you also have to setup revaliases which handles the external accounts.

in my case the line in /etc/ssmtp/ssmtp.conf looks like this:

```
root=my.personal.account@XXX.com
```

and /etc/ssmtp/reavaliases like this:

```
root:ABC@googlemail.com:smtp.gmail.com:587
```

GOOD LUCK!

----------

## trumee

 *DawgG wrote:*   

> root in ssmtp.conf is the alias for local root; so the email-acct that should receive root's email.
> 
> you also have to setup revaliases which handles the external accounts.
> 
> in my case the line in /etc/ssmtp/ssmtp.conf looks like this:
> ...

 

The revaliases only changes the "From" header. So in your case the email would come from ABC@googlemail.com. What i want is to change the "RCPT TO" header.

----------

## trumee

Replacing mailutils with mail-client/mailx solves this issues as described here

----------

