# sendmail on new install



## Lido (Dec 9, 2011)

I just installed 8.2 RELEASE a few weeks ago. During the installation, I selected exim, then later changed my mind and wanted to install sendmail with send only (can't remember the exact wording that's in sysinstall). When I went back and tried to do that, it didn't seem to install anything. Now when I try to have php send email, it's giving me the 
	
	



```
freebsd mailwrapper: cannot exec /usr/local/sbin/exim: No such file or directory
```
 error. Any advice on how to get to install sendmail or exim in a way that I can send mail, but not have any smtp ports open for receiving? Thanks.


----------



## Lido (Dec 9, 2011)

To be clear, I know I can install exim via ports, I'm mostly asking how to make either exim or sendmail "send only" and wondering if sendmail is part of the base system and already installed, how to make php look to it as 'sendmail' rather than the missing exim, which it's currently pointing to.


----------



## phoenix (Dec 9, 2011)

First:  DO NOT USE SYSINSTALL FOR ANYTHING ONCE THE OS IS INSTALLED!!!  You will just make things a mess if you try to use sysinstall for anything other than installing the OS.

Second, the default install for FreeBSD includes a send-only setup for sendmail (which is included in the base OS).  So you didn't need to install Exim (unless you really wanted to use Exim).

When you installed Exim, it updated /etc/mail/mailer.conf which configures mailwrapper(8) (a wrapper around the sendmail binaries that allows you to use whichever SMTP server you want) to point to the Exim binaries.

When you removed Exim, this file wasn't updated, so it's now pointing to non-existent binaries.

Update /etc/mail/mailer.conf to point to the Sendmail binaries (the default):

```
# $FreeBSD: stable/8/etc/mail/mailer.conf 93858 2002-04-05 04:25:14Z gshapiro $
#
# Execute the "real" sendmail program, named /usr/libexec/sendmail/sendmail
#
sendmail        /usr/libexec/sendmail/sendmail
send-mail       /usr/libexec/sendmail/sendmail
mailq           /usr/libexec/sendmail/sendmail
newaliases      /usr/libexec/sendmail/sendmail
hoststat        /usr/libexec/sendmail/sendmail
purgestat       /usr/libexec/sendmail/sendmail
```


----------



## Lido (Dec 11, 2011)

*Solved*

Freddie, Thanks for the reply. That fixed it. I can't see how to edit my original post to mark it "solved" so since you're a mod, maybe you could do that?

Also, is there a way I can check which ports are open to make sure it's not set to receive?


----------



## wblock@ (Dec 11, 2011)

Shouldn't the Exim port fix mailer.conf on deinstall?


----------



## Lido (Dec 11, 2011)

I just tested SMTP by:
	
	



```
telnet 192.168.1.54 25
```
and was able to send a message that way. I'd like to find a way to shut that down so the server is send only.


----------



## Lido (Dec 11, 2011)

Ok, nevermind, I found the page in the handbook that explains it. I commented 
	
	



```
sendmail_enable="YES"
```
 out of 
	
	



```
/etc/rc.conf
```
 and that seems to have closed port 25 so connections are refused now. Sending still works ok apparently, so this issue has been resolved. Thanks.


----------



## phoenix (Dec 12, 2011)

wblock@ said:
			
		

> Shouldn't the Exim port fix mailer.conf on deinstall?



I would expect it to, but I don't use Exim so wouldn't know.  The Postfix port does correctly update the mailer.conf file on deinstall.


----------



## SirDice (Dec 13, 2011)

Lido said:
			
		

> Also, is there a way I can check which ports are open to make sure it's not set to receive?


sockstat(1) and netstat(1).

[cmd=]sockstat -46[/cmd]

[cmd=]netstat -an | grep LISTEN[/cmd]
(This only works for TCP, not UDP)


----------

