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

neezer's questions

Martin Hope
neezer
Asked: 2023-06-10 08:28:45 +0800 CST

使用 pf 端口转发 DNS

  • 6

在 OpenBSD 上,我可以使用以下命令成功且透明地将端口 80 和 443 转发到在自定义非特权端口上运行的服务/etc/pf.conf:

tcp_pass = "{ 22 80 123 443 }"

block all
pass out log on egress proto tcp to any port $tcp_pass keep state

pass in log on egress proto tcp from any to any port 80 rdr-to 127.0.0.1 port 3080 keep state
pass in log on egress proto tcp from any to any port 443 rdr-to 127.0.0.1 port 3443 keep state

我通过加载一个绑定到 的静态文件服务器来测试它3080,然后从另一台机器对服务器进行 cURL 调用,如下所示:

curl -v 192.168.1.xxx

...我得到了 200 状态代码和我期望的 HTML 内容。?


现在我想对 DNS 做同样的事情。首先,我更新了tcp_pass宏以包含53并创建了第二个宏并将udp_pass其53也放入其中,然后是一条udp规则。

然后我尝试添加以下规则(请参阅下面代码块中的注释):

tcp_pass = "{ 22 53 80 123 443 }"
udp_pass = "{ 53 }"

# ...

pass out log on egress proto udp to any port $udp_pass keep state

# ...

# the new rules I added -- emulating the http(s) rules from before
pass in log on egress proto tcp from any to any port 53 rdr-to 127.0.0.1 port 5353 keep state
pass in log on egress proto udp from any to any port 53 rdr-to 127.0.0.1 port 5353 keep state

我在端口上启动了一个 DNS 服务器5353,并尝试从外部机器向这台机器发出请求:

  • dig @192.168.1.xxx -p 5353 cnn.com按预期工作:立即返回正确的响应

  • dig @192.168.1.xxx cnn.com挂起,然后超时并出现以下错误

    ; <<>> DiG 9.10.6 <<>> @192.168.1.xxx cnn.com
    ; (1 server found)
    ;; global options: +cmd
    ;; connection timed out; no servers could be reached
    

当我进行 DNS 查询时,我遵循pf日志tcpdump -nettti pflog0,并且在端口上请求时我只看到以下条目53:

Jun 09 17:15:22.513529 rule 10/(match) pass in on iwm0: 192.168.1.yyy.58201 > 192.168.1.xxx.53: 64594+ [1au] A? cnn.com.(36)
Jun 09 17:15:22.513933 rule 6/(match) pass out on iwm0: 192.168.1.xxx.47191 > 9.9.9.9.53: 64594+ [1au] A? cnn.com.(36)

53如果我直接使用将 DNS 服务器重新绑定到端口root,解析工作正常,所以我知道问题出在我的 PF 配置上,而不是我的网络。

我的目标是在非特权端口上运行我的 DNS 服务器,并将端口转发53到该端口。我不确定接下来要尝试什么,希望能有任何见解。

domain-name-system
  • 1 个回答
  • 58 Views
Martin Hope
neezer
Asked: 2015-10-14 20:47:02 +0800 CST

基于cookie在proxy_pass和uwsgi_pass之间切换?

  • 1

我的 nginx 服务器当前设置为通过以下方式服务所有请求uwsgi_pass:

location / {
  uwsgi_pass unix:///tmp/uwsgi-zerocater.sock;
  include uwsgi_params;
  uwsgi_read_timeout 7200;
  client_max_body_size 20M;
}

在我的应用程序代码中,我设置了一个名为new_fe“True”或“False”的cookie。

当值为“True”时,我想改为proxy_pass另一个外部服务器,但仅限于特定路由。类似于以下伪代码:

location ~ "^/my/complicated/regex$" {
  if ($cookie_new_fe = "True") {
    # pass the request to my other server
    # at something like http://other.server.com
  } else {
    # do the usual uwsgi stuff
  }
}

我怎样才能做到这一点?我还是有点新nginx,所以如果我错过了一些简单的问题,请原谅这个问题。

nginx
  • 2 个回答
  • 1104 Views
Martin Hope
neezer
Asked: 2010-03-26 09:20:12 +0800 CST

Ubuntu 服务器:使用 /etc/network/interfaces 中的 MODPROBE 选项联网失败...?

  • 3

出于某种原因(我还无法确定),昨天早上我们的网络服务器(运行 Ubuntu 8.04.2 LTS -- hardy)上的网络服务无法启动,我们的网站出现故障。

