Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use Postfix with virtual mailbox and Maildrop for the transport agent. All my emails are delivered to the folder /home/vmail/domain.tld/user/. Today I noticed that emails sent to non-existent addresses are delivered to the file /home/vmail/domain.tld/user. I would rather have them rejected by the server with an error message to the sender.

I think it is responsible to the /etc/postfix/maildroprc file that contains the rules DEFAULT="/home/vmail/$1/$2"

The file /etc/postfix/main.cfg

virtual_mailbox_base = /home/vmail
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1

The rule in /etc/postfix/master.cfg

maildrop  unix  -       n       n       -       -       pipe
   flags=ODRhu user=vmail argv=/usr/bin/maildrop /etc/postfix/maildroprc ${domain} ${user} ${extension} ${recipient} ${user} ${nexthop}

Any idea how I can specify a list of valid emails ? All the emails addresses (except redirections which are in virtual) are listed in the vmailbox database but it seems not use it.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

http://www.postfix.org/LOCAL_RECIPIENT_README.html

You have to correctly set local_recipient_maps in main.cf. This depends on how you manage users (system users, mysql, etc).

It could be something like local_recipient_maps = mysql:/etc/postfix/sql-recipients.cf for mysql.

share|improve this answer
    
Thanks. It seems to work well. In my case, it was local_transport = virtual and local_recipient_maps = $virtual_mailbox_maps (I use virtual mailbox, not mysql) –  Martin Trigaux Nov 21 '12 at 15:36
add comment

Your Answer

 
discard

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.