Eu tenho um servidor rodando o Postfix / Dovecot com um backend do MySQL que é configurado para usar o nome de domínio 'olddomain.com'. Estou migrando tudo para usar outro domínio 'newdomain.com' e Postfix / Dovecot / Postfixadmin, todos precisam ser migrados também. No entanto, eu preciso dar suporte a ambos os nomes de domínio por um tempo e isso deve ser transparente para os usuários. E-mails enviados para '[email protected]' precisam chegar a '[email protected]', os usuários precisam fazer login (Postfixadmin / Dovecot) com '[email protected]' e 'username @ newdomain .com ', etc.
Não consigo descobrir como fazer isso para dar suporte aos casos de uso nomeados, portanto, qualquer ajuda seria bem-vinda.
Material de configuração relevante:
postconf -n
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
dovecot_destination_recipient_limit = 1
html_directory = no
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains = mysql:/etc/postfix/mysql_relay_domain_maps.cf
relayhost = *******
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/sql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/sql_virtual_domain_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/sql_virtual_mailbox_maps.cf
virtual_transport = dovecot
sql_virtual_mailbox_maps.cf:
password = ****
hosts = localhost
dbname = pf_adm
query = SELECT CONCAT(maildir, 'Maildir/') AS maildir FROM mailbox WHERE username='%s' AND active = '1'
sql_virtual_domain_maps.cf:
user = ****
password = ****
hosts = localhost
dbname = pf_adm
query = SELECT domain FROM domain WHERE domain='%s' AND backupmx = '0' AND active = '1'
sql_virtual_alias_maps.cf:
user = ****
password = ****
hosts = localhost
dbname = pf_adm
query = SELECT goto FROM alias WHERE address='%s' AND active = '1'
doveconf -n
# 2.1.9: /etc/dovecot/dovecot.conf
# OS: Linux 3.4.5-hardened i686 Gentoo Base System release 2.1 ext4
auth_verbose = yes
first_valid_gid = 12
first_valid_uid = 8
last_valid_gid = 12
last_valid_uid = 8
mail_gid = 12
mail_location = maildir:/var/mail/%d/%n/Maildir/:INDEX=/var/mail/%d/%n/indexes
mail_uid = 8
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
postmaster_address = [email protected]
protocols = imap
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = mail
mode = 0600
user = mail
}
}
ssl_cert =
Bonus info (if needed), users are stored like this:
+------------------------+-------------------------+------------+---------------+
| username | maildir | local_part | domain |
+------------------------+-------------------------+------------+---------------+
| [email protected] | olddomain.com/username/ | username | olddomain.com |
+------------------------+-------------------------+------------+---------------+