Q0416

Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions
Clone this wiki locally

Q0416


`Navigation(siblings)`_


Q0416

Question

What is quickest way to set up Exim so any message sent to a non-existing user would bounce back with a different message, based on the name of non-existing user?

Answer

Place this router last, so that it catches any local addresses that are not otherwise handled:

non_exist:
  driver = accept
  transport = non_exist_reply
  no_verify

Then add the following transport to the transports section:

non_exist_reply:
  driver = autoreply
  user = exim
  to = $sender_address
  subject = User does not exist
  text = You sent mail to $local_part. That's not a valid user here. \
         The subject was: $subject.

If you want to pick up a message from a file, you can use the file option (use file_expand if you want its contents expanded).