AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-342553

Steven Hook's questions

Martin Hope
Steven Hook
Asked: 2020-06-04 13:07:25 +0800 CST

如何让 gmail 使用 postfix 作为 SMTP 服务器

  • 0

我正在尝试让 gmail 从我的虚域发送电子邮件 - 可以理解,它希望使用为该域设置的 SMTP 服务器。我尝试将 postfix 配置为我的虚域的 SMTP 服务器,但在 gmail 中我不断收到身份验证错误。我的经验似乎与Postfix 作为 Gmail 的 SMTP 服务器非常相似。(“以” google 选项发送邮件) 对于这个特定问题,我在网上几乎没有找到其他有用的信息。大多数其他似乎询问此问题的用户都会得到“这是如何将 gmail 用作 SMTP 服务器”的答案,这显然没有帮助。Gmail 无法从我的虚域发送,这就是我(和它)需要 SMTP 服务器的原因。

这是我的配置文件,我使用 host.example.com 作为运行后缀的服务器的完整主机和域名。- 我已将 vanity.domain 用作我试图以不同用户身份使用 gmail 和 user1 等的虚荣域名。

我添加了 Letsencrypt 证书,因为有人建议 gmail 可能会拒绝自签名证书。我不知道这是否正确,或者我是否做得正确——我在 host.domain.com 上使用了 certbot --apache——证书在 host.exmaple.com 的浏览器中确实有效。

顺便说一句,我还没有设法让后缀使用端口 587 - 所以我从配置中的 [vanity.domain]:587 中删除了 :587 。

main.cf(由于不同指南建议添加的所有内容,它变得很长)

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

# TLS parameters
smtpd_tls_cert_file=/etc/letsencrypt/live/host.example.com/fullchain.pem
#smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/letsencrypt/live/host.example.com/privkey.pem
#smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = host.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, host.example.com, host, localhost.localdomain, localhost
#relayhost =[vanity.domain]:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

virtual_alias_domains = vanity.domain
virtual_alias_maps = hash:/etc/postfix/virtual
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noplaintext,noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_auth_enable = yes
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

#smtp_tls_security_level = may
#smtp_tls_protocols = !SSLv2, !SSLv3
#smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
#smtp_tls_mandatory_ciphers = high
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain = 
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtp_tls_security_level = may
smtp_tls_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_mandatory_ciphers = high
smtp_tls_loglevel = 1 
sender_canonical_maps = tcp:127.0.0.1:10001
sender_canonical_classes = envelope_sender
recipient_canonical_maps = tcp:127.0.0.1:10002
recipient_canonical_classes = envelope_recipient

等/后缀/虚拟:

user1@vanity.domain user1@gmail.com
user2@vanity.domain user2@gmail.com
user3@vanity.domain user3@gmail.com
testing@vanity.domain user1@gmail.com
@vanity.domain user1@gmail.com

我尝试连接时的日志(已删除 ips、日期和时间):

connect from mail-ua1-f41.google.com
Anonymous TLS connection established from mail-ua1-f41.google.com: TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
warning: mail-ua1-f41.google.com: SASL PLAIN authentication failed:
lost connection after AUTH from mail-ua1-f41.google.com
disconnect from mail-ua1-f41.google.com ehlo=2 starttls=1 auth=0/1 commands=3/4

sasl_passwd

[vanity.domain] user1:longpassword

最后,在 gmail 的 SMTP 设置中,我填写以下内容:

smtp 服务器:host.example.com 用户:user1(我也试过 user1@vanity.domain 和 user1@host.example.com - 我不确定应该是哪个) 密码:longpassword 端口:25(试过 587 和 465太)安全性:TLS(尝试过 SSL 并且不安全)

smtp postfix gmail smtp-auth
  • 1 个回答
  • 200 Views
Martin Hope
Steven Hook
Asked: 2016-03-09 06:58:58 +0800 CST

长胖管道上的 FTP 传输速度很慢

  • 3

我们最近获得了新的互联网 - 100Mb/s 光纤 - 并且一直在向我们的新 ISP 抱怨到美国一些 FTP 服务器的传输速度(300 毫秒之外)。特别是对于一台服务器,我们只能获得 1Mb/s。在他们向我们保证他们绝不会限制转移。

因此,在一位技术人员访问后,他说他在另一个客户端上看到了同样的问题,并表明他试图从几乎所有国际 FTP 站点下载都显示出类似的速度问题。他说FTP就是这样,延迟越高,速度越低。我以前从未听说过这种限制。所以我做了一些阅读。

我了解到“长胖管道”需要很好的大缓冲区来确保事情可以顺利流动。并且对于缓冲区大小没有硬性规定。

FTP 服务器位于运行 Filezilla 的 Windows VPS 上。- 我们这边的客户端是一个特殊的第 3 方应用程序,它监控服务器的新订单,当它们完成时,下载它们并从服务器中删除文件。

我无法使用客户端的缓冲区大小(我在询问开发人员,但我还没有看到方法) - 但我可以在 File Zilla 中调整缓冲区大小。

所以我以不同的速度进行了一些传输,似乎找到了一个不错的最佳位置,我可以达到几乎 7Mb/s。但这仍然只是我应该能够得到的一小部分。 https://www.dropbox.com/s/0dlwwuteq2o6txq/Screenshot%202016-03-08%2016.45.03.png?dl=0

我看了很多这样的问题: Filezilla FTP slow upload (350KBps) on 1 Gbits fiber?和 https://stackoverflow.com/questions/30847433/very-slow-ftp-download大部分都说“缓冲区大小,缓冲区大小,缓冲区大小”但我肯定应该比 7Mb/s 更好

所以这里是问题:

  1. 如果我不信任 ISP,并且相信我的线路上有整形,我怎么能证明这一点?

  2. FileZilla 有一个上限为 6 位的“内部缓冲区”和一个可以更高的“套接字缓冲区”。这两者如何一起玩,我发现将内部作为套接字的一半似乎最好,但是我应该尝试其他配置吗?

  3. 缓冲区大小是否需要为 8 的平方(32768、65536、131072 等),或者我可以在两者之间使用其他数字吗?

3b。我发现最好的情况是 262144(套接字)和 131072(内部)——我应该在那里开始以较小的增量进行测试吗?

  1. 如果其他人距离 ftp.rapidstudio.co.za 有 300 毫秒的距离,您能看到您获得的速度吗?(用户:test 密码:test)

谢谢史蒂文

performance
  • 2 个回答
  • 4328 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve