Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


cPanel Mail / MXRoute possible to block all emails with attachments?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

cPanel Mail / MXRoute possible to block all emails with attachments?

xaitmixaitmi Member

Is there a way to set the filter so it rejects all incoming emails that contain attachments?
I get a lot of spam mail that contain malicious attachments and I'm never going to receive anything with attachments via email anyways so I'd like to just reject it

Comments

  • wouldn't it better to write a ticket for it at MXroute?

  • xaitmixaitmi Member
    edited April 2018

    @omelas said:
    wouldn't it better to write a ticket for it at MXroute?

    Their behind on tickets and cpanel is used everywhere so I figured I'd ask here to see if it's possible

  • angstromangstrom Moderator

    @xaitmi said:
    Is there a way to set the filter so it rejects all incoming emails that contain attachments?
    I get a lot of spam mail that contain malicious attachments and I'm never going to receive anything with attachments via email anyways so I'd like to just reject it

    I don't use cPanel, but my guess is that in the best case, you will have to be prepared to write your own filter for Exim, and in the worst case, you won't have direct access to this.

    Another possibility is to try to use your email client (e.g., Thunderbird) to block/delete emails with attachments when it accesses them via IMAP or POP. If you search for "how to reject emails with attachments thunderbird", you can see different attempts, but no recipe fits all. For example, see https://support.mozilla.org/en-US/questions/1145326 .

    Thanked by 1xaitmi
  • @angstrom said:

    @xaitmi said:
    Is there a way to set the filter so it rejects all incoming emails that contain attachments?
    I get a lot of spam mail that contain malicious attachments and I'm never going to receive anything with attachments via email anyways so I'd like to just reject it

    I don't use cPanel, but my guess is that in the best case, you will have to be prepared to write your own filter for Exim, and in the worst case, you won't have direct access to this.

    Another possibility is to try to use your email client (e.g., Thunderbird) to block/delete emails with attachments when it accesses them via IMAP or POP. If you search for "how to reject emails with attachments thunderbird", you can see different attempts, but no recipe fits all. For example, see https://support.mozilla.org/en-US/questions/1145326 .

    Thanks for the info. I submitted a feature request at mxroute but it probably won't get implemented.

    The mail client thing is handy but I get emails on my phone as well as my laptop so it won't work for me.

    One workaround I can think of is leaving a mail client open 24/7 on a VPS that filters the mail so my other devices never see the attachment ones.

  • jarjar Patron Provider, Top Host, Veteran

    I think it'd be possible, I just haven't tried it myself. There's some interesting discussion about method here:

    https://www.linuxquestions.org/questions/linux-server-73/sieve-filter-on-pigeonhole-to-remove-exe-attached-emails-doesn't-work-4175493036/

    You're effectively using sieve filters (or compatible), so regex is absolutely within your toolset.

  • CrossBoxCrossBox Member, Patron Provider
    edited April 2018

    A while ago we've received similar requests from users running in the closed beta, so we decided to develop "Filters" module which helps you make all sorts of useful combinations of conditions to match and actions to take regarding your email.

    In the screenshot below you can see a filter that will delete an email if the size > 1024KB is matched. All of the filters you create run directly on the server so you don't depend on the mail client. You can choose to run specific filters manually and others automatically when getting a new email.

  • mikhomikho Member, Host Rep

    Do you want to remove the email message or only the attachment?

  • angstromangstrom Moderator

    @mikho said:
    Do you want to remove the email message or only the attachment?

    The OP says the whole emails, which is (very probably) an easier task.

  • mikhomikho Member, Host Rep

    Try
    Email filters (if you want to set it per user).
    Global Email filters ( global, yeah, every account ).

    Create filter.
    Rules: Body | contains | .zip

    Actions: discard message.

    Test it on one account before you go global.

    NB!
    It will also remove emails mentioning .zip

  • mikhomikho Member, Host Rep

    No idea if that works but it’s worth a try.

  • Why not filter on something with less sideeffects, such as „mime type [i don’t know]“?

  • angstromangstrom Moderator

    @southy said:
    Why not filter on something with less sideeffects, such as „mime type [i don’t know]“?

    Yeah, it's kind of dangerous to simply search for ".zip" in a message.

    Thanked by 1Aidan
  • jarjar Patron Provider, Top Host, Veteran

    @CrossBox said:
    A while ago we've received similar requests from users running in the closed beta, so we decided to develop "Filters" module which helps you make all sorts of useful combinations of conditions to match and actions to take regarding your email.

    In the screenshot below you can see a filter that will delete an email if the size > 1024KB is matched. All of the filters you create run directly on the server so you don't depend on the mail client. You can choose to run specific filters manually and others automatically when getting a new email.

    Make me an offer for testing it on MXroute servers :)

  • MikePTMikePT Moderator, Patron Provider, Veteran

    @jarland said:

    @CrossBox said:
    A while ago we've received similar requests from users running in the closed beta, so we decided to develop "Filters" module which helps you make all sorts of useful combinations of conditions to match and actions to take regarding your email.

    In the screenshot below you can see a filter that will delete an email if the size > 1024KB is matched. All of the filters you create run directly on the server so you don't depend on the mail client. You can choose to run specific filters manually and others automatically when getting a new email.

    Make me an offer for testing it on MXroute servers :)

    Thought about it too...

Sign In or Register to comment.