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-251419

Kline's questions

Martin Hope
Kline
Asked: 2023-01-07 04:50:00 +0800 CST

后缀 - 发件人地址被拒绝:未找到域(DNS 记录正常)

  • 5

这周我一直在设置一个邮件服务器,当我开始时它正在接收邮件,但在某个地方它已经停止接收来自任何域的邮件。发送仍然正常,邮件仍在本地投递。

错误日志显示:

Jan  6 12:15:12 mailserver postfix/smtpd[24639]: NOQUEUE: reject: RCPT from unknown[90.100.xxx.xxx]: 450 4.1.8 <[email protected]>: Sender address rejected: Domain not found; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<green.serve.com>
Jan  6 12:15:12 mailserver postfix/smtpd[24639]: disconnect from unknown[90.100.xxx.xxx] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 quit=1 commands=5/7

网上任何类似的问题似乎都在暗示发件人的DNS记录不正确,我从两个域都试过了,都不能发送到这个服务器。DNS 记录正确。我还使用 Dig 来确保邮件服务器可以正确检查 DNS 记录并且一切正常。

NSlookup 为发件人域找到正确的 IP:

#nslookup green.serve.com

Server:     1.0.0.1
Address:    1.0.0.1#53

Non-authoritative answer:
Name:   green.serve.com
Address: xx.400.112.xxx

即使暂时删除reject_unknown_recipient_domain也不起作用。

这是我的 main.cf 配置:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
command_directory = /usr/sbin
compatibility_level = 2
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
default_transport = error:
dovecot_destination_recipient_limit = 1
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_transport = lmtp:unix:private/dovecot-lmtp
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20971520
meta_directory = /etc/postfix
milter_default_action = accept
milter_protocol = 6
mydestination = localhost.$mydomain, localhost, $mydomain, $myhostname
myhostname = mailserver.net
mynetworks = 127.0.0.0/8
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
relay_domains =
relay_transport = error
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_loglevel = 1
smtpd_banner = $myhostname ESMTP
smtpd_milters = inet:127.0.0.1:8891
smtpd_proxy_options = speed_adjust
smtpd_recipient_restrictions = permit_mynetworks,reject_invalid_hostname, reject_unknown_recipient_domain,reject_unauth_destination,permit
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_cert_file = /etc/letsencrypt/live/mailserver.net/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mailserver.net/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtputf8_enable = no
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_gid_maps = static:1002
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_domains =
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_transport = dovecot
virtual_uid_maps = static:1002

大师.cf:

smtp       inet  n       -       y       -       -       smtpd -o content_filter=spamassassin
submission inet  n       -       y       -       -       smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_tls_wrappermode=no -o smtpd_sasl_auth_enable=yes -o smtpd_reject_unlisted_recipient=no -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o content_filter=smtp-amavis:[127.0.0.1]:10026
smtps      inet  n       -       y       -       -       smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject -o content_filter=smtp-amavis:[127.0.0.1]:10026
pickup     unix  n       -       n       60      1       pickup
cleanup    unix  n       -       n       -       0       cleanup
qmgr       unix  n       -       n       300     1       qmgr
tlsmgr     unix  -       -       n       1000?   1       tlsmgr
rewrite    unix  -       -       n       -       -       trivial-rewrite
bounce     unix  -       -       n       -       0       bounce
defer      unix  -       -       n       -       0       bounce
trace      unix  -       -       n       -       0       bounce
verify     unix  -       -       n       -       1       verify
flush      unix  n       -       n       1000?   0       flush
proxymap   unix  -       -       n       -       -       proxymap
proxywrite unix  -       -       n       -       1       proxymap
smtp       unix  -       -       n       -       -       smtp
relay      unix  -       -       n       -       -       smtp -o syslog_name=postfix/$service_name
showq      unix  n       -       n       -       -       showq
error      unix  -       -       n       -       -       error
retry      unix  -       -       n       -       -       error
discard    unix  -       -       n       -       -       discard
local      unix  -       n       n       -       -       local
virtual    unix  -       n       n       -       -       virtual
lmtp       unix  -       -       n       -       -       lmtp
anvil      unix  -       -       n       -       1       anvil
scache     unix  -       -       n       -       1       scache
postlog    unix-dgram n  -       n       -       1       postlogd
dovecot    unix  -       n       n       -       -       pipe flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
spamassassin unix -      n       n       -       -       pipe user=spamd argv=/usr/bin/spamc -f -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
smtp-amavis unix -       -       n       -       2       smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes
127.0.0.1:10025 inet n   -       n       -       -       smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_milters=
postfix
  • 2 个回答
  • 53 Views
