0

I have a server with Debian 6 (Squeeze), running Postfix, Dovecot, and using MySQL as the backing store for virtual email accounts.

For my domain example.com, I have a ‘catch-all’ @example.com that forwards to myaccount@gmail.com.

I want to allow an authenticated user to log in as me@example.com to use SMTP (and thus take advantage of SPF validation and DKIM signing), but not allow Postfix to deliver mail sent to me@example.com to Dovecot. Configuring a ‘full’ account in the MySQL database causes this to happen, so far as I can tell.

How can I do this? Am I approaching this in the wrong way?

Abraham Vegh
  • 1,045
  • 5
  • 17
  • 26

1 Answers1

2

Postfix is intelligent enough to not deliver mail to Dovecot if you are forwarding mail for that address.

In practice, this means a minimum of four records are required in the MySQL database:

domains: example.com
forwardings: @example.com -> me@example.com
forwardings: me@example.com -> myaccount@gmail.com
users: me@example.com, somepassword

With this configuration, Postfix will deliver all mail to example.com to myaccount@gmail.com, but still allow me@example.com to log in via SMTP and send outgoing mail, enabling that mail to, e.g. be signed for DKIM.

Abraham Vegh
  • 1,045
  • 5
  • 17
  • 26