# How to install /usr/libexec/mail.local ?



## goldenfire (Jan 28, 2010)

This is a problem accompany with my former Post
"Where is the /etc/mail from?"
http://forums.freebsd.org/showthread.php?t=10745

Now I have installed sendmail again like below and sendmail works.


> cd /usr/src/usr.sbin/sendmail/
> make install



But I get some error message

```
ns# tail /var/log/messages
Jan 28 16:36:55 ns sm-mta[36059]: o0S5f5uJ001156: SYSERR(root): Cannot exec /usr/libexec/mail.local: No such file or directory
Jan 28 16:36:55 ns sm-mta[36060]: o0S5f5uL001156: SYSERR(root): Cannot exec /usr/libexec/mail.local: No such file or directory
Jan 28 16:36:55 ns sm-mta[36061]: o0S5f528001153: SYSERR(root): Cannot exec /usr/libexec/mail.local: No such file or directory
Jan 28 16:36:55 ns sm-mta[36062]: o0S5f529001153: SYSERR(root): Cannot exec /usr/libexec/mail.local: No such file or directory
```

I want to know how to install mail.local correctlly?

```
ns# cd /usr/src/libexec/mail.local/
ns# ls
Makefile
ns# make
Warning: Object directory not changed from original /usr/src/libexec/mail.local
ln -sf /usr/src/libexec/mail.local/../../contrib/sendmail/include/sm/os/sm_os_freebsd.h sm_os.h
cc -O2 -pipe  -I/usr/src/libexec/mail.local/../../contrib/sendmail/include -I.  -std=gnu99 -fstack-protector  -c /usr/src/libexec/mail.local
/../../contrib/sendmail/mail.local/mail.local.c
cc -O2 -pipe  -I/usr/src/libexec/mail.local/../../contrib/sendmail/include -I.  -std=gnu99 -fstack-protector    -o mail.local mail.local.o 
/usr/src/libexec/mail.local/../../lib/libsm/libsm.a
cc: /usr/src/libexec/mail.local/../../lib/libsm/libsm.a: No such file or directory
*** Error code 1

Stop in /usr/src/libexec/mail.local.
ns#
```


----------



## goldenfire (Jan 28, 2010)

Remove sendmail is really a foolish decision.
Maybe my installation method is not correct. 

```
cd /usr/src/usr.sbin/sendmail/
make install
```

What is the right way to install sendmail on freebsd after removed it? 
Below is current status. 

```
ns# ls /usr/bin/mail
/usr/bin/mail
ns# ls /usr/sbin/sendmail
/usr/sbin/sendmail
ns# ls /var/spool/mail
ls: /var/spool/mail: No such file or directory
ns# ls /var/spool/secretmail
ls: /var/spool/secretmail: No such file or directory
ns# ls /usr/bin/xsend
ls: /usr/bin/xsend: No such file or directory
ns# ls /usr/bin/xget
ls: /usr/bin/xget: No such file or directory
ns# ls /etc/aliases
/etc/aliases
ns# ls /usr/bin/newaliases
ls: /usr/bin/newaliases: No such file or directory
ns# ls /usr/bin/biff
/usr/bin/biff
ns# ls /usr/libexec/comsat
/usr/libexec/comsat
ns#
```


----------



## goldenfire (Jan 28, 2010)

I also do not have  makemap utility .
oh my god. I just runned  pkg_delete sendmail.
who could teach me how to build up sendmail with all the utilities?


----------



## SirDice (Jan 28, 2010)

goldenfire said:
			
		

> I also do not have  makemap utility .
> oh my god. I just runned  pkg_delete sendmail.
> who could teach me how to build up sendmail with all the utilities?



Sendmail is part of the base OS. This means there isn't a package you can pkg_delete. I think the easiest way to restore it would be to build and install kernel+world.


----------



## goldenfire (Jan 29, 2010)

SirDice said:
			
		

> Sendmail is part of the base OS. This means there isn't a package you can pkg_delete. I think the easiest way to restore it would be to build and install kernel+world.



I believe that I only runned pkg_delete and make deinstall of sendmail.
I still do not understand yhy sendmail was removed.
Do you mean that I need build kernel too?


----------



## SirDice (Jan 29, 2010)

goldenfire said:
			
		

> I believe that I only runned pkg_delete and make deinstall of sendmail.


You probably installed mail/sendmail. There's no need for that port. Sendmail is part of the base OS. No port or package required.



> Do you mean that I need build kernel too?


You might need to. But only if your kernel and world are out of sync.


----------



## DutchDaemon (Jan 29, 2010)

If your current OS was installed from sources, and you haven't updated your source tree or cleared out /usr/obj/ in the meantime, you may even get away with simply running `# make installworld` from /usr/src/.


----------



## goldenfire (Feb 1, 2010)

Not so lucky!
I have removed files insides /usr/obj for disk space problem.
In fact, I have already rebuild kernel + world according to the manual.
Yes, It works. Although I still feel a little different from before, at least it looks all of the utility have come back.

Thanks all of the help.




			
				DutchDaemon said:
			
		

> If your current OS was installed from sources, and you haven't updated your source tree or cleared out /usr/obj/ in the meantime, you may even get away with simply running `# make installworld` from /usr/src/.


----------

