I operate a Linux system where I give out free Linux shell accounts to people for educational purposes. Unfortunately, while doing so it's expected to meet abusive users who will keep sending spam emails to other servers such as Google, Zoho, etc and hence will get the IP of the server blocked.
What I would like to do is allow the users on the system to send messages within localhost only. This means that when a user tries to send out an email to an external domain name, GMail for example, the request will be refused. However, if the user tries to send an email to another user on localhost (example: giovanni@localhost), the message will be sent. I don't mind receiving emails from other servers, but I don't want my server to send emails to other servers. How can I do so?
I'm running CentOS 6.5 with Postfix installed. How can I configure this? Any suggestion will be hugely appreciated!
service postfix restart
instead ofservice reload postfix
– Giovanni Mounir Aug 13 '14 at 12:13error:
mailer is used to bounce email. However, I've noticed that I placed a space after the colon, whereas the man page shows the error text starting directly after the colon. Give it a try. As to theservice
command. I always get myservice
andsystemctl
options back to front - the former has service name first, the latter, last. I'll change it. – garethTheRed Aug 13 '14 at 13:23error:
mailer after the hostname have been specified. So it would be* error: Outgoing mail from this system has been disabled.
. Tried with this and it worked, thank you very much! – Giovanni Mounir Aug 13 '14 at 13:39