31

I'm searching for an equivalent of a sinkhole email address. Essentially, I need a discard mechanism similar to /dev/null or the non-routed range 240.0.0.0/4.

Options like null@, devnull@, or none@ seem plausible, but there's a concern that these addresses might already be in use.

Is there a de facto standard for this specific use case?

Update:

Some comments points to use <> and :; as destination address, but any of them produce a response 501 5.1.3 Bad recipient address syntax on a Postfix MTA:

<-  250 2.1.0 Ok
 -> RCPT TO:<:;>
<** 501 5.1.3 Bad recipient address syntax
 -> QUIT
<-  221 2.0.0 Bye

and:

<-  250 2.1.0 Ok
 -> RCPT TO:<<>>
<** 501 5.1.3 Bad recipient address syntax
 -> QUIT
<-  221 2.0.0 Bye

Also, a blank space have the same response:

<-  250 2.1.0 Ok
 -> RCPT TO:< >
<** 501 5.1.3 Bad recipient address syntax
 -> QUIT
<-  221 2.0.0 Bye

From the client side, it must look fine, receiving a 250 2.0.0 O like sending content to /dev/null:

$ echo test > /dev/null && echo $?
0
Giacomo1968
  • 58,727
rfmoz
  • 421

4 Answers4

26

Options like null@, devnull@, or none@ seem plausible, but there's a concern that these addresses might already be in use.

None of those are standard and they indeed might be already in use.

As far as I know, there is no special address that would guarantee non-delivery when sending to arbitrary random domainsany syntactically-valid "local-part" is equally valid for delivery, and only the receiving MTA can decide whether to accept it; the sending MTA cannot refuse based on local-part.

So in all cases, you'll have to decide on a specific (sub)domain first.

Suggestions:

  • Set up an MTA at your own domain name (or a subdomain thereof; you can put MX records on subdomains). You'll then have a guarantee that e.g. null@ will not be in use at that particular domain. Of course, the sender will still try to contact you, but you can literally alias that mailbox to /dev/null on your end.

  • There is now a recent convention of creating a "null MX" record on domains that are explicitly never expected to receive email (as opposed to domains that have no MX records, in which case the domain would be implicitly its own MX). If you create a single MX record that points to the server ., this will cause many new MTAs to automatically fail delivery. Again, you can use a subdomain for this instead of dedicating a whole domain.

    example.com (and .net, and .org) is a real domain that exists, but is reserved for usage in examples and documentation (i.e. it'll never have real mailboxes); as part of that, it actually has a "null MX" record.

  • There are reserved domains, such as [anything].invalid, which will never exist in DNS at all (not even as null-MX) and therefore your origin MTA will immediately fail delivery.

Giacomo1968
  • 58,727
grawity
  • 501,077
13

Since the question mentions Postfix MTA, here is how to set up Postfix to have a particular address behave as if it was an equivalent of /dev/null.

The Postfix comes with a discard mail delivery agent, which is described as:

The discard(8) delivery agent pretends to deliver all recipients in the delivery request, logs the "next-hop" destination as the reason for discarding the mail, updates the queue file, and either marks recipients as finished or informs the queue manager that delivery should be tried again at a later time.

An e-mail address can be configured to be handled by the discard agent by using the transport maps:

/etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:

dev-null@example.com    discard:

Then execute postmap /etc/postfix/transport to create indexed file of the transport database and reload the Postfix daemon (the command for reloading or restarting a daemon could vary depending on the operating system being used).

As a result, Postfix will discard mail addressed to dev-null@example.com.

Mail for entire domain or subdomains can be discarded in this way:

/etc/postfix/transport:

# discard all mail to domain 'example.com':
example.com    discard:

discard all mail to subdomains of 'example.com':

.example.com discard:

Giacomo1968
  • 58,727
VL-80
  • 4,693
5

Not sure about any de facto standard, but I usually just use an address starting with noreply-. All you really need to do is make sure that the address you use does not exist in the domain.

It's not exactly like /dev/null in that an MTA will still try to route it instead of just dumping it, but it does end up going nowhere.

Giacomo1968
  • 58,727
squillman
  • 8,551
4

Consider using an email address at Example.com (Wikipedia, RFC 2606).