Solved How to add hostname to periodic email

When I receive the daily security run outout, I get the following header:
To: root@missing_domain
Could someone please tell me why I get @missing_domain?
I would like yo to be the server hostname.
I looked at various conf but could not tell what to modify, To start I tough that the file beloow would hold the answer but it doesn't
#Changing user information for root.
Login: root
Password: $6$qwsFNYQAsgfKyRS8$Cdhyko6sY.X.NxHzPDZS34JpmYLP5dOrvWCfvK0yANCfid01KcCZzvsN2Pply.ZqRX7MDeo6GsVY8C12QMKf.1
Uid [#]: 0
Gid [# or name]: 0
Change [month day year]:
Expire [month day year]:
Home directory: /root
Shell: /bin/csh
Full Name: fredtheuser
Office Location:
Office Phone:
Home Phone:
Other information:
Set the hostname in /etc/rc.conf, including the domain.
Hi SirDice
hostname in /etc/rc.conf is already set :(
That been said, looking at man iocage(), I have a few options that could be link to what you are saying:

           The hostname of the jail.

           Default: UUID
           Source: jail(8)
allow_set_hostname=1 | 0

           The jail's hostname may be changed via hostname(1) or sethostname(3).

           Default: 1
           Source: jail(8)
I don't really understand what the 2 options above do (my english is at fault here not the man).

Could you please advise further?
.. I tried to set iocage set allow_set_hostname=1 default and iocage set allow_set_hostname=1 <big number> but the To field is still
Normally a jail isn't allowed to change its own hostname, by setting allow_set_hostname you can. But if the hostname is already set correctly this won't do much for you. But this does beg the question, do you set the hostname for a jail fully qualified? I.e. including the domain name?
Hi SirDice , Thank you for coming back to me.
Bellow is what I have...
iocage list
JID   UUID                                  BOOT  STATE  TAG
4     dbb40c5a-cdd8-11e5-99af-f04da20055fe  on    up
iocage get hostname dbb40c5a
iocage console dbb40c5a
hostname -f
vi /etc/rc.conf
I must be missing the obvious here or a bug with iocage maybe?
Do I need to do anything with hosts or resolve.conf
Do I need anything else?

Thank you

I am still really stuck on this issue, could someone please sugest any other things I could look at in order to troubleshoot my problem?

Thank you
No idea actually. One thing did come to mind though, by default sendmail(8) is disabled completely in an iocage(8) jail. May be it's not configured completely. What happens if you run this:
cd /etc/mail
make all
This should generate a <hostname>.mc file that's used to configure sendmail(8).
It did generate the missing <hostname>.mc file but didn't solved the problem
I also had an error when I ran make all
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 >
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 >
/usr/sbin/sendmail -bi -OAliasFile=/etc/mail/aliases
sendmail: Aliases are not used in sSMTP
chmod 0640 /etc/mail/aliases.db
chmod: /etc/mail/aliases.db: No such file or directory
*** Error code 1

make: stopped in /etc/mail
Well, configuring sendmail(8) isn't going to work if you use something else as MTA. Would you mind posting the sSMTP configuration?
Code:                     # Redirect mail for root@ to           # SMTP server hostname and port                   # The host the mail appears to be coming from                       # The name of this host
FromLineOverride=YES                            # Force the From: line
UseTLS=YES                                      # Secure connection (SSL/TLS)           # Our mail account username
AuthPass=cAdraj7D2axxxx                        # The password for the mail account
Dear fred974,
your question is related to the earlier post? I have in my www jails /usr/local/etc/ssmtp/ssmtp.conf
with the hosts lo1 as A mail from the jails root crontab is as below.
From root@www.local  Fri Feb 26 21:45:55 2016  
>From chris  Fri Feb 26 21: 45:55 2016  
Return-Path: <root@www.local>  
X-Original-To: chris@esprimo.local  
Delivered-To: chris@esprimo.local  
Received: from www.local (www [])  
  by esprimo.local (Postfix) with SMTP id 7A39745CD8A  
  for <chris@esprimo.local>; Fri, 26 Feb 2016 21:45:54 +0100 (CET)  
Received: by www.local (sSMTP sendmail emulation); Fri, 26 Feb 2016 20:45:54 +0000  
From: Charlie & <root@www.local>  
Date: Fri, 26 Feb 2016 20:45:54 +0000  
To: chris@esprimo.local  
Subject: Cron <root@www> /usr/sbin/pkg audit -F  
X-Cron-Env: <MAILTO=chris@esprimo.local>  
X-Cron-Env: <SHELL=/bin/sh>  
X-Cron-Env: <HOME=/root>  
X-Cron-Env: <PATH=/usr/bin:/bin>  
X-Cron-Env: <LOGNAME=root>  
X-Cron-Env: <USER=root>  
Message-Id: <20160226204554.7A39745CD8A@esprimo.local>  
vulnxml file up-to-date  
0 problem(s) in the installed packages found.
The hosts postfix accepts mails from of the jails. The jails name are listed in /etc/hosts of the host. I hope it helps.