Martin Hope
Kline
Asked: 2021-04-20 04:09:45 +0800 CST

Debian 10 PHP 未在 apache 中解析(全新安装)

  • 0

我知道这是一个古老的问题,有很多答案,但现有的解决方案似乎都没有奏效。

这是 Debian 10 的全新安装,已安装 apache2 和 php (7.3)。

Apache 不解析 PHP,所以只是将 PHP 代码显示为文本。

PHP 模块肯定已加载,我已运行以下修复:

a2dismod mpm_event && a2enmod mpm_prefork && a2enmod php7.3

并且还尝试过:

<FilesMatch \.php$>
SetHandler application/x-httpd-php
​</FilesMatch>

在 apache 配置文件中。无论如何,有一个 PHP 配置文件涵盖了这一点。

我没有尝试在 /home 目录中运行文件,所以不是问题的默认块

我现在已经删除了 PHP 和 Apache 并重新安装以得到同样的问题,重新启动并且没有进一步。

我安装了PHP:

apt install php libapache2-mod-php php-mysql

任何日志中都没有错误,我在 Stackoverflow 上检查了许多答案,但没有进一步的线索。

php debian apache-2.4
  • 1 个回答
  • 603 Views
Martin Hope
Kline
Asked: 2020-06-20 01:30:20 +0800 CST

通过 PHP 脚本运行传入的邮件 - Postfix

  • 0

我已经按照这个答案将域的所有 Postfix 电子邮件通过管道传输到 PHP 脚本 - Centos7/EC2以将特定地址的传入邮件定向到 PHP 脚本。

我的别名文件条目如下所示:

mail-incoming-php: "/usr/bin/php -q /var/spool/mail/php/incoming.php"

Postfix 虚拟文件将电子邮件地址映射到

mail-incoming-php@localhost

我当前的测试 PHP 脚本设置为创建一个我已经测试过的空文件。向相关地址发送邮件时,PHP 脚本不会创建文件,并且maillog包含以下错误:

cannot append message to file /usr/bin/php -q /var/spool/mail/php/incoming.php: cannot create file exclusively: No such file or directory

我暂时将 PHP 脚本的权限设置为 777 并得到相同的错误。

也许这不是解决这个问题或其他需要做的事情的最佳方法?

我需要脚本做的就是阅读收到的电子邮件的内容,之后不必转发电子邮件。

php postfix centos8
  • 1 个回答
  • 367 Views
Martin Hope
Kline
Asked: 2020-05-28 00:46:38 +0800 CST

Postfix/Dovecot/Amavis 只允许接收(而不发送)邮件

  • 1

什么是在 linux 服务器上完全阻止传出邮件同时仍允许传入邮件的最佳方法。

似乎这不能通过端口阻塞来完成,我已经smtpd_relay_restrictions = reject在 Postfix 中尝试过,但这会阻塞一切。

在 Dovecot 中使用选项更容易,但如果可能的话,我想在较低级别创建块。

如果无法完全阻止外发邮件,那么我会对允许将邮件发送到单个 IP 或域感到满意。

linux email postfix
  • 1 个回答
  • 74 Views
Martin Hope
Kline
Asked: 2020-05-13 13:53:03 +0800 CST

Gmail 是否需要 TLS 才能接收邮件?

  • 0

我目前正在使用 PHP 直接发送电子邮件stream_socket_client()。

到目前为止,这工作得很好。我能够发送带有 DKIM 签名的 HTML 电子邮件,该签名通过了https://www.mail-tester.com上的所有测试

我自己的邮件服务器以及 Yahoo 和 AOL 正在接收邮件,没有投递或垃圾邮件问题。

但是当我发送到 Gmail 时,不仅电子邮件没有到达,而且没有送达报告被发送回返回路径。尽管在 SMTP 交换期间没有给出任何错误,但仍然如此。

如果我使用它向 Gmail 发送完全相同的测试电子邮件,mail()则没有问题。我比较了两封电子邮件的来源,它们仅在 DKIM 签名上略有不同,我没有“x”标头,并且加密的标头列表不同。我不认为这是问题所在。

