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 [email protected] local@localhost ********************************************************** /etc/postfix/sender_relay [email protected] [10.0.0.202]:52345 ********************************************************** /etc/postfix/sasl_password [email protected] username:password ********************************************************** Now I send one email to '[email protected]' 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=<[email protected]> Apr 29 14:46:54 mx postfix/qmgr[21672]: 3408B6A0065: from=<[email protected]>, 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=<[email protected]>, 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 [email protected] 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 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> 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 '[email protected]' ,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 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> 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 [email protected] ,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: > [email protected] local@localhost > >> 2. email arrives from [email protected] to [email protected] >> (excluding '[email protected]') ,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 >
