Postfix는 메일을 보내지 않습니다

Postfix는 메일을 보내지 않습니다

메일 서버에 대해 배우려고 노력 중인데 설정에서 움직이는 모든 부분 때문에 상당히 당황스럽습니다.

현재 내 smtp 서버에서 보낼 수 없습니다. 다양한 도메인에서 메일을 잘 받을 수 있어요.

내 로그에서 메일을 보내려고 할 때 아래 항목이 표시됩니다.

  • 메일.로그
Jul 31 11:59:15 mail postfix/submission/smtpd[1290]: connect from unknown[78.136.22.232]
Jul 31 12:01:03 mail postfix/postscreen[1294]: CONNECT from [209.85.214.179]:46881 to [45.77.139.149]:25
Jul 31 12:01:03 mail postfix/postscreen[1294]: PASS OLD [209.85.214.179]:46881
Jul 31 12:01:03 mail postfix/smtpd[1297]: connect from mail-pl1-f179.google.com[209.85.214.179]
Jul 31 12:01:05 mail postfix/smtpd[1297]: 03178A46: client=mail-pl1-f179.google.com[209.85.214.179]
Jul 31 12:01:05 mail postfix/cleanup[1299]: 03178A46: message-id=<CAMJ_LmbWv_5o7GZJx8RwqOqz52O_sWTrgX0_=mSi_Vt6+uz++Q@mail.gmail.com>
Jul 31 12:01:05 mail postfix/cleanup[1299]: 03178A46: milter-reject: END-OF-MESSAGE from mail-pl1-f179.google.com[209.85.214.179]: 5.7.1 Gtube pattern; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-pl1-f179.google.com>
Jul 31 12:01:05 mail postfix/smtpd[1297]: disconnect from mail-pl1-f179.google.com[209.85.214.179] ehlo=2 starttls=1 mail=1 rcpt=1 data=0/1 quit=1 commands=6/7
Jul 31 12:04:15 mail postfix/submission/smtpd[1290]: timeout after CONNECT from unknown[78.136.22.232]
Jul 31 12:04:15 mail postfix/submission/smtpd[1290]: disconnect from unknown[78.136.22.232] commands=0/0
root@mail:~#

내 OS는 Debian 9이고 이를 테스트하는 동안 모든 iptables 규칙이 플러시되었습니다. 여기 내 master.cf와 main.cf가 있습니다 -->https://pastebin.com/9WUnzYZt

감사해요

편집1: 내가 언급하는 것을 잊어버린 것. 내 main.cf에서 grep 'smtp.*restrict'를 수행했습니다. smtpd_recipient_restrictions가 SQL 파일을 가리키는 것으로 나타났습니다. SQL 파일 자체에 아래와 같은 쿼리가 있습니다. 이것이 메일 발송 실패의 원인이 될 수 있나요?

root@mail:~# grep smtp.*restrict /etc/postfix/main.cf
smtpd_relay_restrictions =      reject_non_fqdn_recipient
smtpd_recipient_restrictions = check_recipient_access mysql:/etc/postfix/sql/recipient-access.cf
smtpd_client_restrictions =     permit_mynetworks
smtpd_helo_restrictions =   permit_mynetworks
smtpd_data_restrictions = reject_unauth_pipelining
root@mail:~# grep query /etc/postfix/sql/recipient-access.cf
query = select if(sendonly = true, 'REJECT', 'OK') AS access from accounts where username = '%u' and domain = '%d' and enabled = true LIMIT 1;
root@mail:~#

편집2:이것이 클라이언트 측 문제인지 배제하기 위해 mutt를 구성했지만 여전히 작동하지 않는 것 같습니다.

└─[$] <> cat muttrc
set folder = "imaps://[email protected]@imap.mydomain.abc:993"
set smtp_url =  "smtp://[email protected]@smtp.mydomain.abc:587"

set from = "[email protected]"
set realname = "hostmaster"

set spoolfile = "+Inbox"
set record = "+Sent"
set trash = "+Trash"
set postponed = "+Drafts"

mailboxes =Inbox =Sent =Trash =Drafts =Junk =Other

하지만 메일을 보내려고 할 때마다 다른 도메인인지 또는 보낸 사람과 동일한 이메일 주소인지에 관계없이 이 오류가 표시됩니다.

SMTP session failed: 451 4.3.0 <[email protected]>: Temporary lookup failure 

답변1

첫 번째 문제: sender-login-maps.cf 파일에 오타가 있었습니다. dbuser를 지정할 때 'user'가 아닌 'ser'라고 말하고 있었습니다.

두 번째 문제: 메일을 보낼 수 있게 된 후 방화벽을 시작했지만 메일 수신이 중단되었습니다. 이는 TCP 25로 들어오는 연결이 차단되었기 때문입니다. 587을 사용하도록 smtpd를 구성한 경우 포트 25를 열 필요가 없다고 생각했기 때문에 이것을 허용하지 않았습니다. 그러나 들어오는 연결의 경우에는 그렇지 않습니다.

이제 메일 설정이 예상대로 작동합니다.

관련 정보