Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there something I can run from the command line that will let me query postfix (running locally)?

  1. if an address is in the virtual address file and,
  2. where the mail for that address is routed to.

Ex: If I have the email address of I want to ask postfix if that virtual alias exists and then see that it's mail get routed to

share|improve this question
up vote 8 down vote accepted

How about postalias:

 postalias -q /path/to/your/valias_file
share|improve this answer
Note that you can have multiple alias files, defined in the postfix config file. For instance, we have a file that is generated by our ERP and a manual file of "special" addresses. The command does appear to take multiple files as arguments, but it finds the first instance of what you're searching for and stops. There are some odd cases where an alias shows up in both files. So the postalias command would need to be called once for each of those files, to be sure that you got everything. – Phil Erb Jan 23 '12 at 18:12
sendmail -bv

Despite the name, this is a postfix program, and will deliver an email to the mail admin account that will give you that information. postalias -q will show you what the alias file has in it, as the previous responder said. This may or may not be what actually happens - sendmail will do a full address resolution and generate a report - but won't report out to the command line, as near as I can tell.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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