HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Postfix Multiple IP's (http://www.howtoforge.com/forums/showthread.php?t=52022)

guimnk 25th March 2011 02:54

Postfix Multiple IP's
 
Hi all..

I've a mail marketing system running in ISPConfig..

Thats ok, ISPConfig is very fast..

But I need to make my postfix to change IP/hostname while send the list of e-mails.

It's possible? Is necessary to run another instance of postfix? How can I do to use more SMTP's (ips/hostnames) in the same ispconfig server?

till 25th March 2011 11:23

The IP that postfix uses is set with the parameter smtp_bind_address in the postfix main.cf file. You can e.g. change the IP there and then restart postfix.

guimnk 25th March 2011 17:45

Ok Till, but I could put it in cron to restart postfix and change this parameter? I'll have a problems with items scheduled?

till 25th March 2011 20:03

Yes, you can put that into cron.

Quote:

I'll have a problems with items scheduled?
I dont think so, asl all mails get kept in the queue.

guimnk 25th March 2011 22:18

Ok Till..

What the difference between inet_interfaces and smtp_bind_address ?

If I input all ip's in inet_interfaces parameter, fix my solicitation?

I read about master.cf parameters:

Code:

192.168.0.1:smtp      inet  n      -      -      -      -      smtpd
If I input in master.cf all ip's fix the my solicitation?

falko 26th March 2011 16:56

inet_interfaces:

Quote:

The network interface addresses that this mail system receives mail on. Specify "all" to receive mail on all network interfaces (default), and "loopback-only" to receive mail on loopback network interfaces only (Postfix version 2.2 and later). The parameter also controls delivery of mail to user@[ip.address].

Note 1: you need to stop and start Postfix when this parameter changes.

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

When inet_interfaces specifies just one IPv4 and/or IPv6 address that is not a loopback address, the Postfix SMTP client will use this address as the IP source address for outbound mail. Support for IPv6 is available in Postfix version 2.2 and later.

On a multi-homed firewall with separate Postfix instances listening on the "inside" and "outside" interfaces, this can prevent each instance from being able to reach servers on the "other side" of the firewall. Setting smtp_bind_address to 0.0.0.0 avoids the potential problem for IPv4, and setting smtp_bind_address6 to :: solves the problem for IPv6.

A better solution for multi-homed firewalls is to leave inet_interfaces at the default value and instead use explicit IP addresses in the master.cf SMTP server definitions. This preserves the Postfix SMTP client's loop detection, by ensuring that each side of the firewall knows that the other IP address is still the same host. Setting $inet_interfaces to a single IPv4 and/or IPV6 address is primarily useful with virtual hosting of domains on secondary IP addresses, when each IP address serves a different domain (and has a different $myhostname setting).

See also the proxy_interfaces parameter, for network addresses that are forwarded to Postfix by way of a proxy or address translator.

Examples:

inet_interfaces = all (DEFAULT)
inet_interfaces = loopback-only (Postfix version 2.2 and later)
inet_interfaces = 127.0.0.1
inet_interfaces = 127.0.0.1, [::1] (Postfix version 2.2 and later)
inet_interfaces = 192.168.1.2, 127.0.0.1

smtp_bind_address:

Quote:

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.

guimnk 29th March 2011 01:19

Falko and Till..

I create a script to change the value of "smtp_bind_address" every minute. But, when I set this parameter on main.cf, I get this message:

Code:

Mar 28 19:14:04 turbo amavis[16754]: (16754-08) (!)DENIED ACCESS from IP 187.x.x.15, policy bank ''
Mar 28 19:14:04 turbo postfix/smtp[17458]: 4EFAB50C16F4: to=<xxxxxxx@hotmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.1, delays=0.09/0.01/0/0, dsn=4.4.2, status=deferred (lost connection with 127.0.0.1[127.0.0.1] while receiving the initial server greeting)

What is this??

Thanks

skangraf 31st March 2011 10:49

Quote:

Originally Posted by guimnk (Post 254222)
Falko and Till..

I create a script to change the value of "smtp_bind_address" every minute. But, when I set this parameter on main.cf, I get this message:

Code:

Mar 28 19:14:04 turbo amavis[16754]: (16754-08) (!)DENIED ACCESS from IP 187.x.x.15, policy bank ''
Mar 28 19:14:04 turbo postfix/smtp[17458]: 4EFAB50C16F4: to=<xxxxxxx@hotmail.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.1, delays=0.09/0.01/0/0, dsn=4.4.2, status=deferred (lost connection with 127.0.0.1[127.0.0.1] while receiving the initial server greeting)

What is this??

Thanks

In Amavis configuration file You have to add IP which is blocked. For example
Debian 6.0
/etc/amavis/conf.d/05-domain - add line

@inet_acl = qw( 127.0.0.1 [::1] 187.x.x.15/32);

next restart amavis service, and should working.
I'm not sure is it correct, but in my case it's working..

guimnk 31st March 2011 15:57

Hi skangraf, thanks for reply..

When I insert:

Code:

@inet_acl = qw( 127.0.0.1 [::1] 187.x.x.0/24);
The parameter

Code:

smtp_bind_address = 187.x.x.28
is ignored...

Why??

Thanks..

skangraf 31st March 2011 17:24

Quote:

Originally Posted by guimnk (Post 254391)
Hi skangraf, thanks for reply..

When I insert:

Code:

@inet_acl = qw( 127.0.0.1 [::1] 187.x.x.0/24);
The parameter

Code:

smtp_bind_address = 187.x.x.28
is ignored...

Why??

Thanks..

Try to add to main.cf

smtp_bind_addres = 187.x.x.28 127.0.0.1

and I'm not sure but Your @inet_acl line should be as follow

@inet_acl = qw( 127.0.0.1 [::1] 187.x.x.28/32);
or
@inet_acl = qw( 127.0.0.1 [::1] 187.x.x.28);

Don't forget restart Postfix and amavis service


All times are GMT +2. The time now is 23:04.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.