It seems everywhere I look there are tons of questions about sending mail with sendmail. However I want just the opposite and can not figure out how to configure sendmail properly.

I want to set up a system on my ubuntu server to only RECEIVE mail (specifically from a whitelist). I do not want it to have the ability to send mail, I want that feature disabled. I just want to drop the mail into a folder, and another program I have would be doing the sending of it.

Any advice on how to set it up to do this. Currently have sendmail installed with basic config settings, but having never set up a mail server before I am at a loss how to achieve this. Thanks


You may want to use Exim or Postfix. The default Exim configurations I have seen allow you setup blacklists and whitelists very easily. You can also easily disable the network routers.

With Exim I would:

  • configure the server to listen on all addresses (
  • configure the white list with those servers you want to be able to send you mail.
  • configure the blacklist with
  • configure the delivery type as local (define config_local).

I am not sure why you don't want the server sending email. A common configuration is to forward all external mail to a "smarthost" (relay) for delivery. This allows you to send email via the smarthost and avoid the setup required to make your server trusted.

|improve this answer|||||

Contrary to my own misconception partially based on its name, sendmail is a full blown MTA which can be set up to send and receive mail.

To receive emails, you need to set up an MTA (mail transfer agent) which implies proper DNS configurations, the actual MTA and a POP or IMAP server for your clients to be able to get the messages.

You should look for tutorials on setting up an MTA using PostFix or sendmail, and DoveCot, or other similar tools. Note that configuring a system to only receive emails seems like a big job for a system that will be missing a leg but it is possible.

|improve this answer|||||
  • 3
    Err, sendmail is a MTA. – thrig Jun 29 '16 at 16:57
  • sendmail was always very flexible, specially dealing directly with the m4 directives. – Rui F Ribeiro Jun 29 '16 at 17:11
  • @thrig: I apparently wrongly assumed it only dealt with sending. After looking it up based on your comment, I see that you're right. I'll update my answer accordingly. – Julie Pelletier Jun 30 '16 at 3:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.