# SMTP proxying of NATted PCs



## matagou (Feb 10, 2009)

The situation is quite simple: there is a LAN natted by a FreeBSD 7.0 machine that have a public IP assigned on one of its NIC. I want to filter/proxy SMTP (25 port) traffic that passes from LAN  to WAN. I choose smtp-gated, I've installed this software from ports, but I'm getting the folowing error when I start smtp-gated


```
Cannot open .pid file [/var/run/smtp-gated/smtp-gated.pid]: No such file or directory
```


The directory /var/run/smtp-gated exists and it is owned by smtp-gated, the user specified in /etc/smtp-gated.conf

Do i need to create the specified .pid file ?


Thanks in advance


----------



## matagou (Feb 10, 2009)

*Maybe another solution?*

maybe another way to filter/check the smtp traffic that is passed through FreeBSD gateway?


----------



## DutchDaemon (Feb 10, 2009)

Why the proxy? Why not start a regular smtp server (Sendmail/Postfix, etc.) that listens on all interfaces, with a rule that allows relay access to your LAN IPs only? All your LAN users have to do is set the LAN IP address of the gateway as their outbound mailserver.


----------



## matagou (Feb 10, 2009)

thanks, DutchDaemon

I believed that the single solution to prevent sending spam from possible infected hosts behind NAT is using a software that has filter capabilities in combination with SpamAssassin and ClamAv.

Also, i thought that i can prevent sending spam by listing allowed senders that can use smtp session through gateway. All this is possible using a mail relay, as you said.

Thanks


----------



## matagou (Feb 11, 2009)

solved


----------

