1 (edited by zhenchen6 2015-12-25 23:03:59)

Topic: Backup MX or how to add second 'myhostname' in postfix conf?!

====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Debian 7.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Apache
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====
Hello everyone. The situation is as follows: I have 2 ISP and one main domain, eg: mydomain.com and 2 dns records for, one of which records a higher priority than the other. When one domain is available, starts a second domain.

mail   A  11.22.33.44
mail2   A  55.66.77.99
@      MX     0     mail
@      MX     1     mail2

Then the first isp down, i perform the following command:

postconf -e myhostname=mail2.mydomain.com
service postfix reload

..and mail starts on the second channel.

Is it possible to automate this process without scripts, where postfix switched to rezerv when the main provider is not running?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Backup MX or how to add second 'myhostname' in postfix conf?!

zhenchen6 wrote:

Then the first isp down, i perform the following command:
postconf -e myhostname=mail2.mydomain.com
service postfix reload
..and mail starts on the second channel.

I feel my English is too poor to understand your post. sad

*) What do you mean "first isp down"? mail server down?
*) Performing command ("postconf -e") on your server? but 'myhostname=' is used as HELO identity, it doesn't impact mail delivery at all. So, what's your purpose here? Did you forget to attach other commands?
*) What do you mean "mail starts on the second channel"?
*) "... postfix switched to rezerv ...", what's "rezerv"?

Just a guess, maybe you need Postfix setting "smtp_fallback_relay", but i'm not sure because i don't understand your issue and request: http://www.postfix.org/postconf.5.html# … back_relay

According to your forum username, seems you're a Chinese, if yes, then please just write in Chinese. smile

3 (edited by zhenchen6 2015-12-26 22:22:34)

Re: Backup MX or how to add second 'myhostname' in postfix conf?!

ZhangHuangbin wrote:
zhenchen6 wrote:

Then the first isp down, i perform the following command:
postconf -e myhostname=mail2.mydomain.com
service postfix reload
..and mail starts on the second channel.

I feel my English is too poor to understand your post. sad

*) What do you mean "first isp down"? mail server down?
*) Performing command ("postconf -e") on your server? but 'myhostname=' is used as HELO identity, it doesn't impact mail delivery at all. So, what's your purpose here? Did you forget to attach other commands?
*) What do you mean "mail starts on the second channel"?
*) "... postfix switched to rezerv ...", what's "rezerv"?

Just a guess, maybe you need Postfix setting "smtp_fallback_relay", but i'm not sure because i don't understand your issue and request: http://www.postfix.org/postconf.5.html# … back_relay

According to your forum username, seems you're a Chinese, if yes, then please just write in Chinese. smile

Sorry for my English too!)

The configuration of my Internet gateway involves two wans: wan 1 - first isp (11.22.33.44), wan2 - second isp (55.66.77.99)

| mean, that when the first internet provider is not available (unreachable), automatically starts the second provider and all servers, including email server work through the second provider, but only to send e-mail. To receive mail on the mail server must be configured mx record on DNS server. I have done it, but that would Iredmail server was able to receive mail from the second domain mail2.mydomain.com (wan2) in the settings of Postfix we have to change the parameter myhostname to mail2.mydomain.com. Аt least for me, it works.

- "first isp down"? mail server down?" - The Main internet provider (wan1) is unreachable and mail server begins to work through the second provider, only for sending, until not configured to receive mail from a second provider.

- Only these commands changing the parameter "myhostname=mail.mydomain.com"

- "second channel" - second isp wan2.

- "postfix switched to rezerv" - sorry a typo from the word - reserve, redundancy, backup channel. That is going to receive mail through the reserve channel.

- On that link http://www.postfix.org/postconf.5.html# … back_relay you sent, will see it, but still do not understand how to use it.

- No, I'm not Chinese, just a nickname smile