메일서버 관련 게시글 - JooTC https://jootc.com/p/tag/메일서버 Windows, macOS, Linux, IT, 프로그래밍 등 여러가지 테크 분야에 대한 정보와 습득 지식을 포스팅하는 블로그입니다. Tue, 25 Sep 2018 14:11:45 +0000 ko-KR hourly 1 https://jootc.com/wp-content/uploads/2020/06/cropped-jootc-icon-logo-2020-04-1-32x32.png 메일서버 관련 게시글 - JooTC https://jootc.com/p/tag/메일서버 32 32 167838187 리눅스 postfix 25: Network is unreachable 문제 해결하기 https://jootc.com/p/201809251869 https://jootc.com/p/201809251869#respond Tue, 25 Sep 2018 14:11:45 +0000 https://blog.inidog.com/?p=1869 postfix를 사용하여 메일 전송을 시도해도 Gmail로 메일이 전송되지 않았습니다. 무슨 문제가 있을까 싶어 에러 로그(/var/log/maillog)를 확인해보았습니다. [root@localhost]# tail -f /var/log/maillog   하나의 메일을 보내면서 다음 로그가 기록되었음을 알 수 있었습니다. Sep 25 22:47:49 myhost sendmail[20741]: mymessageid: [email protected], size=2728, class=0, nrcpts=1, msgid=<[email protected]>, relay=jyweb@localhost Sep 25 22:47:49 myhost postfix/smtpd[20742]: connect from localhost[127.0.0.1] Sep 25 22:47:49 myhost postfix/smtpd[20742]: […]

The post 리눅스 postfix 25: Network is unreachable 문제 해결하기 appeared first on JooTC.

]]>
postfix를 사용하여 메일 전송을 시도해도 Gmail로 메일이 전송되지 않았습니다.

무슨 문제가 있을까 싶어 에러 로그(/var/log/maillog)를 확인해보았습니다.

[root@localhost]# tail -f /var/log/maillog

 

하나의 메일을 보내면서 다음 로그가 기록되었음을 알 수 있었습니다.

Sep 25 22:47:49 myhost sendmail[20741]: mymessageid: [email protected], size=2728, class=0, nrcpts=1, msgid=<[email protected]>, relay=jyweb@localhost
Sep 25 22:47:49 myhost postfix/smtpd[20742]: connect from localhost[127.0.0.1]
Sep 25 22:47:49 myhost postfix/smtpd[20742]: Anonymous TLS connection established from localhost[127.0.0.1]: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep 25 22:47:49 myhost sendmail[20741]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-GCM-SHA384, bits=256/256
Sep 25 22:47:49 myhost postfix/smtpd[20742]: 3AACFD24A9C: client=localhost[127.0.0.1]
Sep 25 22:47:49 myhost postfix/cleanup[20748]: 3AACFD24A9C: message-id=<[email protected]>
Sep 25 22:47:49 myhost opendkim[831]: 3AACFD24A9C: DKIM-Signature field added (s=mypoint, d=myhost.com)
Sep 25 22:47:49 myhost postfix/qmgr[20735]: 3AACFD24A9C: from=<[email protected]>, size=3307, nrcpt=1 (queue active)
Sep 25 22:47:49 myhost sendmail[20741]: mymessageid: [email protected], [email protected] (1003/1003), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32728, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 3AACFD24A9C)
Sep 25 22:47:49 myhost postfix/smtpd[20742]: disconnect from localhost[127.0.0.1]
Sep 25 22:47:49 myhost postfix/smtp[20749]: connect to gmail-smtp-in.l.google.com[2404::3001:::1a]:25: Network is unreachable
Sep 25 22:47:50 myhost postfix/smtp[20749]: 3AACFD24A9C: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[108.177.125.27]:25, delay=1.8, delays=0.07/0.02/1.2/0.5, dsn=2.0.0, status=sent (250 2.0.0 OK 1537883270 v16-v6si2351737ply.54 - gsmtp)
Sep 25 22:47:50 myhost postfix/qmgr[20735]: 3AACFD24A9C: removed

 

여기에서 다음 부분으로 인해 메일이 전송되지 않았음을 알 수 있습니다.

Sep 25 22:47:49 myhost postfix/smtp[20749]: connect to gmail-smtp-in.l.google.com[2404::3001:::1a]:25: Network is unreachable

이 문제는 Gmail SMTP 호스트에 접속하지 못하는 현상입니다. postfix가 실행되고 있는 메일 서버에서 IPv6에 대한 구성을 하지 않았지만, 메일 전송 시 IPv6 네트워크로 전송을 시도했기 때문에 문제가 발생한 것으로 보입니다.

 

 

postfix 25: Network is unreachable 해결하기


먼저 postfix의 설정 파일(main.cf)을 열어보겠습니다.

[root@localhost ~]# vim /etc/postfix/main.cf

 

inet_protocols 부분에 all 값으로 입력되어 있을 것입니다. 이렇게 되면 IPv6 네트워크를 사용하게 되기 때문에 IPv4 주소만 사용하도록 설정을 바꾸어보도록 하겠습니다.

