On Tuesday 20 December 2011 12:35:40 Roberto Greiner wrote: > I'm trying to create a /dev/null mailbox, but didn't get much > success following the recipe at > http://www.serverwatch.com/columns/article.php/3844371/Forwarding-a > -Postfix-Virtual-Alias-to-devnull.htm > > What I did was following: > - Add a "blackhole" alias in /etc/aliases (blackhole: /dev/null), > an ran "newaliases" to validate it.
Okay so far, except that the concept of discarding mail is generally not a good idea. Why do you want to do that? What would be wrong with rejecting that address? That said, as P@rick points out, we do have a discard(8) delivery agent which can be directed to using transport(5) maps. http://www.postfix.org/transport.5.html http://www.postfix.org/discard.8.html http://www.postfix.org/postconf.5.html#transport_maps > - Added the following in mysql_virtual_alias_maps.cf: > no-reply@<my domaind> = blackhole This sounds wrong. Furthermore, it is not a good idea to use a bare username in place of a full email address. You should have used "blackh...@some.domain.listed.in.mydestination". See virtual(5) for the format of virtual_alias_maps lookup keys and results. See mysql_table(5) for the details of setting up a query in Postfix. See MySQL documentation for information about setting up a database in mysql. http://www.postfix.org/virtual.5.html http://www.postfix.org/mysql_table.5.html http://www.mysql.com/ > - Ran: > postmap /usr/local/etc/postfix/mysql_virtual_alias_maps.cf (it's You do not compile a query file with postmap. But, you can use postmap to test your lookups. http://www.postfix.org/postmap.1.html > a FreeBSD platform) > - Restarted Postfix. Not necessary. > Sending an email to no-reply@<my_domain> got me the following error > message in /var/log/maillog: > NOQUEUE: reject: RCPT from unknown[<my_ip>]: 450 4.1.1 > <no-reply@<my_domain>>: Recipient address rejected: User unknown in > virtual mailbox table; from=<<my email address>> to=<no-reply@<my > domain>> proto=ESMTP helo=<[<my_ip>]> The munged-out domain is in virtual_mailbox_domains, but the address no-reply@<my_domain> is not listed in virtual_mailbox_maps. > I tried adding the same entry from mysql_virtual_alias_maps.cf into > mysql_virtual_mailbox_maps.cf, but no success either. Also, just in Those sound like they are database queries, not actual map files. > case, the same page above mentions that adding a valid user for the > aliases might be necessary. Didn't help either. > > Any ideas would be welcome. If this doesn't help, http://www.postfix.org/DEBUG_README.html#mail tells you how to post here such that you can get more useful answers. Also, it might be difficult to figure out a mail routing issue where you have munged the domains. > PS: My setup is the following: > FreeBSD 7.2 machine > Postfix 2.8.2 > Postfixadmin 2.3.2 > > > main.cf has at the end the following entries: > ## MySQL access > virtual_alias_maps = > mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf Yup, if this is right, it's a query file. > virtual_gid_maps = static:125 > virtual_mailbox_base = /var/mail > virtual_mailbox_domains = > mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf > virtual_mailbox_limit = 104857600 > virtual_mailbox_maps = > mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf > virtual_minimum_uid = 125 > virtual_transport = virtual > #virtual_transport = maildrop > virtual_uid_maps = static:125 > # Additional for quota support > virtual_create_maildirsize = yes > virtual_mailbox_extended = yes > virtual_mailbox_limit_maps = > mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf > virtual_mailbox_limit_override = yes > virtual_maildir_limit_message = Desculpe, tamanho da caixa postal > excedido, tente mais tarde! Sorry, mailbox size exceeded, try > later! > virtual_overquota_bounce = yes -- Offlist mail to this address is discarded unless "/dev/rob0" or "not-spam" is in Subject: header