New on LowEndTalk? Please Register and read our Community Rules.
stop outgoing remote emails, and allowed incoming mail (exim)
Hello,
I would like to stop sending outgoing emails for all account in the server, and only allowed incoming emails.
I try to find a idea in the google, but almost all the ideas affect incoming mail too. Any ideas you have?.
Exim.conf is default veatacp file:
https://c.vestacp.com/0.9.8/rhel/exim.conf
Thanks in advance.
Comments
@alshahad Just block all outgoing mail ports and use hourly limit like 1 email per hour and remove all domains from /etc/local... file which used in cPanel to send email. Use filter code which create issue to send email. (Wrong code in filter file can cause to fail send email)
Disable mail features in package and use "disabled" features file. I use it on one of my free server which is used for free hosting https://free.zeromb.com:2083 - cPanel Server. (I think your situation is similar like mine
@DewlanceVPS If he's using vestacp's config, most probably using vestacp not cpanel
I was think "vestacp" is a file name
Look like vestacp use Exim so I think config is similar and hourly email limit comes with exim and most of can be modified like removing domains from /etc/localdomains and make it read only.
Create filter with wrong code which can cause to fail email sending.
Disable outgoing email by tld based (Disable most of TLDs especially most popular TLDs and free TLD.)
Thanks a lot. Just I got a wild idea!
To share it with others:
I block all outgoing connections in port 25 via iptables and only allowed incoming connections.
And the outgoing emails will work only in local.
@alshahad I think you also need to block connection to other mail port like IMAP, POP3 Port, etc.
Look at this tutorial for exim, Use non existing IP for exim for outgoing mail. Means setup a IP which is not existing on your server for outgoing mail https://help.directadmin.com/item.php?id=153
@DewlanceVPS Yes, very well nice idea, to help people out:
you can do so by editing your /etc/exim.conf.
Change:
remote_smtp:
driver = smtp
to:
remote_smtp:
driver = smtp
interface = 9.9.9.9
Where 9.9.9.9 should not exist in the server.
I think the following URL will help you with this. Actually, the post describes how to block the outgoing emails in cPanel server. But you can try the method one specified in there.
https://grepitout.com/block-outgoing-emails-account-cpanel/
You can always block outbound SMTP port (25) at the firewall level and leave your vesta CP config stock. Leaving your CP configs stock might help during future system upgrades.
/sbin/iptables -A OUTPUT -p tcp --dport 25 -j DROP
Edit: Oops just saw your note later in the thread that you did just this. Sorry for dup. Derp, brain not working on a Monday.
Good news for cPanel users, In new version 70
In cPanel & WHM version 70, you can now allow, suspend, or queue outgoing mail for an email account in cPanel's Email Accounts interface (cPanel >> Home >> Email >> Email Accounts). This grants administrators the capacity to limit a user's ability to send outgoing mail, but still allow users to read or receive mail.
>
>
Ok. Great. That's also what comes to my mind.