Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am unable to get forwarding to work. Here's my postconf output:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
default_verp_delimiters = +=
disable_verp_bounces = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = jubero.com
myhostname = h2.jubero.com
mynetworks = 78.0.0.0/8, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = 
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions =      permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = no
unknown_local_recipient_reject_code = 550
verp_delimiter_filter = -=+
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-     maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot

When I send an email to bhima@gavika.com, it is bounced:

postfix/pipe[7039]: 013309E0C8: to=<bhima@gavika.com>, relay=dovecot, delay=1, delays=0.92/0/0/0.08, dsn=5.1.1, status=bounced (user unknown)

However, when I query postmap, the forwarding email is printed:

postmap -q bhima@gavika.com mysql:/etc/postfix/mysql-virtual-alias-maps.cf
sudheer@sudheer.net

Delivering to virtual users work just fine. Only forwarding is not working.

How can I correct this?

share|improve this question
    
The log message says dovecot bounced the message, you need to make sure that dovecot knows who the users are as well, or it will not know where to store the mail, and bounce the message. –  NickW Mar 13 '13 at 9:29
    
NickW, storing the email is not required. It just needs to be forwarded to another email. –  Sudheer Mar 13 '13 at 10:19
    
You see the line to=<bhima@gavika.com>, relay=dovecot relay dovecot means that the server thinks the destination is local storage, which is why it passed it to the MDA (dovecot). –  NickW Mar 13 '13 at 10:26
    
From what I understand, the forwarding is done by Postfix and not Dovecot. Correct me if I am wrong. If that is the case, how can I tell Postfix not to send to MDA but to the forward destination? –  Sudheer Mar 13 '13 at 10:29
    
Try adding the smtpd_relay_restrictions line.. –  NickW Mar 13 '13 at 11:00
show 4 more comments

2 Answers

I fixed this by removing:

receive_override_options

The option was originally added to avoid double delivery of emails that went through the SPAM filter. It was making forwarding impossible.

share|improve this answer
    
Cool, never seen that option used before, I'll read up on it. –  NickW Mar 14 '13 at 12:06
add comment

You need to tell postfix what methods are valid for people who want to relay through your server. A line like this will go a long way towards resolving your problems.

 smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

Read more here

share|improve this answer
    
I tried adding that line and there were no changes. Perhaps, I have to clarify the situation. I have setup a MySQL table, virtual_aliases. In that MySQL table, I have the source and destination email columns. In the configuration, I have virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2em‌​ail.cf. I am expecting Postfix to read this configuration file and send the forward. Not sure where exactly it is failing. –  Sudheer Mar 13 '13 at 12:21
    
Ah, so you're providing local user to remote user mapping? You probably need to add a virtual_alias_domains map, the virtual_mailbox_domains file is for local virtual domains only, unless you then change the transport in transport maps. –  NickW Mar 13 '13 at 12:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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