# Enable IPv4, and IPv6 if supported
#inet_protocols = all
inet_protocols = all

다음과 같이 값을 변경합니다.

inet_protocols = ipv4

파일을 저장합니다. 이후 postfix 서비스다시 시작합니다.

[root@localhost ~]# service postfix restart
또는
[root@localhost ~]# systemctl restart postfix

 

이제 다시 메일 전송을 시도해봅니다. 위 에러 메세지가 발생하지 않고 전송을 성공하였습니다.

The post 리눅스 postfix 25: Network is unreachable 문제 해결하기 appeared first on JooTC.

]]>
https://jootc.com/p/201809251869/feed 0 1869
config error: mail loops back to me (MX problem?) 해결 방법 https://jootc.com/p/201808101527 https://jootc.com/p/201808101527#respond Fri, 10 Aug 2018 13:49:55 +0000 https://blog.inidog.com/?p=1527 config error: mail loops back to me (MX problem?) 문제 sendmail 서비스를 사용하여 메일을 보내려고 하는데 “config error: mail loops back to me (MX problem?)” 에러가 로그에 기록되고 메일이 전송되지 않을 수 있습니다. /var/log/maillog를 살펴보면 다음과 같습니다: Aug 10 13:13:51 [ipAddress] sendmail[21829]: w7ADDphF021829: from=[username], size=237, class=0, nrcpts=1, msgid=<201808101313.w7ADDphF021829@[hostAddress]>, relay=root@localhost Aug 10 13:13:51 [ipAddress] sendmail[21835]: w7ADDpMP021835: from=<[hostAddress]>, […]

The post config error: mail loops back to me (MX problem?) 해결 방법 appeared first on JooTC.

]]>
config error: mail loops back to me (MX problem?) 문제

sendmail 서비스를 사용하여 메일을 보내려고 하는데 “config error: mail loops back to me (MX problem?)” 에러가 로그에 기록되고 메일이 전송되지 않을 수 있습니다.

/var/log/maillog를 살펴보면 다음과 같습니다:

Aug 10 13:13:51 [ipAddress] sendmail[21829]: w7ADDphF021829: from=[username], size=237, class=0, nrcpts=1, msgid=<201808101313.w7ADDphF021829@[hostAddress]>, relay=root@localhost
Aug 10 13:13:51 [ipAddress] sendmail[21835]: w7ADDpMP021835: from=<[hostAddress]>, size=574, class=0, nrcpts=1, msgid=<201808101313.w7ADDphF021829@[hostAddress]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 10 13:13:51 [ipAddress] sendmail[21829]: w7ADDphF021829: to=[emailAddress], ctladdr=[username] (1002/1002), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30237, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (w7ADDpMP021835 Message accepted for delivery)
Aug 10 13:13:51 [ipAddress] sendmail[21838]: w7ADDpMP021835: SYSERR(root): [hostName]. config error: mail loops back to me (MX problem?)
Aug 10 13:13:51 [ipAddress] sendmail[21839]: w7ADDpBS021839: [hostAddress] [13.xxx.xxx.xxx] (may be forged) did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 10 13:13:51 [ipAddress] sendmail[21838]: w7ADDpMP021835: to=<[emailAddress]>, ctladdr=<[hostAddress]> (1002/1002), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120574, relay=[hostName]. [13.xxx.xxx.xxx], dsn=5.3.5, stat=Local configuration error
Aug 10 13:13:51 [ipAddress] sendmail[21838]: w7ADDpMP021835: w7ADDpMP021838: DSN: Local configuration error

윗부분의 다음 내용을 확인해보면 다음과 같은 부분이 있습니다.

config error: mail loops back to me (MX problem?)

아무래도 메일 서버 설정 파일에 문제가 있는 것 같습니다.

 

해결 방법


이 문제는 로컬 호스트 이름을 제대로 식별하지 못하여 발생하는 문제로 추정됩니다. 구버전의 sendmail을 사용할 경우 해당 버전의 sendmail 버그로도 알려져있지만, 대부분은 아래 파일에서 발생하는 문제로 확인되었습니다.

/etc/mail/local-host-names

위 파일을 수정하여 올바른 로컬 호스트 주소를 추가해야 합니다.

# vim /etc/mail/local-host-names

 

파일이 열리면 아래 내용을 추가해줍니다.

필요한 내용은 MX 레코드의 값, 즉 메일 서버의 호스트 주소입니다. 로컬 호스트 주소도 추가로 등록할 수 있다면 127.0.0.1이나 localhost를 추가로 입력합니다.

# local-host-names - include all aliases for your machine here.
127.0.0.1
my-mx-host-name.com

추가가 완료되었다면 sendmail 서비스를 재시작해주어야 합니다.

# service sendmail restart (또는 systemctl restart sendmail)

이제 테스트 메일을 보내면 문제 없이 메일이 보내질 것입니다.

 

The post config error: mail loops back to me (MX problem?) 해결 방법 appeared first on JooTC.

]]>
https://jootc.com/p/201808101527/feed 0 1527