From: Shameem Ahamed on
Hi All,


I have a normal postfix setup with a external content filtering(amavis). I want to skip content filtering for some domains and send through a different IP.

In my main.cf I have

smtpd_sender_restriction =
check_sender_access hash:/etc/postfix/access.cf

Where access.cf contains the below line

example.com FILTER csmtp:127.0.0.1

cstmp is a clone of smtp, and the corresponding entry in master.cf is

csmtp unix - - n - 300 smtp -o smtp_bind_address=172.16.141.29


But when i try to send mail, I am getting connection refused error in logs.

Log entries are

Jan 2 03:20:18 postfix-test1 postfix/smtpd[29051]: NOQUEUE: filter: RCPT from unknown[172.16.134.61]: <user1(a)example.com>: Sender address triggers FILTER csmtp:127.0.0.1; from=<user1(a)example.com> to=<user2(a)domain.com> proto=SMTP
Jan 2 03:20:18 postfix-test1 postfix/smtpd[29051]: 9F0EA31F01EE: client=unknown[172.16.134.61]
Jan 2 03:20:30 postfix-test1 postfix/cleanup[29060]: 9F0EA31F01EE: message-id=<>
Jan 2 03:20:30 postfix-test1 postfix/qmgr[29048]: 9F0EA31F01EE: from=<user1(a)example.com>, size=192, nrcpt=1 (queue active)
Jan 2 03:20:30 postfix-test1 postfix/smtp[29063]: connect to 127.0.0.1[127.0.0.1]:25: Connection refused
Jan 2 03:20:30 postfix-test1 postfix/smtp[29063]: 9F0EA31F01EE: to=<user2(a)domain.com>, relay=none, delay=22, delays=22/0/0/0, dsn=4.4.1, status=deferred connect to 127.0.0.1[127.0.0.1]:25: Connection refused)


Machine has 2 ips: 172.16.141.29 and 172.16.141.28


Regards,
Shameem



From: Wietse Venema on
Shameem Ahamed:
> smtpd_sender_restriction =
> check_sender_access hash:/etc/postfix/access.cf
>
> Where access.cf contains the below line
>
> example.com FILTER csmtp:127.0.0.1
>
> cstmp is a clone of smtp, and the corresponding entry in master.cf is
>
> csmtp unix - - n - 300 smtp -o smtp_bind_address=172.16.141.29

That won't work when there is no path from 172.16.141.29 to 127.0.0.1.

Wietse

From: Shameem Ahamed on
I tried with

example.com FILTER csmtp:172.16.141.29

But still I have same error

postfix/smtp[10526]: connect to 172.16.141.29[172.16.141.29]:25: Connection refused


Regards,
Shameem
--- On Thu, 10/6/10, Wietse Venema <wietse(a)porcupine.org> wrote:

> From: Wietse Venema <wietse(a)porcupine.org>
> Subject: Re: Mail Delivery Using FILTER in access table
> To: "Postfix users" <postfix-users(a)postfix.org>
> Date: Thursday, 10 June, 2010, 10:23 PM
> Shameem Ahamed:
> >  smtpd_sender_restriction =
> >          check_sender_access
> hash:/etc/postfix/access.cf
> >
> > Where access.cf contains the below line
> >
> > example.com   
>    FILTER  csmtp:127.0.0.1
> >
> > cstmp is a clone of smtp, and the corresponding entry
> in master.cf is
> >
> > csmtp   unix    - 
>      -   
>    n       - 
>      300     smtp -o
> smtp_bind_address=172.16.141.29
>
> That won't work when there is no path from 172.16.141.29 to
> 127.0.0.1.
>
>     Wietse
>



From: Noel Jones on
On 6/10/2010 11:59 AM, Shameem Ahamed wrote:
> I tried with
>
> example.com FILTER csmtp:172.16.141.29
>
> But still I have same error
>
> postfix/smtp[10526]: connect to 172.16.141.29[172.16.141.29]:25: Connection refused

The FILTER destination must accept mail. smtp is for sending
mail.


-- Noel Jones

From: Shameem Ahamed on
So, is there any way to send mail using a different IP, other than running a separate postfix instance.

Regrads,
Shameem

--- On Thu, 10/6/10, Noel Jones <njones(a)megan.vbhcs.org> wrote:

> From: Noel Jones <njones(a)megan.vbhcs.org>
> Subject: Re: Mail Delivery Using FILTER in access table
> To: postfix-users(a)postfix.org
> Date: Thursday, 10 June, 2010, 10:32 PM
> On 6/10/2010 11:59 AM, Shameem Ahamed
> wrote:
> > I tried with
> >
> > example.com   
>    FILTER  csmtp:172.16.141.29
> >
> > But still I have same error
> >
> > postfix/smtp[10526]: connect to
> 172.16.141.29[172.16.141.29]:25: Connection refused
>
> The FILTER destination must accept mail.  smtp is for
> sending
> mail.
>
>
>    -- Noel Jones
>