On Mon, Oct 11, 2004 at 10:21:06AM -0500, Bryan Ballard wrote:
> Has anyone found a simple way to have Exim verify that the address it is
> accepting mail for is a valid dbmail email address. I have looked into
> using a query from the aliases table, but if you use any [EMAIL PROTECTED] ->
> user aliases exim can't handle that. I am wondering if a verification
> daemon in dbmail might be the answer. 

You can query for the alias, and if that fails, then query for the
wildcard.  You can do it either in the RCPT acl or in the dbmail router
and use verify = recipient in the acl.

Here's my router:

# Let Exim handle aliases and bounces.  Deliver directly to a dbmail user
# dbmail users are made to look like directories of the form,
# /[EMAIL PROTECTED]/, which is split apart by the transport.
dbmail_alias_or_user:
  driver = redirect
  domains = +dbmail_domains
  data = ${lookup mysql{                                       \
   SELECT                                                      \
    IF(u.user_idnr IS NULL,                                    \
      deliver_to,                                              \
      CONCAT('/', u.userid, '/')                               \
    ) AS mailbox                                               \
    FROM                                                       \
      aliases a                                                \
    LEFT JOIN                                                  \
      users u ON a.deliver_to = u.user_idnr                    \
    WHERE                                                      \
      a.alias = '${quote_mysql:[EMAIL PROTECTED]'           \
  }                                                            \
  {$value}                                                     \
  {                                                            \
    ${lookup mysql{                                            \
     SELECT                                                    \
      IF(u.user_idnr IS NULL,                                  \
        deliver_to,                                            \
        CONCAT('/', u.userid, '/')                             \
      ) AS mailbox                                             \
      FROM                                                     \
        aliases a                                              \
      LEFT JOIN                                                \
        users u ON a.deliver_to = u.user_idnr                  \
      WHERE                                                    \
        a.alias = '${quote_mysql:@$domain}'                    \
    }                                                          \
    {$value}                                                   \
    fail}                                                      \
   }                                                           \
  }
  directory_transport = dbmail_user
  check_ancestor
  no_more


Reply via email to