Re: [exim] outbound discard all filter for cpanel twisted ex…

Top Page
Delete this message
Reply to this message
Author: ping murder
Date:  
To: Mike Brudenell
CC: Exim Users
Subject: Re: [exim] outbound discard all filter for cpanel twisted exim
Hello,
Thanks for your response.

cPanel based servers really aren't intended to run w/ email disabled. In
this case the servers are back ends to a clustered system and only run
cPanel for the client's convenience. We have a huge number of Wordpress
sites, they tend to get compromised and those compromises tend to be spam
sending.

We've taken all the recommended steps, disabled php mail functions, set
account sending limits to 0, etc. What you end up with is either an exim
queue full of un-sent emails that fills until the server falls over / you
manually dump it or (if you ignore cPanel support) and do disable exim
completely the load on the web processes raises from them constantly trying
to send mail to it and failing. (The WP hackers are getting around php mail
disabled easily now)

Ideally, what I would like is to let everything stay as is (since cPanel
will over-write most changes anyway) and create a filter that just discards
any email in exim. Basically we don't need the server to be able to send
email of any kind but thanks to cpanel we're stuck.

I've used inbound filters to great effect, they do exactly what we want and
without impacting the system. It would be really great to be able to do the
same thing w/ outbound.

I hope that clarifies things somewhat.
Thanks,
Brian


On Wed, Feb 15, 2017 at 3:09 AM, Mike Brudenell via Exim-users <
exim-users@???> wrote:

> Hi, PM -
>
> Do your servers send the outbound email direct to the recipient or to a
> smarthost? That is, are you wanting to configure the individual servers to
> not send out email, or to configure your smarthost to discard mail coming
> in from them instead of delivering it onward?
>
> Assuming it's the former…
>
> I don't think you want a "filter" within Exim, but could probably just use
> ACLs to deal with the messages. For example there are two ACL that are
> likely of interest:
>
>    - *acl_smtp_rcpt* — used for messages that arriving at your Exim over
>    SMTP, and
>    - *acl_not_smtp* —  used for messages that are locally submitted to your
>    Exim directly from the command line (ie, not over SMTP)

>
> Rather than trying to stop mail going out, just deal with it in these ACLs
> to prevent it getting in!
>
>    - If you want to inform the sender the message was rejected with a
>    refusal code use the *deny* verb.
>    - If you want to silently accept the message *discard* verb.

>
> See the Exim Specification to read more about
>
>    - Access Control Lists (ACLs)
>    <http://www.exim.org/exim-html-current/doc/html/spec_
> html/ch-access_control_lists.html>
>    in general
>    - these ACL verbs and others verbs
>    <http://www.exim.org/exim-html-current/doc/html/spec_
> html/ch-access_control_lists.html#SECID200>

>
> If you're trying to do this on a central smarthost — to reject or discard
> messages arriving from some sources but not others — use the same idea but
> with some conditions to only apply the deny or discard to hosts it should
> affect.
>
> (An alternative approach would be to accept the incoming message into your
> queues and then not have a router that accepts and processes the message,
> resulting in it failing with an "Unrouteable message" error. The ACL
> approach would seem to be simpler and cleaner though.)
>
> Cheers,
> Mike B-)
>
> On 10 February 2017 at 03:04, ping murder via Exim-users <
> exim-users@???> wrote:
>
> > Hello,
> > I have a large number of servers on which we do not want outbound email,
> > however it's pretty much impossible to kill off Exim on cPanel servers
> > without creating far worse issues.
> >
> > What I would like would be to create a discard filter that takes any
> > outbound email that hits exim and sends it to the great circular file in
> > the sky.
> >
> > I'm familiar with creating filters for inbound email in exim but can't
> > really find much on doing the same for outbound. Do the inbound filters
> > also apply vs outbound?
> >
> > Thanks,
> > PM
> > --
> > ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> > ## Exim details at http://www.exim.org/
> > ## Please use the Wiki with this list - http://wiki.exim.org/
> >
>
>
>
> --
> Systems Administrator & Change Manager
> IT Services, University of York, Heslington, York YO10 5DD, UK
> Tel: +44-(0)1904-323811
>
> Web: www.york.ac.uk/it-services
> Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/