# Help me install/setup a mail utility



## Jadog (Mar 18, 2016)

I added the Sarg package for Squidguard reporting. It works fine and I'm able to view the reports without an issue. When I attempt to have it email me the reports, by running the `sarg -x` command from the shell to test, it gives me the message "mailx: not found".







I know that within the Sarg.conf file there is a place to specify a mail utility. The one there right now is the default - mailx.


```
# TAG: mail_utility
#  Mail command to use to send reports via SMTP. Sarg calls it like this:
#  mail_utility -s "SARG report, date" "output_email" <"mail_content"
#
#  Therefore, it is possible to add more arguments to the command by specifying them
#  here.
#
#  If you need too, you can use a shell script to process the content of /dev/stdin
#  (/dev/stdin is the mail_content passed by Sarg to the script) and call whatever
#  command you like. It is not limited to mailing the report via SMTP.
#
#  Don't forget to quote the command if necessary (i.e. if the path contains
#  characters that must be quoted).
#
#mail_utility mailx
```
I'm assuming that since mailx(1) is not working, it's not installed/configured. I am somewhat a beginner here, and would like some assistance installing a mail utility. Mutt seems like a common choice, but if mailx(1) is better or easier, I'm certainly open. Can someone point me in the right direction? Any help with the actual installation steps would be appreciated as well.


----------



## ondra_knezour (Mar 18, 2016)

What about using full path? There is /usr/bin/mailx installed in base system. You can always try to locate file with `whereis mailx` for example.

Try to change line 
	
	



```
#mail_utility mailx
```
 to 
	
	



```
mail_utility /usr/bin/mailx
```

Also port mail/mailx exists.


----------



## SirDice (Mar 18, 2016)

Looking at your version string you're running pfSense.

PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives


----------



## kpa (Mar 18, 2016)

Yes, please use the pfSense forums for your problem. We have no idea how pfSense handles package installations, they might use pkg(8) but there could be additional components involved in the vein of PBIs used by PC-BSD.


----------



## Jadog (Mar 19, 2016)

ondra_knezour said:


> What about using full path? There is /usr/bin/mailx installed in base system. You can always try to locate file with `whereis mailx` for example.
> 
> Try to change line
> 
> ...



Thank you. That was super helpful. I used the `whereis mailx` command and it returned the message Command not found. So I browsed out to the /usr/bin path and there was no mailx package there. So I ran the command `pkg install mailx`. In addition to mailx it also required the installation of perl5. So it installed and now I can see mailx under /usr/local/bin. So I did as you recommended and changed the path to /usr/local/bin/mailx. But I still get the same message. Thanks for the help so far, and I appreciate any more you can give.


----------



## wblock@ (Mar 20, 2016)

Look again.  You said user in your unedited post, not the correct usr.


----------



## Jadog (Mar 20, 2016)

wblock@ said:


> Look again.  You said user in your unedited post, not the correct usr.



Thanks for correcting. I confirmed that the path is indeed /usr/local/bin/mailx.



kpa said:


> Yes, please use the pfSense forums for your problem. We have no idea how pfSense handles package installations, they might use pkg(8) but there could be additional components involved in the vein of PBIs used by PC-BSD.



I have tried that already and received no response. I wasn't aware there were so many differences, but I can try again there. Thanks for the help and the opportunity to learn!


----------

