Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

My mail server hosts email for two different domains which it responds to as physical domains and also handles several virtual emails. Yes, this is insane, but postfix lets me do this.

Recently, I have been trying to add maildrop support to allow me to filter emails on each account as per the recipients needs.

A relevant excerpt is:

myorigin = /etc/mailname
mydestination =,, localhost.localdomain, localhost.localdomain, localhost
home_mailbox = Maildir/
maildrop_destination_recipient_limit = 1
mailbox_command = /usr/bin/maildrop -d ${USER}

virtual_mailbox_domains =
virtual_mailbox_base = /var/mail
virtual_mailbox_maps = hash:/etc/postfix/virtual/maps
virtual_alias_maps = hash:/etc/postfix/virtual/aliases
virtual_minimum_uid = 1000
virtual_uid_maps = static:vmail
virtual_gid_maps = static:vmail
virtual_transport = maildrop

As you've guessed, contains a maildrop transport:

maildrop  unix  -       n       n       -       -       pipe
  flags=ODRhu user=vmail:vmail argv=/usr/bin/maildrop -w 90 
  -d ${user}@${nexthop}
  ${extension} ${recipient} ${user} ${nexthop}

Now, my problem is that only domain1 receives user lookups successfully. If I email, maildrop complains:

s_connect() failed: No such file or directory /usr/bin/maildrop: Unable to open mailbox.

and emails to domain3/domain4 complain:

s_connect() failed: No such file or directory Invalid user specified.

Not unsurprisingly, /etc/mailname ==

I believe part of my problem might be the and /etc/maildroprc configurations, so my questions are twofold:

  1. Is there a way to configure these to play nicely with my somewhat convoluted setup?
  2. Is maildrop the tool to use for this, or is there a better MTA which explicitly supports this kind of layout (and if so how do I actually use it)?

Finally, as an aside, if this question is better on serverfault/unix/ubuntu, feel free to move it there.

share|improve this question

[virtual domains part]

Replace -d ${user}@${nexthop} by -d ${user}@${domain} in as recommended in Postfix + Maildrop Howto

As I understand in your configuration ${nexthop} is an empty string so maildrop gets user@

share|improve this answer

You must log in to answer this question.