Postfix Discard

Discussion in 'Server Operation' started by bschultz, Jun 2, 2020.

  1. bschultz

    bschultz Member

    Let's say that my name is John Doe. My email address is [email protected].

    Most of the spammy emails I receive have Jdoe somewhere in the body of the email. How can I discard all emails that contain everything to the left of the @ of the address...for every mailbox on my system?

    Thank you!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It depends.
    What kind of system are you running? MTA? Spam filter? OS?
     
  3. bschultz

    bschultz Member

    That would have been good info to provide. Sorry.

    Debian 8 Perfect Setup, with ISPC3.

    I do need to update this machine to Debian 9 though soon. If that changes the steps to take, I can upgrade first, but that will be a week or so.
     
  4. Steini86

    Steini86 Active Member

    I don't know something out of my head to do this for all mailboxes. I think you have to make individual filters (because otherwise it is not a simple filter, but requires some regular expressions and content filtering). Otherwise it is a lot of effort, see for example: http://www.postfix.org/FILTER_README.html

    If you have problems with too much spam, you can consider switching to rspamd, which does a better job in filtering:
    https://www.howtoforge.com/replacing-amavisd-with-rspamd-in-ispconfig/
    It sounds like you are the only user on your system, or at least know all accounts. Then you can also consider to block certain IPs with blacklists. This blocks the majority of spam on my private system:
    https://github.com/trick77/ipset-blacklist
     
    Th0m likes this.
  5. Th0m

    Th0m ISPConfig Developer ISPConfig Developer

    Amavis can do the job, if set up correctly. What are your spam filter settings?

    Also, I would advise you to upgrade to debian 10 ;)
     
  6. bschultz

    bschultz Member

    ISPC3 spam settings are "normal", and I have not added anything else to it. I use Baracuda and Zen RBL's as well. And yes, I should go to v10, but I still have 1 set of PHP code that won't run on PHP7. You'd think that during a global pandemic I'd have time to rewrite that code!
     
  7. Steini86

    Steini86 Active Member

    You can install old PHP versions additionally(!) even on new systems with: https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/
     
  8. Th0m

    Th0m ISPConfig Developer ISPConfig Developer

    I would advise you to enable the option to move spam emails to the junk folder in the mailbox settings, add some RBLs, and harden your spamfilter settings.
     

Share This Page