Solved [Solved]Cannot start service opensmtpd

Hi everyone!

I wanted to start a email internet server and I just got advised by a FreeBSD community member that it was an easy way to use opensmtp.

So I decided to install opensmtp using $ sudo pkg install opensmtpd and follow few steps before.

My /etc/mail/mailer.conf:

Code:
# $FreeBSD: release/10.0.0/etc/mail/mailer.conf 93858 2002-04-05 04:25:14Z gsha$
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
### smtpd: sendmail     /usr/libexec/sendmail/sendmail
### smtpd: send-mail    /usr/libexec/sendmail/sendmail
### smtpd: mailq                /usr/libexec/sendmail/sendmail
### smtpd: newaliases   /usr/libexec/sendmail/sendmail
### smtpd: hoststat     /usr/libexec/sendmail/sendmail
### smtpd: purgestat    /usr/libexec/sendmail/sendmail
sendmail        /usr/local/sbin/smtpctl
send-mail       /usr/local/sbin/smtpctl
mailq           /usr/local/sbin/smtpctl
makemap         /usr/local/libexec/opensmtpd/makemap
newaliases      /usr/local/libexec/opensmtpd/makemap

My /usr/local/etc/mail/smtp.conf:

Code:
# This is the smtpd server system-wide configuration file.
# See smtpd.conf(5) for more information.

# To accept external mail, replace with: listen on all
listen on all

# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/mail/aliases

# Uncomment the following to accept external mail for domain "example.org"
#accept from any for domain "example.org" alias <aliases> deliver to mbox

accept for local alias <aliases> deliver to mbox
accept for any relay

My /etc/mail/aliases:

Code:
# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
postmaster: root

# General redirections for pseudo accounts
_dhcp:  root
_pflogd: root
auditdistd:     root
bin:    root
bind:   root
daemon: root
games:  root
hast:   root
kmem:   root
mailnull: postmaster
man:    root
news:   root
nobody: root
operator: root
pop:    root
proxy:  root
smmsp:  postmaster
sshd:   root
system: root
toor:   root
tty:    root
usenet: news
uucp:   root
root:   max
webmaster:      max
freebsd:        max
# Well-known aliases -- these should be filled in!
# manager:
# dumper:

# BUSINESS-RELATED MAILBOX NAMES
# info:
# marketing:
# sales:
# support:

# NETWORK OPERATIONS MAILBOX NAMES
abuse:  root
# noc:          root
security:       root

# SUPPORT MAILBOX NAMES FOR SPECIFIC INTERNET SERVICES
ftp:            root
ftp-bugs:       ftp
# hostmaster:   root
# webmaster:    root
# www:          webmaster
[...]

The rest of the /etc/mail/aliases is quoted with # so I didn't paste it.

When I do # service smtpd start, I get this error:
Code:
Starting smtpd.
invalid hostname: getaddrinfo() failed: hostname nor servname provided, or not known
/usr/local/etc/rc.d/smtpd: WARNING: failed to start smtpd

The same when I'm trying to change the aliases using newaliases() command.

What is the problem? I have no idea why I can't start the service.



[SOLVED] ..

I had to put the right hostname in /etc/rc.conf.
 
Back
Top