我可以看到的唯一区别是我正在做mail()的事情和我还没有使用 TLS。这似乎是一个强有力的候选者,但从我所阅读的内容来看,Gmail 并没有将 TLS 作为接收电子邮件的要求。

还有什么我可能会丢失的吗?

下面是 SMTP 交换:

SMTP Connection:

HOST: 220 mx.google.com ESMTP f128si20492958wme.149 - gsmtp

EHLO: 250-mx.google.com at your service, [90.100.136.100]

FROM: 250-SIZE 157286400

RCPT: 250-8BITMIME

DATA: 250-ENHANCEDSTATUSCODES

DATA WRITE: 250-PIPELINING

QUIT: 250-CHUNKING
php email smtp gmail
  • 1 个回答
  • 89 Views
Martin Hope
Kline
Asked: 2020-05-08 08:16:18 +0800 CST

雅虎邮件总是为 SMTP rcpt 发送 250 代码

  • -2

正如标题所暗示的那样,yahoo.com 会返回一个 250 代码来区分好坏的电子邮件地址,即存在的和不存在的。

这只是雅虎政策还是我做错了什么?

如果这是他们的政策,是否有任何程序化方式来确认雅虎地址是否真实?

email smtp
  • 1 个回答
  • 292 Views
Martin Hope
Kline
Asked: 2020-04-30 03:56:58 +0800 CST

后缀状态 = 延迟

  • 1

为了防止垃圾邮件,我试图从我们的数据库中删除虚假或不良电子邮件。我想要执行此操作的方法之一是检查邮件日志,如果未发送电子邮件,则从数据库中删除收件人。

所以,如果status=Bounced这很好,但是呢status=Deferred?绝大多数不良电子邮件都处于延迟状态。删除这些会容易得多,但我不确定这种状态是否最终会删除好的电子邮件?

我还想停止 postfix 尝试重新发送延迟的电子邮件,我不知道这是否意味着不会发送合法的电子邮件。

我四处搜索,找不到此状态的良好定义,以及延迟的电子邮件是否有可能最终被第二次发送。

linux email postfix
  • 2 个回答
  • 2457 Views
Martin Hope
Kline
Asked: 2016-03-12 08:31:28 +0800 CST

挂载绑定在 fstab 中不生效 - Centos 6

  • 0

我在 fstab 中使用这一行将 /sftp/feeds/incoming 绑定到 /var/www/online/public_html/feeds

/sftp/feeds/incoming   /var/www/online/public_html/feeds   none   bind   0 0

但它没有生效。

如果我使用:

mount --bind /var/www/online/public_html/feeds /sftp/feeds/incoming

在可以正常工作但在重新启动时当然会丢失的命令行上。

centos
  • 1 个回答
  • 1799 Views
Martin Hope
Kline
Asked: 2014-11-06 08:22:49 +0800 CST

使用自己的公钥访问服务器

  • 0

我在 PHP 中使用 ssh2_connect() 将文件从一台服务器移动到另一台服务器。但是暂时没有两台服务器,我只是将服务器连接到自身。

这是这样设置的,当有两台服务器时,只需更改连接信息,而不是将所有内容从标准 PHP 函数转换为 ssh2。

这已经使用密码身份验证工作了一段时间,但我现在正在切换到公钥授权。

尝试连接时出现以下错误:

Username/PublicKey combination invalid

我已经设置了几次密钥,并且发生了同样的事情。我现在想知道是否不可能在同一台机器上以这种方式进行身份验证?

我知道其他一切都在使用 ssh,因为我出于其他目的使用来自另一台服务器的公钥访问了该服务器。

php
  • 1 个回答
  • 3913 Views
Martin Hope
Kline
Asked: 2014-11-05 12:30:54 +0800 CST

使用 setfacl 设置包含目录权限?

  • 3

我在以下文件夹结构样式 /home/site/admin/script.php 中有一个文件,例如 script.php

我使用 setfacl 允许远程登录的新用户将该文件包含在另一个正在执行的脚本中(远程)。

但是,这仅在所有包含文件夹都设置为执行时才有效。首先,即使是一个问题,我被告知目录可以让其他人设置为执行没有问题,但这包括我的主文件夹,这对我来说似乎有点开放。

所以我猜我可以使用 setfacl 为用户提供对所有父目录的执行权限,但是我是否必须单独执行此操作,或者是否有可能向上遍历的命令?

一般来说,我才刚刚开始了解权限,所以如果我有一些错误,我深表歉意。

linux
  • 1 个回答
  • 831 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