1

I would like postfix to not accept incoming mail. I do however use it for sending e-mail, so I cannot simply uninstall it.

How can I configure postfix to reject all incoming mail?

9
  • 2
    any clues in this link? digitalocean.com/community/tutorials/…
    – graham
    May 5, 2019 at 5:42
  • I used mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = localhost but I still get mensages I want don't get more mensages for keep server clean May 5, 2019 at 12:44
  • So you don't want your server to have any email at all? Why not run apt remove postfix then?
    – Fabby
    May 5, 2019 at 19:07
  • 4
    @fkraiem So because spam is a problem, you are not voting to reopen an on topic question on askubuntu? Properly assisting a user in configuring the mail server could reduce spam as well.
    – vidarlo
    May 7, 2019 at 7:16
  • 1
    This server is only using the e-mails to send to an other server that is why I don't need become contacted throw this server. @fkraiem May 7, 2019 at 8:57

1 Answer 1

3

This is described as a null client in Postfix' documentation.

Configure postfix to only listen to loop back by changing inet_listen to

inet_listen = loopback-only

in /etc/postfix/main.cf

This effectively blocks incoming connections, disallowing mail delivery. In addition, you should set

my_destinations = 

This disables all local mail delivery. This should obviously only be used if you want mail for e.g. root and similar (typically crontab-generated) to be sent to an external host. If you want local delivery of such mail, leave my_destinations as is.

Postfix' documentation has some more information about your attempted configuration, including full explanations of options.

2
  • I will try this solution when I get chance to check it and I will give you the feedback. May 7, 2019 at 8:58
  • Thank you so much for your help May 7, 2019 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .