如何在gcloud上设置后缀?



我尝试在gcloud实例中设置多域服务器,按照本教程 https://vorkbaard.nl/installing-a-mailserver-on-debian-8-part-3-mta-postfix/,我修改了/etc/postfix/master.cf:

smtp        inet  n       -       y       -       -       smtpd

597        inet  n       -       y       -       -       smtpd

当我telnet域597时,我得到了一个成功的连接,但是尝试从mailx或telnet客户端发送电子邮件时,我收到一个错误,好像postfix仍然使用25端口:

Aug 24 19:26:08 localhost postfix/smtp[1404]: connect to alt2.gmail-smtp-in.l.google.com[2607:f8b0:400c:c0f::1b]:25: Network is unreachable

那么我需要在哪里更改用于在谷歌计算机实例中后缀工作的端口?谷歌网络外的远程登录工作正常!

谢谢!

[编辑]

经过更多调试和测试,从圆形立方体和 thunderbird 向相同的电子邮件发送电子邮件和接收,所以我认为问题是来自端口 25 的外部流量,我不知道为什么 postfix 使用 25 端口如果 master.cf stmp 端口设置为 597

邮件.log调试从圆形立方体发送

Aug 25 00:58:59 localhost dovecot: imap(sender@domain.com): Debug: maildir++: root=/var/mail/vmail/inova.cloud/info, index=, indexpvt=, control=, inbox=/var/mail/vmail/inova.cloud/info, alt=
Aug 25 00:58:59 localhost dovecot: imap(sender@domain.com): Logged out in=50 out=511
Aug 25 00:59:22 localhost postfix/qmgr[952]: 494C582008: from=<sender@domain.com>, size=524, nrcpt=1 (queue active)
Aug 25 00:59:22 localhost postfix/qmgr[952]: 4F95180D0A: from=<nano@server.c.majestic-lodge-173213.internal>, size=461, nrcpt=1 (queue active)
Aug 25 00:59:22 localhost postfix/error[1435]: 494C582008: to=<destination@domain>, relay=none, delay=4617, delays=4617/0.06/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect t$
Aug 25 00:59:22 localhost postfix/error[1436]: 4F95180D0A: to=<destination@domain>, relay=none, delay=80226, delays=80226/0.03/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect$
Aug 25 00:59:59 localhost dovecot: imap-login: Debug: SSL: elliptic curve secp384r1 will be used for ECDH and ECDHE key exchanges
Aug 25 00:59:59 localhost dovecot: imap-login: Debug: SSL: elliptic curve secp384r1 will be used for ECDH and ECDHE key exchanges
Aug 25 00:59:59 localhost dovecot: auth: Debug: auth client connected (pid=1442)
Aug 25 00:59:59 localhost dovecot: auth: Debug: client in: AUTH#0111#011PLAIN#011service=imap#011secured#011session=0wbZdolXxJkAAAAAAAAAAAAAAAAAAAAB#011lip=::1#011rip=::1#011lport=143#011rport=39364#011resp=AGl$
Aug 25 00:59:59 localhost dovecot: auth-worker(1430): Debug: sql(sender@domain.com,::1,<0wbZdolXxJkAAAAAAAAAAAAAAAAAAAAB>): query: SELECT email as username, pwd AS password FROM addresses WHERE email = 'info@$
Aug 25 00:59:59 localhost dovecot: auth: Debug: client passdb out: OK#0111#011user=sender@domain.com
Aug 25 00:59:59 localhost dovecot: auth: Debug: master in: REQUEST#0112225078273#0111442#0111#0117898818d71c58f150c8d4f75bb936fb5#011session_pid=1443#011request_auth_token
Aug 25 00:59:59 localhost dovecot: auth-worker(1430): Debug: sql(sender@domain.com,::1,<0wbZdolXxJkAAAAAAAAAAAAAAAAAAAAB>): SELECT 5000 AS uid, 5000 as gid, email, '/var/mail/vmail/domain/info' AS home FROM$
Aug 25 00:59:59 localhost dovecot: auth: Debug: master userdb out: USER#0112225078273#011sender@domain.com#011uid=5000#011gid=5000#011email=sender@domain.com#011home=/var/mail/vmail/domain/info#011auth_token$
Aug 25 00:59:59 localhost dovecot: imap-login: Login: user=<sender@domain.com>, method=PLAIN, rip=::1, lip=::1, mpid=1443, secured, session=<0wbZdolXxJkAAAAAAAAAAAAAAAAAAAAB>
Aug 25 00:59:59 localhost dovecot: imap(sender@domain.com): Debug: Added userdb setting: plugin/email=sender@domain.com
Aug 25 00:59:59 localhost dovecot: imap(sender@domain.com): Debug: Effective uid=5000, gid=5000, home=/var/mail/vmail/inova.cloud/info
Aug 25 00:59:59 localhost dovecot: imap(sender@domain.com): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/mail/vmail/domain/info
Aug 25 00:59:59 localhost dovecot: imap(sender@domain.com): Debug: maildir++: root=/var/mail/vmail/domain/info, index=, indexpvt=, control=, inbox=/var/mail/vmail/domain/info, alt=
Aug 25 00:59:59 localhost dovecot: imap(sender@domain.com): Logged out in=50 out=511

从外部电子邮件它不会收到

两个重要事实:

  1. GCE 阻止端口 25、465 和 587 上的出站电子邮件(端口 465 或 587 仅限于 Google Apps 中继(。
  2. 如果不使用中继,则无法选择绑定端口。这是因为您必须连接到目标正在侦听的任何端口,该端口将是标准(阻止(端口。

因此,您必须使用电子邮件中继,而它的声音不是。在我上面链接的页面底部是您可以使用的电子邮件中继的一些选项。它们都包含后缀选项。

最新更新