2014-11-25 4 views
1

하나의 보내는 주소에서 다른 gmail 계정을 사용하고 다른 모든 사람은 기본 gmail 계정을 사용하고 싶습니다. 대부분의 자습서가 온라인이 일을해야한다고하지만, 후위는 모든 이메일에 대한 기본 SMTP 사용자 이름과 암호를 사용하기 때문에후위 보낸 사람 종속 릴레이 호스트

...

은 도움이 될 수 있습니다 후위에 대한 모든 문서가 있습니까? 보낸 사람 종속 tls 암호화도 옵션이 아닌 것으로 보입니다 ... 내가 틀렸습니까?

### main.cf ### 
relayhost = smtp.gmail.com:587 
smtp_sasl_auth_enable=yes 
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password 
sender_dependent_relayhost_maps=/etc/postfix/senderDependentRelayHostMap 

smtp_use_tls = yes 
smtp_sasl_security_options = noanonymous 
smtp_sasl_tls_security_options = noanonymous 
smtp_tls_note_starttls_offer = yes 
smtp_tls_... 

### senderDependentRelayHostMap ### 
[email protected] smtp.gmail.com:587 

### sasl_password ### 
#per sender email stmp username and password 
[email protected] [email protected]:testPass 
#default route 
smtp.gmail.com:587 [email protected]:defaultPass 

답변

1

Postfix에 Sender-Dependent SASL authentication을 구성해야합니다. 당신의 main.cf

#/etc/postfix/main.cf  
#... 
smtp_sender_dependent_authentication = yes 
smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = regexp:/etc/postfix/sasl_passwd 
relayhost = smtp.gmail.com:587 
smtp_tls_security_level = may 
smtp_sasl_security_options = 
#... 

에 다음 줄을 추가하고 다음과 같은 내용으로 /etc/postfix/sasl_passwd을 만드십시오.

/^[email protected]$/ [email protected]:testPass 
/^/     [email protected]:defaultPass 

리로드 포스트 픽스.

당신이

echo "Hi Everyone"|mail -s "Test email" -r "[email protected]" [email protected] 

다음 명령을 사용하여 [email protected]에서 [email protected]에게 메일을 보낼 경우 후위 서버가 /etc/postfix/sasl_passwd 구성 [email protected]의 암호를 사용하여 인증합니다. 다른 사람이 보낸 메일은 사용하여 인증합니다 [email protected]:defaultPass

참조 : 도움이 Postfix docs

희망.

+0

테스트 계정에서 보낼 수는 있지만 기본 전자 메일 계정의 다른 모든 전자 메일은 무기한으로 배달 대기 중입니다. 나는 필요에 따라 gmail이나 yahoo에서 보낼 수있는 유연성 (발신자에 의존하는 릴레이 호스트)을 원했지만 필요하지는 않습니다. – user3338098