尝试重新启动时,我注意到以下错误消息:

* Reconfiguring network interfaces...
/etc/network/interfaces:6: option with empty value
ifup: couldn't read interfaces file "/etc/network/interfaces"
   ...fail!

文件中的第 6 行/etc/network/interfaces涉及一个 MODPROBE 命令,该命令(我相信)加载到ip_conntrack_ftp模块中,以便我可以在我的 FTP 服务器(vsftpd)上使用 PASV:(破坏 modprobe 命令在下面注释掉)

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# The loopback network interface
auto lo
iface lo inet loopback
#MODPROBE=/sbin/modprobe
#$MODPROBE ip_conntrack_ftp
pre-up iptables-restore < /etc/iptables.up.rules

# The primary network interface
# Uncomment this and configure after the system has booted for the first time
auto eth0
iface eth0 inet static
    address xxx.xxx.xxx.xxx
    netmask 255.255.255.0
    gateway xxx.xxx.xxx.1
    dns-nameservers xxx.xxx.xxx.4 xxx.xxx.xxx.5

我已经确认在/sbin调用中有一个文件modprobe。

就像我之前说的,这个设置一直到昨天早上都完美无缺(尽管我的老板说该网站实际上是在美国东部标准时间晚上 11 点关闭的)。

谁能解释一下(A)为什么会坏,(B)我怎样才能重新启用ip_conntrack_ftp模块?

ftp ubuntu networking modprobe
  • 3 个回答
  • 2393 Views
Martin Hope
neezer
Asked: 2010-01-30 07:33:20 +0800 CST

FreePBX:云中的 Asterisk (EC2) 音频问题

  • 1

请原谅新手的问题,但我似乎无法弄清楚这一点。

我按照Voxilla 的教程到了发球台。

但是在拨打电话时,我的软电话可以连接,但没有音频(在任何一个方向)。

我从论坛中得知,这通常是由两个因素引起的:NAT 和音频编解码器。

但是,我(刚进入竞技场)不知道是哪个。我相信我有 Asterisk,客户仅限于 ulaw,我也相信我打开了正确的端口,并且我的 externip 设置正确(我认为 Voxilla AMI 会自动执行此操作,因为它在云中)。

我有点失落。只要您告诉我它们在文件系统上的位置,我很乐意发布任何可能有帮助的配置文件。但就像我之前说的,这实际上是 Voxilla 自己的 FreePBX AMI 的香草安装。

我很感激这里的任何帮助或指导。谢谢!

audio asterisk telephony freepbx
  • 2 个回答
  • 2607 Views
Martin Hope
neezer
Asked: 2010-01-26 11:25:06 +0800 CST

FreePBX:基本配置?

  • 3

我刚刚按照本指南在 Amazon EC2 实例上成功设置了 Asterisk+FreePBX 安装:http: //voxilla.com/2009/10/15/voxillas-freepbx-in-a-cloud-step-by-step -1457(我还为其分配了弹性 IP)。

我很想在不购买任何 VoIP 中继的情况下对其进行测试。我知道我可以通过对连接到 Asterisk 服务器的两部电话进行内部呼叫来做到这一点,对吗?

我正在使用软件电话:CounterPath eyeBeam。

我似乎无法在网上找到任何指南或资源来告诉我在 FreePBX 方面我需要做些什么来设置它以路由内部呼叫,或者我需要输入 CP 的 eyeBeam 客户端(用户名, auth. name, password, etc.) 以便让它连接到 Asterisk。

有人可以给我一个快速入门吗?或者至少给我指出一个可以帮助我的易于消化的资源?

编辑:我确实已经找到了这个指南,但是它将 FreePBX 设置为使用外部 VoIP 中继,我还不想购买。

asterisk sip freepbx
  • 1 个回答
  • 1390 Views
Martin Hope
neezer
Asked: 2009-10-01 09:53:35 +0800 CST

让 Saslauthd 在 25 端口正常工作;无法让它在端口 587 上工作

  • 1

我取消了 中的“提交”部分的注释/etc/postfix/master.cf,并且我的防火墙在端口 587 上打开。

尝试使用 TLS 通过端口 587 提交消息时出现以下错误:

Sep 30 13:41:05 mailer postfix/smtpd[7577]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Sep 30 13:41:05 mailer postfix/smtpd[7577]: warning: SASL authentication problem: unable to open Berkeley db /etc/sasldb2: No such file or directory
Sep 30 13:41:05 mailer postfix/smtpd[7577]: warning: SASL authentication failure: no secret in database
Sep 30 13:41:05 mailer postfix/smtpd[7577]: warning: unknown[66.109.xxx.xxx]: SASL CRAM-MD5 authentication failed: authentication failure

