From: Sven Strickroth on
Hi,

I've a server with multiple ip addresses (all dial-in). But only one
static ip-address. So if the static ip line is down postfix prints out
"warning: smtp_connect_addr: bind x.x.x.x: Cannot assign requested
address" and uses the other (dynamic) ip for sending.

Is it possible to tell postfix not to send mails if the
smtp_bind_address is not available?

--
Best regards,
Sven mailto:sven(a)clamav.net
ClamAV, a GPL anti-virus toolkit http://www.clamav.net

From: Stan Hoeppner on
Sven Strickroth put forth on 9/25/2009 7:43 PM:
> Hi,
>
> I've a server with multiple ip addresses (all dial-in). But only one
> static ip-address. So if the static ip line is down postfix prints out
> "warning: smtp_connect_addr: bind x.x.x.x: Cannot assign requested
> address" and uses the other (dynamic) ip for sending.
>
> Is it possible to tell postfix not to send mails if the
> smtp_bind_address is not available?

http://www.postfix.org/postconf.5.html#smtp_bind_address

smtp_bind_address (default: empty)

An optional numerical network address that the Postfix SMTP client
should bind to when making an IPv4 connection.

This can be specified in the main.cf file for all SMTP clients, or
it can be specified in the master.cf file for a specific client, for
example:

/etc/postfix/master.cf:
smtp ... smtp -o smtp_bind_address=11.22.33.44

Note 1: when inet_interfaces specifies no more than one IPv4
address, and that address is a non-loopback address, it is automatically
used as the smtp_bind_address. This supports virtual IP hosting, but can
be a problem on multi-homed firewalls. See the inet_interfaces
documentation for more detail.

Note 2: address information may be enclosed inside [], but this form
is not required here.


From: Sven Strickroth on
Am 26.09.2009 03:40 schrieb Stan Hoeppner:
>> Is it possible to tell postfix not to send mails if the
>> smtp_bind_address is not available?
>
> http://www.postfix.org/postconf.5.html#smtp_bind_address

You only pasted the docs here, but my problem isn't described there (or
I don't get it).

My system is configured so that it correctly uses the smtp_bind_address,
but when the specified smtp_bind_address is not available postfix binds
to some other ip to send mail (instead of keeping it until the ip is
available again).

--
Best regards,
Sven mailto:sven(a)clamav.net
ClamAV, a GPL anti-virus toolkit http://www.clamav.net

From: Stan Hoeppner on
Sven Strickroth put forth on 9/25/2009 8:49 PM:
> Am 26.09.2009 03:40 schrieb Stan Hoeppner:
>>> Is it possible to tell postfix not to send mails if the
>>> smtp_bind_address is not available?
>> http://www.postfix.org/postconf.5.html#smtp_bind_address
>
> You only pasted the docs here, but my problem isn't described there (or
> I don't get it).
>
> My system is configured so that it correctly uses the smtp_bind_address,
> but when the specified smtp_bind_address is not available postfix binds
> to some other ip to send mail (instead of keeping it until the ip is
> available again).

Provide 'postconf -d' output please.

--
Stan



From: Victor Duchovni on
On Sat, Sep 26, 2009 at 02:43:35AM +0200, Sven Strickroth wrote:

> Is it possible to tell postfix not to send mails if the
> smtp_bind_address is not available?

Not without source code changes:

src/smtp/smtp_connect.c:smtp_connect_addr()
...
if (bind(sock, res0->ai_addr, res0->ai_addrlen) < 0)
msg_warn("%s: bind %s: %m", myname, bind_addr);

so failure to bind the requested address is logged, but is not fatal.
Why does the address get de-configured? You should be able to bind
it provided the interface is administratively up, even if it is not
working.

--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majordomo(a)postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.