On Thu, Jan 15, 2015 at 07:25:58AM +0100, Arnaud Jayet wrote:

> Here is part of my main.cf file:
> 
> smtpd_recipient_restrictions =
> check_recipient_access hash:/etc/postfix/users_hold_mail_migration_zimbra,
> check_recipient_access 
> proxy:mysql:/etc/postfix/users_hold_mail_migration_zimbra.mysql,
>    permit_sasl_authenticated,
>    permit_mynetworks,
>    reject_unauth_destination,
> 
> # postconf -d | grep proxy_read_maps
> proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
> $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
> $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
> $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
> $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps
> $alias_maps

> Jan 15 07:01:57 mx1 postfix/proxymap[13590]:
>   warning: request for unapproved table:
>   "mysql:/etc/postfix/users_hold_mail_migration_zimbra.cf"
>
> Jan 15 07:01:57 mx1 postfix/proxymap[13590]:
>   warning: to approve this table for read-only access,
>   list proxy:mysql:/etc/postfix/users_hold_mail_migration_zimbra.cf
>   in main.cf:proxy_read_maps
>
> Jan 15 07:01:57 mx1 postfix/smtpd[13589]:
>   fatal: proxymap service is not configured for table
>   "mysql:/etc/postfix/users_hold_mail_migration_zimbra.cf"

I am guessing English is a 'second language' for you.  The error
messages above are remarkably precise as to the nature of the
problem, and what you should do.  Specifically:

Append the new table to proxy_read_maps (list it in proxy_read_maps
as instructed in the log message):

    # postconf -e "$(postconf proxy_read_maps), 
proxy:mysql:/etc/postfix/users_hold_mail_migration_zimbra.mysql"

Finally, I strongly recommend against "HOLD" in smtpd_restrictions
for your migration use-case.  It is flawed in multiple ways:

    * Holds too much mail, when messages have multiple recipients. some
      of whom are not being migrated.

    * Fails to hold mail where the target user receives the mail via an
      alias or list.

    * Makes it difficult to release mail in a safe way, requiring careful
      manual manipulation of the HOLD queue.

Instead, configure per-user transport entries with "defer" as the transport:

    main.cf:
        # Use MySQL if you like
        #
        transport_maps = some:table

    # Logical content, possible in a database of some sort
    #
    transport:
        # Make sure to cover all domains for which the user receives mail
        # after rewriting (not aliases, rewritten addresses ready for delivery).
        #
        joe.u...@example.com    retry:4.2.1 Mailbox maintenance in progress

See:

    http://tools.ietf.org/html/rfc3463#section-3.3
    http://www.postfix.org/error.8.html

By using transport_maps not only do you avoid all the problems with
HOLD, but you also don't need to customize proxy_read_maps, because
$transport_maps is there by default.

Plus mail is delivered automatically, once the table entry is removed.
You can optionally enable or disable delay notices to suit your
taste.

    http://www.postfix.org/postconf.5.html#delay_warning_time

-- 
        Viktor.

Reply via email to