I have installed postfix/courier to send and receive mails.

I use roundcube like webmail to watch it.

I have configured postfix with mysql DB, and create contact@mydomain.com address. There is possibility to add alias in SQL table alias, but I don't want to manually add all addresses.

How can I redirect root mails, and xxxxx@mydomain.com mails on contact@mydomain.com, to be able to watch it with roundcube?

I found luser_relay parameter and this blog post

But mail continues to be rejected instead of redirected.

/usr/sbin/postconf -n:

alias_database               = hash:/etc/aliases  
alias_maps                   = hash:/etc/aliases  
append_dot_mydomain          = no  
biff                         = no  
config_directory             = /etc/postfix  
disable_vrfy_command         = yes  
inet_interfaces              = all  
inet_protocols               = all  
local_recipient_maps         =  
luser_relay                  = contact@localhost  
milter_default_action        = accept  
mydestination                = IP, localhost.localdomain, localhost  
myhostname                   = MYdomain.com  
mynetworks                   =  
myorigin                     = MYdomain.com   
recipient_delimiter          = +  
relayhost                    =  
smtpd_banner                 = $myhostname ESMTP $mail_name (Debian/GNU)  
smtpd_client_restrictions    = permit_mynetworks  
smtpd_helo_required          = yes
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, reject_non_fqdn_recipient  
smtpd_sender_restrictions    = permit_mynetworks, warn_if_reject reject_unverified_sender  
virtual_alias_maps           = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_comptes.cf  
virtual_gid_maps             = static:5000  
virtual_mailbox_base         = /var/spool/vmail/  
virtual_mailbox_domains      = mysql:/etc/postfix/mysql-virtual_domaines.cf  
virtual_mailbox_maps         = mysql:/etc/postfix/mysql-virtual_comptes.cf  
virtual_uid_maps             = static:5000
  • You will need to do this with your smtp server i.e postfix and not with roundcube. Can you paste the output of postconf -n to help you better.
    – clement
    Dec 4 '14 at 15:41
  • @clement postconf -n is not a cmd for me. I used the DB of postfix to aliasses mail. But I want redirect all mail sendded to false_adress@mydomain.com to "contact@mydomain.com".
    – Matrix
    Dec 4 '14 at 16:00
  • i didn't get you. You may use DB or any lookup type supported by postfix. your current postfix setting is required to help you on your requirement.postconf -n command will give your postfix settings.
    – clement
    Dec 4 '14 at 16:05
  • @clement you don't understand me^^ $ postconf -n => -bash: postconf: command not found. But if there is a parameter to config default adress mail, don't need other things no?
    – Matrix
    Dec 4 '14 at 16:16
  • it should be /usr/sbin/postconf -n. Can u check if this works?
    – clement
    Dec 4 '14 at 16:44

You dont have to add all addresses you can just add an alias from '@mydomain.com' to 'contact@mydomain.com', but please note that with this parameter every possible mail to any e-mail address is forwarded also if the address is not added into the mailbox maps. So you also receive also spam to all of this addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.