Hello Here're the changed config files :
/etc/postfix/main.cf myhostname = mx.domain.com myorigin = /etc/mailname mailbox_command = procmail -a "$EXTENSION" virtual_alias_maps = hash:/etc/postfix/virtual mydestination = $myhostname localhost.$mydomain localhost $mydomain relayhost = [10.0.0.202]:52345 smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd ********************************************************** /etc/postfix/virtual lo...@domain.com local@localhost ********************************************************** /etc/postfix/sender_relay zubacdra...@gmail.com [10.0.0.202]:52345 ********************************************************** /etc/postfix/sasl_password zubacdra...@gmail.com username:password ********************************************************** Now I send one email to 'lo...@domain.com' and it get delivered : Apr 29 14:46:54 mx postfix/smtpd[21720]: connect from f2zubac.test.com[10.0.0.250] Apr 29 14:46:54 mx postfix/smtpd[21720]: 3408B6A0065: client=f2zubac.test.com[10.0.0.250] Apr 29 14:46:54 mx postfix/cleanup[21724]: 3408B6A0065: message-id=<4dbac12e.10...@test.com> Apr 29 14:46:54 mx postfix/qmgr[21672]: 3408B6A0065: from=<f2zu...@test.com>, size=919, nrcpt=1 (queue active) Apr 29 14:46:54 mx postfix/smtpd[21720]: disconnect from f2zubac.test.com[10.0.0.250] Apr 29 14:46:54 mx postfix/local[21725]: 3408B6A0065: to=<f2zubac@localhost>, orig_to=<lo...@domain.com>, relay=local, delay=0.33, delays=0.26/0.01/0/0.06, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION") Apr 29 14:46:54 mx postfix/qmgr[21672]: 3408B6A0065: removed one email to noex...@domain.com and get rejected as expected : Apr 29 14:48:42 mx postfix/smtpd[22073]: connect from f2zubac.test.com[10.0.0.250] Apr 29 14:48:42 mx postfix/smtpd[22073]: NOQUEUE: reject: RCPT from f2zubac.test.com[10.0.0.250]: 550 5.1.1 <noexist...@domain.com>: Recipient address rejected: User unknown in local recipient table; from=<f2zu...@test.com> to=<noexist...@domain.com> proto=ESMTP helo=<f2zubac.test.com> Apr 29 14:48:42 mx postfix/smtpd[22073]: disconnect from f2zubac.test.com[10.0.0.250] and now one email from 'zubacdra...@gmail.com' ,should be relayed to [10.0.0.202]:52345: Apr 29 14:50:41 mx postfix/smtpd[22394]: connect from mail-fx0-f51.google.com[209.85.161.51] Apr 29 14:50:41 mx postfix/smtpd[22394]: NOQUEUE: reject: RCPT from mail-fx0-f51.google.com[209.85.161.51]: 550 5.1.1 <nolo...@routo-messaging.com>: Recipient address rejected: User unknown in local recipient table; from=<zubacdra...@gmail.com> to=<nolo...@routo-messaging.com> proto=ESMTP helo=<mail-fx0-f51.google.com> Apr 29 14:50:41 mx postfix/smtpd[22394]: disconnect from mail-fx0-f51.google.com[209.85.161.51] Shouldn't last email be forwarded to [10.0.0.202]:52345,since it is specified in /etc/postfix/sender_relay ? Sincerely On 04/29/11 14:26, Wietse Venema wrote: > Dragan Zubac: >> Hello >> >> I'm trying to achieve the following : >> >> 1. email arrives to lo...@domain.com ,should be delivered locally to >> account local > /etc/postfix/main.cf: > virtual_alias_maps = hash:/etc/postfix/virtual > # DO NOT LIST domain.com IN VIRTUAL_ALIAS_DOMAINS > # DO NOT LIST domain.com IN VIRTUAL_MAILBOX_DOMAINS > # DO NOT LIST domain.com IN MYDESTINATION > mydestination = $myhostname localhost.$mydomain localhost ... > > /etc/postfix/virtual: > lo...@domain.com local@localhost > >> 2. email arrives from anyth...@anything.com to anyth...@domain.com >> (excluding 'lo...@domain.com') ,the email should be forwarded to remote >> smtp ([10.0.0.202]:52345) using user/pass from sasl_passwd file > /etc/postfix/main.cf: > relayhost = [10.0.0.202]:52345 > > Wietse >