Mon, 25 Mar 2013 14:09:04 -0400 (EDT) skrev Wietse Venema
<wie...@porcupine.org>:

> Titanus Eramius:

> > MAIL FROM:<>
> > 250 2.1.0 Ok
> > RCPT TO:<real-u...@cogky.dk>
> > 250 2.1.5 Ok
> > RCPT TO:<non-exist...@cogky.dk>
> > 250 2.1.5 Ok
> 
> > If non-exist...@cogky.dk is substituted with non-exist...@aptget.dk,
> > then it is still rejected with "... unknown in virtual mailbox
> > table".
> 
> You appear to have a wild-card rule that replaces @cogky.dk with
> @aptget.dk.  Such a rule matches all addresses including invalid ones.
> 
> Instead use a MySQL query  as decribed in
> http://tech.groups.yahoo.com/group/postfix-users/message/247913
> 
>       Wietse

Thank you for the link, it was very informative, but didn't solve the
problem. I also tried making a virtual_mailbox_maps MySQL query that
always returned false, but Postfix still accepted all mail, and then
bounced it after Dovecot rejected it.

I have converted virtual_mailbox_maps and virtual_mailbox_domains to
textfiles, so it should be easier to debug on the setup. Please note
that I had to change server to experiment like this, since I depend
on the other server.

The servername is nt-data.dk, and the hosted domain (which all mail is
accepted for) is nt-backup.dk. The behavior is the same, so mail sent
to non_exist...@nt-data.dk is rejected, while mail sent to
non_exist...@nt-backup.dk is accepted, and then bounced.

In main.cf (please see the bottom for postconf -n) is
   virtual_mailbox_domains         =
      hash:/etc/postfix/virtual_mailbox_domains.cf
   virtual_mailbox_maps            =
      hash:/etc/postfix/virtual_mailbox_maps.cf

And the content of those files is
virtual_mailbox_domains.cf:
   nt-backup.dk   OK
   nt-data.dk     OK

virtual_mailbox_maps.cf:
   t...@nt-backup.dk    OK
   i...@nt-data.dk      OK

It all works like a charm, besides the point that Postfix accepts
mail to non-existent users on the hosted domain.

In addition I have read through the relevant documentation again, but I
still can't figure out where or what the problem might be.

Thanks again


postconf -n
alias_maps = hash:/etc/aliases

bounce_template_file = /etc/postfix/bounce.cf

broken_sasl_auth_clients = yes

config_directory = /etc/postfix

delay_warning_time = 4

disable_vrfy_command = yes

inet_interfaces = all

local_recipient_maps = $virtual_mailbox_maps

maximal_queue_lifetime = 15

mydestination = 

myhostname = ntdata.nt-data.dk

mynetworks = 127.0.0.0/8

recipient_canonical_classes = envelope_recipient

recipient_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf,
tcp:127.0.0.1:10002

sender_canonical_classes = envelope_sender

sender_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf,
tcp:127.0.0.1:10001

smtp_tls_security_level = may

smtp_tls_session_cache_database =
btree:$data_directory/smtp_tls_session_cache

smtpd_data_restrictions =
   reject_unauth_pipelining,
   reject_multi_recipient_bounce,
   permit

smtpd_helo_required = yes

smtpd_recipient_restrictions =
   reject_non_fqdn_sender,
   reject_non_fqdn_recipient,
   reject_unknown_sender_domain,
   reject_unknown_recipient_domain,
   reject_rbl_client truncate.gbudb.net,
   reject_unauth_destination,
   permit

smtpd_sasl_auth_enable = yes

smtpd_sasl_exceptions_networks = $mynetworks

smtpd_sasl_path = private/auth

smtpd_sasl_security_options = noanonymous

smtpd_sasl_type = dovecot

smtpd_tls_ask_ccert = yes

smtpd_tls_cert_file = /etc/ssl/self-signed/smtpd.crt

smtpd_tls_key_file = /etc/ssl/self-signed/smtpd.key

smtpd_tls_loglevel = 1

smtpd_tls_received_header = yes

smtpd_tls_security_level = may

smtpd_tls_session_cache_database =
btree:$data_directory/smtpd_tls_session_cache

tls_random_source = dev:/dev/urandom

transport_maps = hash:/etc/postfix/transport.cf

virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains.cf

virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps.cf

virtual_transport = dovecot

Reply via email to