Home>

Here, I use CentOS 7 and set up a mail server with Postfix.

The following sites are referenced.
I have imitated almost as it is.

We are testing email transmission and reception using the email address [email protected] created with CentOS.

First, put it from the log.

Aug 27 14:17:22 localhost postfix/qmgr [1753]: ED0A761CD976: from =<[email protected]> ;, size = 830, nrcpt = 2 (queue active)
Aug 27 14:17:22 localhost postfix/local [12466]: ED0A761CD976: to =<[email protected]> ;, relay = local, delay = 0.67, delays = 0.66/0.02/0/0, dsn = 2.0. 0, status = sent (delivered to maildir)
Aug 27 14:17:22 localhost postfix/smtpd [12453]: disconnect from mp76f1fbc4.ap.nuro.jp [118.241.251.196]
Aug 27 14:17:52 localhost postfix/smtp [12336]: connect to gmail-smtp-in.l.google.com [108.177.125.27]: 25: Connection timed out
Aug 27 14:17:52 localhost postfix/smtp [12336]: connect to gmail-smtp-in.l.google.com [2404: 6800: 4008: c01 :: 1a]: 25: Permission denied
Aug 27 14:18:22 localhost postfix/smtp [12336]: connect to alt1.gmail-smtp-in.l.google.com [64.233.179.26]: 25: Connection timed out
Aug 27 14:18:22 localhost postfix/smtp [12336]: connect to alt1.gmail-smtp-in.l.google.com [2607: f8b0: 4003: c09 :: 1b]: 25: Permission denied
Aug 27 14:18:22 localhost postfix/smtp [12336]: connect to alt2.gmail-smtp-in.l.google.com [2607: f8b0: 4001: c16 :: 1a]: 25: Permission denied
Aug 27 14:18:22 localhost postfix/smtp [12336]: ED0A761CD976: to =<[email protected]> ;, relay = none, delay = 61, delays = 0.66/0/60/0, dsn = 4.4. 1, status = deferred (connect to alt2.gmail-smtp-in.l.google.com [2607: f8b0: 4001: c16 :: 1a]: 25: Permission denied)
Aug 27 14:20:08 localhost sSMTP [13271]: Unable to locate mail
Aug 27 14:20:08 localhost sSMTP [13271]: Cannot open mail: 25
Aug 27 14:20:42 localhost postfix/anvil [12456]: statistics: max connection rate 1/60s for (smtps: 118.241.251.196) at Aug 27 14:17:21
Aug 27 14:20:42 localhost postfix/anvil [12456]: statistics: max connection count 1 for (smtps: 118.241.251.196) at Aug 27 14:17:21
Aug 27 14:20:42 localhost postfix/anvil [12456]: statistics: max cache size 1 at Aug 27 14:17:21
Aug 27 14:25:08 localhost sSMTP [14290]: Unable to locate mail
Aug 27 14:25:08 localhost sSMTP [14290]: Cannot open mail: 25
Aug 27 14:26:13 localhost postfix/qmgr [1753]: ED0A761CD976: from =<[email protected]> ;, size = 830, nrcpt = 2 (queue active)
Aug 27 14:26:13 localhost postfix/smtp [14415]: connect to gmail-smtp-in.l.google.com [2404: 6800: 4008: c00 :: 1b]: 25: Permission denied
Aug 27 14:26:43 localhost postfix/smtp [14415]: connect to gmail-smtp-in.l.google.com [108.177.97.27]: 25: Connection timed out
Aug 27 14:26:43 localhost postfix/smtp [14415]: connect to alt1.gmail-smtp-in.l.google.com [2607: f8b0: 4003: c09 :: 1a]: 25: Permission denied
Aug 27 14:27:13 localhost postfix/smtp [14415]: connect to alt1.gmail-smtp-in.l.google.com [64.233.179.26]: 25: Connection timed out
Aug 27 14:27:13 localhost postfix/smtp [14415]: connect to alt2.gmail-smtp-in.l.google.com [2607: f8b0: 4001: c16 :: 1b]: 25: Permission denied
Aug 27 14:27:13 localhost postfix/smtp [14415]: ED0A761CD976: to =<[email protected]> ;, relay = none, delay = 591, delays = 531/0.02/60/0, dsn = 4.4. 1, status = deferred (connect to alt2.gmail-smtp-in.l.google.com [2607: f8b0: 4001: c16 :: 1b]: 25: Permission denied)

What is going on here is
・ You can send and receive emails addressed to yourself ([email protected]).
・ E-mail from other domains ([email protected]) fails to send (as shown in the log).
・ I cannot receive emails from other domain email addresses ([email protected]) to myself ([email protected]). There is no error.

Is it because of too much security?
If i know how to solve it, thank you.

  • Answer # 1

    If you search the Internet for keywords like "dkim spf postfix"
    I think that it is better to take a look at it because there is so much information.

    Because Gmail also blocks emails that are considered suspicious servers,
    It is necessary to prepare a series of rules that we are not suspicious.

    Set SPF + DKIM and send mail with Postfix (CentOS)
    Avoiding spam mail with SPF and DKIM settings | LINUX study blog

    Add SPF settings to the domain name server.
    Add SPF definition as TXT record.

    If this is still blocked, you may need to set up DKIM.

    (When I find a question like this, I always feel that I have the same answer.)

  • Answer # 2

    Is there a server at home, etc., and the provider's OP25B is stuck?

    Where are the servers? home? VPS on the net?
    Have you acquired your own domain and set up DNS at your domain management company?

    Additional
      

    The server is at home.

    First of all, it is not possible to send mail from the 25th port from the home due to the provider's block, so it is not possible to follow the procedure for building a mail server on VPS.
    It is necessary to request relay to an SMTP server somewhere that has an account. For connection, use the submission port (port 587) and perform SMTP authentication using the account ID and password.
    It was a long time ago, but I wrote it on my blog. "Sending mail from the server (Postfix) 2"

    It should have been possible to use Gmail's SMTP server instead of the provider's SMTP server.

    Receive,

      

    Our domain has been acquired and DNS settings have been completed. We also have MX settings.

    Are you opening the 25th port?

  • Answer # 3

    Thank you for your answers.

    In conclusion, I abandoned putting my mail server in my home server.

    I thought the hurdles were high, such as the 25th block by the provider.
    In addition, it was decided to use a rental server because relaying of mail servers is becoming more complicated due to the promotion to TLS 1.1/1.2 this summer.