How to create a black hole email address?

  • You can do this by configuring postfix to discard mails by a specific rule (envelop sender/ recipient). This requires a manual modification of the main.cf config file.


    But as kk said: Don't do this as long as you _REALLY_ know what you're doing.


    Just bounce unwanted messages.


    I think you mean rejecting the mail during the SMTP dialog instead of bouncing the mail after accepting it. :)

  • Two use cases:


    • The typical emails automatic notification emails with no-reply@emailaddress.com. Probabably will have a reply-to header, but some user can still start using it and I just don't want to clean out the mailbox
    • A billing software like WHMCS can only associate clients with email addresses. Some clients just don't want to receive emails or don't want to give an email address. I create a unique email for them, because WHMCS cannot do without, but I don't want to see emails nor see them bounce.


    Both make sense to me and while they might be illegal in the strict sense, nobody is really bothered by this use.


    Meanwhile I found a way to create a blackhole address:


    • Add this line to /etc/aliases:

      Code
      null: /dev/null


    • Compile the changes by running:

      Code
      newaliases


    • Make a custom virtual alias file /etc/postfixt/virtual_alias_custom with:

      Code
      null@existingmaildomain.com  null@localhost


    • Take care that the file permission and owner are the same as /etc/postfix/virtual_alias and then run in the /etc/postfix directory:

      Code
      postmap virtual_alias_custom


      virtual_alias_custom.db should appear now.

    • Modify /etc/postfixt/main.cf to include this new file:

      Code
      virtual_alias_maps = hash:/etc/postfix/virtual_alias hash:/etc/postfix/virtual_alias_custom


    • Restart Postfix

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!