Reject spam with local hostname in sender (postfix)

  • Hi,


    I'm using postfix and receive spam with my own domains (registered in imscp on the same machine) as sender:


    Return-Path: <[email protected]>
    Delivered-To: [email protected]
    Received: from [14.169.226.79] (unknown [14.169.226.79])
    by webhosting.meinserver.de (Postfix) with ESMTP id E45DC1AC1D2
    for <[email protected]>; Fri, 6 Nov 2015 08:00:06 +0100 (CET)
    Message-ID: <[email protected]>
    Date: Fri, 06 Nov 2015 20:00:06 +0600
    From: <[email protected]>
    User-Agent: Mozilla/5.0 (Windows NT 5.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
    MIME-Version: 1.0
    To: <[email protected]>
    Subject: Hallo, mein Schatz
    Content-Type: multipart/alternative;
    ...


    (I changed the domain names. In this example, [email protected] is set up as a mail redirect to [email protected])


    How can I prevent that my server accepts mails from hosts registered at my system that are sent by some other servers (e.g. 14.169.226.79)?


    Thank you very much!
    Toby

  • Thank you, SpamAssassin detects all these mails. Is there a plugin I can install for postfix so I can set up rules to move the marked mails to a spam folder? I only found something for dovecot.

  • I always have to ask, why do you want to store SPAM mails? As far as I can tell 99% of people are not checking SPAM mails and they also need resources on your server.


    Instead I would use the reject option in the SpamAssassin plugin and you would never see the mails. The SPAM mails will be rejected to the sender, so you do not have the probem by missing an important mail, because it is in your SPAM folder. And if it is a false positive, then the sender will get the message that his mail was detected as SPAM.


    You are right, there is nothing for postfix, because it is a MTA. You need the filter for your MDA in that case dovecot.


    If you still want to store your SPAM mails, you could use the RoundcubePlugins plugin, there is a filter rule for managesieve, which will move the SPAM mails into the SPAM folder. Please check the wiki for documenation.