Postfix가 다른 IP 주소를 사용하게하는 방법? 서버가 사용하는 것보다

Postfix 메일 서버를 사용하고 있으며 6 개의 IP를 사용할 수 있습니다. 웹 서버가 사용하는 것보다 Postfix 메일 서버에 다른 IP를 사용하여 메일을 보내려고합니다.

어떻게해야합니까? 내 접미사 버전은 2.3.3입니다.

예 : 기본 IP : 66.66.66.66 기타 IP : 66.66.66.67



답변

당신이 원하는 smtp_bind_address=66.66.66.67inet_interfaces=all또는 inet_interfaces=eth(whatever)66.66.66.67가 켜져 있는지.

변경 후 postfix를 중지 / 시작하십시오. 변경중인 경우 다시로드 할 수 없습니다inet_interfaces


답변

“smtp_bind_address”솔루션을 사용하는 경우 메일 서버는 지정된 IP 주소에서만 수신 메일을 수신합니다. “inet_interfaces”솔루션에도 동일하게 적용됩니다. 여러 IP 주소 / 인터페이스에서 들어오는 메일을 수신하려는 경우에는 원하는 해결 방법이 아닐 수 있습니다.

기본 “smtp_bind_address”및 “inet_interfaces”설정을 변경하지 말 것을 권장하므로 메일 서버는 모든 IP 주소에서 들어오는 메일을 계속 수신합니다.

/etc/postfix/master.cf 파일을 약간만 변경하면됩니다.

이 부분을 변경하십시오.

smtp 유닉스-----smtp
# 메일을 백업 MX로 릴레이 할 때 MX 루프를 피하기 위해 fallback_relay를 비활성화하십시오
릴레이 유닉스-----SMTP
        -o smtp_fallback_relay =

이에:

smtp 유닉스-----smtp
        -o smtp_bind_address = 192.168.0.1
# 메일을 백업 MX로 릴레이 할 때 MX 루프를 피하기 위해 fallback_relay를 비활성화하십시오
릴레이 유닉스-----SMTP
        -o smtp_bind_address = 192.168.0.1
        -o smtp_fallback_relay =

물론 192.168.0.1 대신 메일을 보내려는 IP 주소 중 하나를 사용해야합니다.

졸탄


답변

master.cf

다른 인터페이스를 만듭니다. 각 도메인 당 하나씩 :

rotate1  unix -       -       n       -       -       smtp
          -o syslog_name=postfix-rotate1
          -o smtp_helo_name=domainone.com.br
          -o smtp_bind_address=173.111.111.1

rotate2  unix -       -       n       -       -       smtp
          -o syslog_name=postfix-rotate2
          -o smtp_helo_name=domaintwo.com.br
          -o smtp_bind_address=173.111.111.2

main.cf

  1. 다른 모든 전송 맵을 비활성화하십시오. 예 : # transport_maps = xxxxx

  2. 종속 전송 맵 사용 (접미사 2.7.x 이상 필요)

sender_dependent_default_transport_maps = mysql : /etc/postfix/config/transport_random_dependent.cf

transport_random_dependent.cf

예:

user = postfix
password = mypassword
dbname = postfixdb
hosts = localhost
query = SELECT transport FROM transport_random WHERE domain = '%d' AND status='1' ORDER BY RAND() LIMIT 1

테이블 transport_random

Column "transport" = rotate1, rotate2, rotate3, rotate4 (etc)
Column "domain" = sender domains (replaced by %d)
Column "status" = boolean (0 or 1) if is enabled the transport.

“RAND () LIMIT 1″명령은 동일한 도메인에 대해 임의의 전송을 사용하려는 경우에만 필요합니다.

예를 들어, mydomain.com에서 3 개의 다른 IP를 보내려고합니다.

그런 다음 3 개의 다른 IP로 3 개의 전송 (rotate1, rotate2 및 rotate3)을 만든 다음 mysql 줄을 설정하십시오.

transport = rotate1 | domain = mydomain.com
transport = rotate2 | domain = mydomain.com
transport = rotate3 | domain = mydomain.com

그런 다음 postfix가이 이메일을 보내기 위해 3 개의 다른 전송 (1 ~ 3 개 회전)을 무작위로 지정할 때.


답변

/etc/postfix/main.cf를 편집하고 다음 줄이 있는지 확인하십시오

inet_interfaces = 66.66.66.67, localhost

그런 다음 “postfix reload”를 실행하십시오.