Loading ...
Sorry, an error occurred while loading the content.

virtual_alias_maps differs between internal and externally hosted domains

Expand Messages
  • Michiel Hazelhof
    Hi , I use virtual_alias_maps with a mysql server to manage aliases and catch-all accounts. For the past few years this approach worked like a charm, but after
    Message 1 of 3 , Mar 5, 2013
    • 0 Attachment
      Hi ,

      I use virtual_alias_maps with a mysql server to manage aliases and
      catch-all accounts.
      For the past few years this approach worked like a charm, but after
      upgrading to 2.10 I get two different behaviours.

      When mailing from a domain to a domain both hosted on this server, the
      virtual_alias_maps behave correctly.
      When mailing from a domain on a different server to one hosted on my
      server the alias lookup fails (the message gets through when the actual
      user exists).

      MySQL log when the email is received from any external mailserver:

      130305 21:48:54 283 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='hazelhof.nl' LIMIT 1
      284 Query SELECT 1 FROM `virtual_domains` WHERE
      name='hazelhof.nl' LIMIT 1
      297 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='info@...' LIMIT 1
      297 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='@...' LIMIT 1
      282 Query SELECT '/var/mail/hazelhof.nl/alias' AS
      `home`, 5000 AS `uid`, 5000 AS `gid`, CONCAT('*:bytes=', quota_kb) AS
      `quota_rule` FROM `virtual_users` WHERE `email` = 'alias@...'
      LIMIT 1

      which results in a reject, Mail.log: Mar 5 21:55:30 black-mail
      postfix/smtpd[19444]: NOQUEUE: reject: RCPT from
      domain.nl[2a00:d10:101::26:0]: 554 5.7.1 <alias@...>: Recipient
      address rejected: Unknown user; from=<info@...>
      to=<alias@...> proto=ESMTP helo=<domain.nl>

      MySQL log when mailing from an internal domain
      130305 21:48:23 283 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='hazelhof.nl' LIMIT 1
      284 Query SELECT 1 FROM `virtual_domains` WHERE
      name='hazelhof.nl' LIMIT 1
      307 Connect provider@localhost on provider
      307 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='michiel@...' LIMIT 1
      307 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='@...' LIMIT 1
      308 Connect provider@localhost on provider
      308 Query SELECT `email` FROM `virtual_users`
      WHERE email='michiel@...' LIMIT 1
      307 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='alias@...' LIMIT 1
      307 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='@...' LIMIT 1
      283 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='hazelhof.nl' LIMIT 1
      284 Query SELECT 1 FROM `virtual_domains` WHERE
      name='hazelhof.nl' LIMIT 1
      290 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='alias@...' LIMIT 1
      290 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='@...' LIMIT 1
      290 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='postmaster@...' LIMIT 1
      290 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='postmaster' LIMIT 1
      290 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='@...' LIMIT 1
      283 Query SELECT `destination` FROM
      `virtual_aliases` WHERE source='black-mail.nl' LIMIT 1
      284 Query SELECT 1 FROM `virtual_domains` WHERE
      name='black-mail.nl' LIMIT 1
      309 Connect provider_spamass@localhost on
      provider_spamassassin
      309 Query set autocommit=1
      309 Query SELECT preference, value FROM userpref
      WHERE username = 'postmaster@...' OR username = '$GLOBAL' OR
      username = CONCAT('%','black-mail.nl') ORDER BY username ASC

      Which results in a correct relay to the postmaster account.

      It appears to me that there are two different lookups being done, have I
      missed something in the 2.10 changelog?
    • Michiel Hazelhof
      Forgot to add the proper postfinger file.
      Message 2 of 3 , Mar 5, 2013
      • 0 Attachment
        Forgot to add the proper postfinger file.
      • Viktor Dukhovni
        ... Nothing in Postfix generates an Unknown user response of any kind (the string Unknown user does not appear in the Postfix source code). Even such a
        Message 3 of 3 , Mar 5, 2013
        • 0 Attachment
          On Tue, Mar 05, 2013 at 11:19:22PM +0100, Michiel Hazelhof wrote:

          > which results in a reject, Mail.log: Mar 5 21:55:30 black-mail
          > postfix/smtpd[19444]: NOQUEUE: reject: RCPT from
          > domain.nl[2a00:d10:101::26:0]: 554 5.7.1 <alias@...>:
          > Recipient address rejected: Unknown user; from=<info@...>
          > to=<alias@...> proto=ESMTP helo=<domain.nl>

          Nothing in Postfix generates an "Unknown user" response of any kind
          (the string "Unknown user" does not appear in the Postfix source
          code). Even such a string were returned it would not be with a
          "5.7.1" DSN code, which indicates site policy not address validity.
          Perhaps you have a milter or policy service that generates this
          response.

          --
          Viktor.
        Your message has been successfully submitted and would be delivered to recipients shortly.