我的 saslauthd 在端口 25 上工作正常。这是以下内容/etc/postfix/sasl/smtpd.conf:

pwcheck_method: saslauthd
auxprop_plugin: sasldb
saslauthd_path: /var/run/saslauthd/mux
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5

我想我应该将此文件复制到同一目录中的另一个文件中并调用它submission.conf,但这似乎没有做任何事情。

我重新启动了 saslauthd 和 postfix,但没有任何效果。

这是我的/etc/postfix/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

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.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.

myhostname = mailer.domain.com
#mydomain = mailer.domain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mailer.domain.com 
relayhost = 
mynetworks = 66.109.xxx.xxx, 127.0.0.0/8, 66.45.29.0/24, 66.9.31.0/24
mailbox_size_limit = 0
#smtpd_client_restrictions = permit_mynetworks, reject
#smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
recipient_delimiter = +
inet_interfaces = all
notify_classes = bounce, 2bounce, delay, policy protocol, resource, software

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous,noplaintext
smtpd_sasl_application_name = smtpd
smtpd_sasl_local_domain = mailer.rdny.com
broken_sasl_auth_clients = no

smtpd_recipient_restrictions = permit_mynetworks,reject_unlisted_recipient,reject_non_fqdn_sender,reject_unknown_sender_domain,permit_sasl_authenticated,reject_unauth_destination,check_policy_service inet:127.0.0.1:60000,reject

理想情况下,我希望 saslauthd 在端口 25 和 587 上工作。谁能给我一些关于如何完成此任务的指导?

编辑:这也是我master.cf的。

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       -       -       -       smtpd
submission inet n       -       -       -       -       smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
    -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix -   n   n   -   2   pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

### dkimproxy filter - see http://dkimproxy.sourceforge.net/postfix-outbound-howto.html
#
# modify the default submission service to specify a content filter
# and restrict it to local clients and SASL authenticated clients only
#
smtp  inet  n     -       n       -       -       smtpd
    -o smtpd_etrn_restrictions=reject
    -o smtpd_sasl_auth_enable=yes
    -o content_filter=dksign:[127.0.0.1]:10028
    -o receive_override_options=no_address_mappings
    -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

# specify the location of the DKIM signing proxy
# Note: the smtp_discard_ehlo_keywords option requires a recent version of
# Postfix. Leave it off if your version does not support it.
dksign    unix  -       -       n       -       10      smtp
    -o smtp_send_xforward_command=yes
    -o smtp_discard_ehlo_keywords=8bitmime,starttls

# service for accepting messages FROM the DKIM signing proxy
127.0.0.1:10029 inet  n  -      n       -       10      smtpd
    -o content_filter=
    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    -o smtpd_helo_restrictions=
    -o smtpd_client_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8
postfix
  • 2 个回答
  • 1696 Views
Martin Hope
neezer
Asked: 2009-09-29 17:25:14 +0800 CST

替换文件名中的通配符

  • 3

我不能让它工作:

我有数百个文件,我们的数据库开发人员愚蠢地在其中添加了星号,因此我们的文件命名如下:

*1*_Floorplan.jpg

我需要递归(两个级别)搜索并替换*所有文件名中“”的所有实例,并用下划线“ _”替换它们。

我已经尝试了以下但它失败了,输出“mv”命令的使用格式数百次(就像它试图处理的每个文件一样),就像我期望的那样,如果我有无效的语法,但我似乎找不到它有什么问题:

for x in `find . -regex '.*/\*.*'` ; do mv $x `echo $x | sed s/\*/_/g` ; done

这是在 Mac (10.4) 系统上,所以它是一个达尔文环境,如果这有什么不同的话。

请帮忙!

bash
  • 2 个回答
  • 2051 Views
Martin Hope
neezer
Asked: 2009-09-18 21:58:16 +0800 CST

网络速度差异?

  • 0

我不知道这里的问题是什么......

这是我的设置。

我有一台速度相当快的台式电脑,它位于三个 T1 上(扭成一条线?或者它们是连接在一起的),这通常为我们提供大约 4Mbps 的上下速度。桌面有一个静态 IP,我们目前将它托管在曼哈顿中城。

