List returned by drush site-alias is correct, but drush @sites finds an incorrect list I'm using drush 7.x-4.5, Drupal 7.28, Apache 2.2.21, PHP 5.3.8. I have a multi-site installation, with a dozen or so sites, such as:

/path/to/drupal/sites/example1.com
/path/to/drupal/sites/example2.com
/path/to/drupal/sites/example3.com


Each of these is a symlink to some other location, which is not entirely uniform, e.g.:

example1.com -&gt; /home/example1/drupal


...but another site might be:

example2.com -&gt; /home/example2/www


If I run drush -r /path/to/drupal site-alias, I get a correct list of sites:

example1.com
example2.com
example3.com


However, if I then try to do something like drush -r /path/to-drupal @sites status, I get something unusable:

You are about to execute 'status' on all of the following targets:
  #drupal
  #www
  ...


So I can see it's just resolving the symlink and grabbing the last component of the path, then flattening that down to a set of unique last components of paths, which of course does not work at all.

I have tried filling out aliases with /etc/drush/aliases.drushrc.php, and while the aliases work in the single-site context (e.g. with $aliases['e1'] = array('root' =&gt; '/path/to/drupal', uri =&gt; 'example1.com'), the command drush /path/to/drupal@e1 status). The list that the @sites comes up with is unaffected.

Have I just set up this multi-site installation in an unusual way? It seems to otherwise be fine.

For what it's worth, I have a parallel Drupal 6 multi-site installation, and it has essentially the same problem.
The drush maintainers avoid multisite, so there is a possibility that some bugs might exist here.  The version of Drush that you are using is very old, though; upgrading to Drush 6 would be advisable.  @sites might even work for you then, as some work has been done for multisites and symlinks since Drush 4.

The best thing to do, however, would probably be to make an alias group.  Make a file called /etc/drush/groupname.aliases.drushrc.php, and define aliases 'e1', etc. as you show above, one for each of your multisites, all in the same alias file.  Then, simply:

drush @e1 status - show status on just one site

drush @groupname status - show status on all sites defined in the aliases file 'groupname'