I have ssmtp installed in order to use the company server to send emails from the machine.

The problem is that the server is outlook and the emails have the "reply to" set to the user name: "root". This greatly upsets the outlook server, because it considers it to be junk.

How can I change the email address for the users? I don't want to use the forward solution proposed on other threads (~/.forward).

I would like to set ssmtp to send the reply address to user@hostname or something with "@domain"

Thank you

  • i don't really understand what you want. I guess you have a linux server with smtp and want to change the sending addrese from root@localhost to cristi@yourdomain.com? Feb 6, 2013 at 9:24
  • I have the from email address set to cristi and I wanted to be from cristi@domain.com. I fixed this by disabling FromLineOverride=YES directive in ssmtp.conf.
    – cristi
    Feb 6, 2013 at 10:55
  • actually, I was wrong. The correct solution is this: serverfault.com/a/437319/147524
    – cristi
    Feb 14, 2013 at 10:03

2 Answers 2


Quick googling pointed me to man page of ssmtp and it seems that You can use -f option in ssmtp.


Sets the name of the ''from'' person. This option is valid only if no From: line is specified within the header of the email.

  • I had enable in the conf file FromLineOverride=YES. After commenting this, the RewriteDomain=domain.com was appended to the user name. Actually this was the case before (from my understanding), but the FromLineOverride was letting the initial user@domain, which user just user
    – cristi
    Feb 6, 2013 at 11:02

You can use revaliases

The revaliases file defines what will appear in the "from" field of the email.

It's a good idea to set up an alias to force the "From:" line to a sensible value so edit the revaliases file:

sSMTP aliases

Format: local_account:outgoing_address:mailhub

Example: root:your_login@your.domain:mailhub.your.domain[:port] where [:port] is an optional port number that defaults to 25. You can add lines for each username that you intend to use. Note that since cron runs as root all reports from cron are addressed from user "root". Set the root's email address to a valid address as if a message bounces this is where it will end up.

You need to specify the mailhub again here.

  • I have the necessary entries in revaliases, but the emails where received with "root" as the from email. Like I said, it was because of FromLineOverride=YES. Removing this, made ssmtp to add to the user name the RewriteDomain, whixh was ok with me. I still have the "reply to" address set to only "root", but I don't care about this as long as outlook doesn't care.
    – cristi
    Feb 6, 2013 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.