我们刚刚在布鲁克林的一家托管公司建造了一个专用服务器盒,其中包括一台速度更快的机器,它位于一条 10Mbps 不限速且据报道没有节流的线路上(也有一个专用 IP)。服务器正在运行 Windows Server 2008。

因此,在等式的一方面,我应该提高 4Mbps,另一方面我应该降低 10Mbps,但是当我传输大文件(2Gb)时,我的速度大约为 200Kbps!天呐?!?

这是从这里到那里的跟踪路由:

traceroute to 66.109.xxx.xxx (66.109.xxx.xxx), 64 hops max, 52 byte packets
 1  66.9.31.1 (66.9.31.1)  1.459 ms  0.744 ms  0.670 ms
 2  66.9.212.18 (66.9.212.18)  44.353 ms  15.398 ms  11.758 ms
 3  ip-160-79-127-229.autorev.intellispace.net (160.79.127.229)  14.341 ms  10.849 ms      8.220 ms
 4  gigabitethernet6-24.ar4.nyc1.gblx.net (207.136.166.53)  7.620 ms  33.029 ms  33.442 ms
 5  64.209.99.6 (64.209.99.6)  23.604 ms  31.267 ms  19.221 ms
 6  galaxy-visions.nyc2.webair.net (69.42.90.156)  6.183 ms  4.622 ms  13.551 ms
 7  *^C

(第 7 步是我的服务器,因为 traceroute 被防火墙阻止了)。

我已经在两台机器(speedtest.net)上运行了速度测试,并且数字与我应该得到的大致匹配(我之前列出的)。

奇怪的是,当我开始传输 2Gb 文件时,前 1Mb 的传输速度大约是 1Mbps,然后它会稳步下降,直到它在 200-300kbps 之间的任何地方变平。我不明白为什么我从这两个非常高速的连接中得到这么慢的速度!!

有什么想法吗?

networking
  • 1 个回答
  • 129 Views
Martin Hope
neezer
Asked: 2009-09-05 06:40:24 +0800 CST

关于托管 VM 性能的问题;理解 PerfMon (Win Server 2003)

  • 0

快速提问:

我目前正在为我们的 4th Dimension 服务器购买专用主机或 VM 主机,并且我已经在具有以下规格的 VM 机器上与一家公司进行了试用:

RAID 1 操作系统,RAID 1 数据

2GB 内存

四核至强 CPU

我有内置的 Windows 性能监视器,当我将远程客户端连接到我的数据库时,我注意到三行中的两行(Pages/sec for Memory & Avg. Disk Queue Lengh for PhysicalDisk)拍摄到图表顶部并保持在 100 直到我的查询完成,之后它们都回落到接近 0 并保持在那里直到我运行另一个查询。

这是因为我没有足够的内存还是因为我的硬盘驱动器访问速度太慢?虚拟机运行这些查询的速度比我们当前的内部机器慢,我想确保它与内存或 HD 相关,而不是由于网络延迟......(我知道远程主机会比 LAN 慢电脑,但我认为它不应该这么慢......)。

我们的内部机器确实有 4Gb 内存,但运行的是较旧(几年)的 AMD 单核处理器,时钟速度仅略高一些。另外,由于我们的数据库服务器运行了 5 年,它只能有效使用 2Gb 的内存(我相信是软件上限)。

有什么想法吗?(请原谅这个问题的新手;我通常比系统本身更擅长编码系统上的内容。)

windows hosting
  • 1 个回答
  • 56 Views
Martin Hope
neezer
Asked: 2009-09-03 13:12:56 +0800 CST

地理位置如何影响网络延迟?

  • 20

我可以选择在东海岸(美国)的托管托管公司或西海岸(美国)的托管公司托管我们的数据库/网络服务器。我们公司位于纽约市外,两家托管服务提供商都为我们的盒子提供了一条专用的 T1 线路。

如果我选择西海岸的那个而不是东海岸的那个,我会在网络延迟方面承受多少性能损失(假设所有其他因素都相同)?当数字和距离变得非常大(T1 及以上,以及数千英里)时,我不太确定地理位置如何影响互联网速度。

谢谢!

networking
  • 6 个回答
  • 29062 Views
Martin Hope
neezer
Asked: 2009-09-02 14:02:19 +0800 CST

更改了系统上的主机名;后缀无法启动

  • 1

标题说明了一切。我将系统上的主机名更改为 FQDN,现在 Postfix 无法启动,说:

Sep  1 21:57:06 mailer postfix/master[4759]: fatal: bind 127.0.0.1 port 10029: Cannot assign requested address

有趣的是,它在错误日志中仍然有旧名称“mailer”。我已经更新了我的配置,使它应该有新的主机名:

myhostname = mailer.xxx.com
mydomain = mailer.xxx.com

但没有喜悦。

请帮忙!如果您需要任何其他信息,请告诉我...


后置信-n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = mailer.xxx.com
mydomain = mailer.xxx.com
myhostname = mailer.xxx.com
mynetworks = xxx.xxx.xxx.0/24, 127.0.0.0/8
myorigin = /etc/mailname
notify_classes = bounce, 2bounce, delay, policy protocol, resource, software
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks, reject
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

ip地址:

1: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 40:40:4b:1c:8b:d1 brd ff:ff:ff:ff:ff:ff
    inet 173.45.237.59/24 brd 173.45.237.255 scope global eth0
    inet6 fe80::4240:4bff:fe1c:8bd1/64 scope link 
       valid_lft forever preferred_lft forever

/etc/主机:

127.0.0.1     localhost localhost.localdomain
173.45.237.59     mailer.xxx.com

/etc/网络/接口

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# The loopback network interface
auto lo
iface lo inet loopback
pre-up iptables-restore < iptables.up.rules

# The primary network interface
# Uncomment this and configure after the system has booted for the first time
auto eth0
iface eth0 inet static
    address 173.45.237.59
    netmask 255.255.255.0
    gateway 173.45.237.1
    dns-nameservers 173.45.224.4 173.45.224.5
networking
  • 5 个回答
  • 2574 Views
Martin Hope
neezer
Asked: 2009-09-02 09:04:55 +0800 CST

Postfix & DKIMproxy 问题:连接被拒绝

  • 1

我的服务器设置与本文完全相同:Getting DKIMproxy installed and configured,但我遇到以下问题。

当我通过端口 587 向我的服务器发送电子邮件时,我在 mail.log 中得到以下内容:

Sep  1 16:49:38 mailer postfix/smtpd[9974]: connect from unknown[xxx.xxx.xxx.xxx]
Sep  1 16:49:39 mailer postfix/smtpd[9974]: 0B6C5301BC: client=unknown[xxx.xxx.xxx.xxx]
Sep  1 16:49:39 mailer postfix/cleanup[9970]: 0B6C5301BC: message-id=<[email protected]>
Sep  1 16:49:39 mailer postfix/qmgr[9949]: 0B6C5301BC: from=<[email protected]>, size=552, nrcpt=1 (queue active)
Sep  1 16:49:39 mailer postfix/smtp[9953]: connect to 127.0.0.1[127.0.0.1]:10027: Connection refused
Sep  1 16:49:39 mailer postfix/smtp[9953]: 0B6C5301BC: to=<[email protected]>, relay=none, delay=0.14, delays=0.14/0/0/0, dsn=4.4.1, status=deferred (connect to 127.0.0.1[127.0.0.1]:10027: Connection refused)

我有 /etc/dkimproxy/dkimproxy_out.conf 设置如下:

# specify what address/port DKIMproxy should listen on
listen    127.0.0.1:10027

# specify what address/port DKIMproxy forwards mail to
relay     127.0.0.1:10028

# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
# Note that this is set in /etc/init.d/dkimproxy in this Debian package
# unactivate it there if you want to use the config file
domain    mailer.xxx.com

# specify what signatures to add
signature dkim(c=relaxed)
signature domainkeys(c=nofws)

# specify location of the private key
keyfile   /etc/dkimproxy/keys/email.key

# specify the selector (i.e. the name of the key record put in DNS)
selector  mail

然后我的 /etc/postfix/master.cf 附加了以下内容(根据教程):

submission  inet  n     -       n       -       -       smtpd
    -o smtpd_etrn_restrictions=reject
    -o smtpd_sasl_auth_enable=yes
    -o content_filter=dksign:[127.0.0.1]:10027
    -o receive_override_options=no_address_mappings
    -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

dksign    unix  -       -       n       -       10      smtp
    -o smtp_send_xforward_command=yes
    -o smtp_discard_ehlo_keywords=8bitmime,starttls

我似乎无法弄清楚为什么我在 DKIMproxy 应该监听的端口上不断收到“连接被拒绝”。谁能帮我解决这个问题?我不需要在防火墙中打开任何东西,对吗?因为它应该只是在本地主机上进行内部连接?

我觉得我已经很接近让这个工作了!

email
  • 2 个回答
  • 1911 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