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

TCB13's questions

Martin Hope
TCB13
Asked: 2023-05-22 20:02:02 +0800 CST

Postfix:电子邮件转发传输

  • 5

我有一个 Postfix 设置,虚拟用户运行得很好。我的一些用户将他们的电子邮件重定向到外部电子邮件 gmail 帐户,例如:[email protected]为了[email protected]他们自己的方便,通过virtual_alias_maps.

现在我尝试transport_maps为这些转发使用专用传输,如下所示:

主.cf:

virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_alias_maps = mysql:/etc/postfix/virtual/mysql-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/virtual/mysql-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/virtual/mysql-mailbox-maps.cf
default_transport = out-default
transport_maps = mysql:/etc/postfix/virtual/mysql-transport-maps.cf

主.cf:

out-default   unix  -       -       n       -       -       smtp
 -o proxy_interfaces=$smtp_default_transport_proxy_interface
 -o smtp_bind_address=$smtp_default_transport_interfaces
 -o inet_interfaces=$smtp_default_transport_interfaces
 -o myhostname=$smtp_default_transport_hostname
 -o smtp_helo_name=$smtp_default_transport_hostname
 -o syslog_name=smtp-$smtp_default_transport_hostname
out-fwd   unix  -       -       n       -       -       smtp
 -o proxy_interfaces=$smtp_default_transport_proxy_interface
 -o smtp_bind_address=$smtp_default_transport_interfaces
 -o inet_interfaces=$smtp_default_transport_interfaces
 -o myhostname=$smtp_default_transport_hostname
 -o smtp_helo_name=$smtp_default_transport_hostname
 -o syslog_name=smtp-fwd-$smtp_default_transport_hostname
 -o bounce_queue_lifetime=0
 -o maximal_queue_lifetime=0

mysql-别名-maps.cf:

query = SELECT destination FROM `aliases` WHERE source='%s'

mysql-transport-maps.cf:

query = SELECT IF (ISNULL(destination), NULL, 'out-fwd') as transport \
FROM `aliases` \
WHERE destination='%s' \
AND destination LIKE '%%@gmail.com'

我想要完成的是“如果用户将他们的电子邮件转发到@gmail 会减少队列的生命周期。 ”

现在,当我尝试向这些用户发送电子邮件时,会发生以下情况:

postfix/qmgr[28839]: warning: connect to transport private/out-fwd,out-fwd: No such file or directory

private/out-fwd, out-fwd >为什么要重复传输名称?

如果我将查询更改为返回out-fwd:(最后是冒号),我会得到:

smtp-fwd-xxxx/smtp[23429]: fatal: valid hostname or network address required in server description: ,out-fwd:

,out-fwd: ??? 为什么?

请注意,如果我只是简单地评论该行电子邮件就可以正常transport_maps发送。default_transport = out-default

谢谢。

postfix
  • 1 个回答
  • 34 Views
Martin Hope
TCB13
Asked: 2022-04-03 14:03:18 +0800 CST

x86:驱动 SSD1351 OLED 显示器

  • 0

我有一堆像这样的 SSD1351 OLED 显示器:

在此处输入图像描述

这些是通过 SPI 接口驱动的,我在 Raspberry Pi 和其他 ARM SBC(如 NanoPi)中使用它们,并具有以下库:

  • https://github.com/rm-hull/OPi.GPIO
  • https://luma-oled.readthedocs.io/en/latest/
  • https://pillow.readthedocs.io/en/stable/

那些 ARM SBC 集成了在 Linux 中公开的 SPI /dev/spidevX.Y。

是否可以从标准 x86 计算机驱动此屏幕?我拥有一个 FT4232H 迷你模块(GPIO/UART/SPI 转 USB),还发现了 AK-MCP2210(USB 转 SPI 桥接器),但我不确定它们是否会暴露屏幕,/dev/也不确定是否luma-oled可以使用。

谢谢你。

linux display
  • 1 个回答
  • 60 Views
Martin Hope
TCB13
Asked: 2019-06-30 12:56:45 +0800 CST

Debian:2 个接口,2 个网关

  • 1

我的目标是eth0:在一个系统上有两个网络接口tap0,并且它们都有一个有效的互联网连接。我应该能够有选择地在两者中绑定服务/程序。

Apache 示例:我想创建以下虚拟主机:

  • site1.example.com绑定到85.xxx.49.100可用eth0
  • site2.example.com绑定到89.xxx.xxx.5可用tap0
  • site3.example.com绑定到89.xxx.xxx.4可用tap0

eth0系统中的程序应默认使用与外部世界通信,但也能够绑定到 IP tap0(如果需要)并将它们用于传入和传出流量。示例:我应该能够运行speedtest-cli --source="85.xxx.49.100"(IP at eth0) 和speedtest-cli --source="89.xxx.xxx.4"(IP at tap0)。


我有一台具有物理以太网接口的 Debian 机器eth0,该接口从 DHCPd 服务器获取 IP、网关和 DNS 服务器。有/etc/network/interfaces:

allow-hotplug eth0
no-auto-down eth0
iface eth0 inet dhcp

当网络上线时,我的路由表如下所示:

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         85.xxx.xxx.1    0.0.0.0         UG    0      0        0 eth0
85.xxx.49.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
link-local      0.0.0.0         255.255.0.0     U     1000   0        0 eth0

现在,我tap在这台机器上添加了一个设备(使用 OpenVPN)。OpenVPN 客户端和服务器不分配任何 IP 地址。这个想法是在机器之间只有第 2 层。这是 OpenVPN 服务器配置:

local 89.xxx.xxx.8
port xxxx
proto udp
dev tap0
mode server
tls-server
user nobody
group nogroup
tls-version-min 1.2
auth SHA512
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384
script-security 1
client-to-client
keepalive 10 60
compress
max-clients 10
cipher AES-256-CBC
persist-key
persist-tun

服务器上的网络配置为:

10-静态-eth0.network

[Match]
Name=eth0

[Network]
Bridge=br0

25-br0.netdev

[NetDev]
Name=br0
Kind=bridge

25-br0.network

[Match]
Name=br0

[Network]
DHCP=no
Address=89.xxx.xxx.8/24
Address=89.xxx.xxx.7/24
Address=89.xxx.xxx.6/24
Gateway=89.xxx.xxx.1

DNS=1.1.1.1
DNS=8.8.8.8

30-tap.network

[Match]
Name=tap0

[Network]
Bridge=br0

启动 OpenVPN 后,任何进入tap0客户端设备的以太网帧都从br0服务器出来。从理论上讲,这意味着我可以将为服务器保留的任何 IP 地址分配给tap0客户端上的设备。我尝试将 IP 添加到客户端的tap设备:

ip addr add 89.xxx.xxx.5/24 broadcast 89.xxx.xxx.255 dev tap0
ip link set tap0 up
route add default gw 89.xxx.xxx.1 metric 200
ip route add 89.xxx.xxx.8 via 85.xxx.xxx.1 dev eth0

IP 在那里,我可以同时使用 :ping -I eth0 google.com和ping google ping -I tap0 google.com,但是,例如,我不能wget将源设置为89.xxx.xxx.5- 它只是超时。

我应该如何进行?谢谢你。

networking debian
  • 2 个回答
  • 723 Views
Martin Hope
TCB13
Asked: 2019-01-14 10:50:11 +0800 CST

NanoPi M4 - RK3399:Apache2 + SSL:大型下载挂起

  • 2

我有一个在 Debian 9 下运行的全新 Apache2 设置(NanoPi M4 上的 armbian)。一切正常,直到我尝试通过 HTTPS 下载大文件。小文件下载成功,但较大的文件似乎在某些时候随机失败。 我无法使用纯 HTTP 重现此问题。示例wget(在浏览器上的行为相同):

wget https://xyz---/test.bin --no-check-certificate
--2019-01-13 18:22:22--  https://xyz---/test.bin
Resolving xyz--- (xyz---)... 85.241.xxx.xxx
Connecting to xyz--- (xyz---)|85.241.xxx.xxx|:443... connected.
WARNING: cannot verify xyz---'s certificate, issued by 'CN=Let\'s Encrypt Authority X3,O=Let\'s Encrypt,C=US':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1,0G) [application/octet-stream]
Saving to: 'test.bin.2'

test.bin.2                      39%[==================>                               ] 403,66M  11,6MB/s    eta 54s

它下载正常,直到达到 403,66M,之后没有其他任何事情发生。在服务器端(error.log)我得到这个:

ssl_engine_io.c(2135): [client 85.243.xxx.xxx:59904] OpenSSL: write 16413/16413 bytes to BIO#5588cd8c50 [mem: 5588a87c23] (BIO dump follows)
core_filters.c(525): [client 85.243.xxx.xxx:59904] core_output_filter: flushing because of THRESHOLD_MAX_BUFFER
core_filters.c(547): (70007)The timeout specified has expired: [client 85.243.xxx.xxx:59904] core_output_filter: writing data to the network
ssl_engine_io.c(2144): [client 85.243.xxx.xxx:59904] OpenSSL: I/O error, 16413 bytes expected to write on BIO#5588cd8c50 [mem: 5588a87c23]
(70007)The timeout specified has expired: [client 85.243.xxx.xxx:59904] AH01993: SSL output filter write failed.

它似乎运行core_output_filter: flushing because of THRESHOLD_MAX_BUFFER然后没有其他任何事情发生。有时我也注意到了这个错误:

ssl_engine_io.c(2135): [client 95.239.xxx.xxx:9937] OpenSSL: write 45/45 bytes to BIO#55bd9e23e0 [mem: 55bd9ec213] (BIO dump follows)
ssl_engine_io.c(2144): [client 95.239.xxx.xxx:9937] OpenSSL: I/O error, 5 bytes expected to read on BIO#55bd9e9d80 [mem: 55bd9ec213]

以下是为该请求提供服务的 VHost 的配置:

<VirtualHost *:443>
    ServerName xyz---
    ServerAdmin tcb13---
    DocumentRoot /test
    ErrorLog /test/error.log
    CustomLog /test/access.log combined

    SSLEngine on
    SSLCertificateFile /mnt/SU1/letsencrypt/config/live/xyz---/fullchain.pem
    SSLCertificateKeyFile /mnt/SU1/letsencrypt/config/live/xyz---/privkey.pem
    Header always set Strict-Transport-Security "max-age=15768000"

    LogLevel trace6
</VirtualHost>

我确定这不是网络相关问题,因为:

  1. 仅在启用 SSL 的情况下发生,在我可以毫无问题地下载的非 SSL 虚拟主机上;
  2. 其他协议(FTP 和 SCP)也可以很好地下载相同的测试文件;
  3. 使用 iperf3 测试网络时没有问题。

一些系统信息:

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.6 (stretch)
Release:        9.6
Codename:       stretch

uname -a
Linux testxyz 4.4.162-rk3399 #41 SMP Fri Oct 26 14:03:47 CEST 2018 aarch64 GNU/Linux

apache2ctl -V | grep -i "Server version"
Server version: Apache/2.4.25 (Debian)
root@testxyz:~# dpkg -l |grep apache2
ii  apache2                         2.4.25-3+deb9u6                                       arm64        Apache HTTP Server
ii  apache2-bin                     2.4.25-3+deb9u6                                       arm64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                    2.4.25-3+deb9u6                                       all          Apache HTTP Server (common files)
ii  apache2-utils                   2.4.25-3+deb9u6                                       arm64        Apache HTTP Server (utility programs for web servers)
ii  libapache2-mod-php7.3           7.3.0-2+0~20181217092659.24+stretch~1.gbp54e52f       arm64        server-side, HTML-embedded scripting language (Apache 2 module)

我怎样才能解决这个问题?谢谢你。

debian apache-httpd
  • 1 个回答
  • 2697 Views
Martin Hope
TCB13
Asked: 2018-05-04 13:52:18 +0800 CST

Debian + USB3 HDD + UAS:I/O 错误

  • 8

我正在运行 rsync 以将远程计算机备份到 ARM SBC 上的 USB 硬盘驱动器,有时 rsync 会因“从输入设备读取错误(I/O 错误)”而停止。我相信这个问题与 UAS + USB 3.0 + rsync 导致高 I/O 负载有关,因为uas_eh_device_reset_handleron /var/log/messages:

sd 0:0:0:0: [sda] tag#1 data cmplt err -32 uas-tag 2 inflight: 
sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 38 80 0a 68 00 00 a0 00
sd 0:0:0:0: [sda] tag#0 data cmplt err -32 uas-tag 1 inflight: CMD 
sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00
sd 0:0:0:0: [sda] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD 
sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 38 80 0a 68 00 00 a0 00
sd 0:0:0:0: [sda] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD 
sd 0:0:0:0: [sda] tag#2 CDB: opcode=0x2a 2a 00 19 47 7f 20 00 00 90 00
sd 0:0:0:0: [sda] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD 
sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00
scsi host0: uas_eh_device_reset_handler start
usb 5-1: reset high-speed USB device number 2 using ehci-platform
scsi host0: uas_eh_device_reset_handler success
sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] tag#0 Sense Key : 0x2 [current] 
sd 0:0:0:0: [sda] tag#0 ASC=0x3a ASCQ=0x0 
sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00
sd 0:0:0:0: [sda] tag#1 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] tag#1 Sense Key : 0x2 [current] 
sd 0:0:0:0: [sda] tag#1 ASC=0x3a ASCQ=0x0 
sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x2a 2a 00 19 47 7f 20 00 00 90 00
EXT4-fs warning (device sda1): ext4_end_bio:323: I/O error 10 writing to inode 13001563 (offset 0 size 73728 starting block 53014518)

这个 SBC 没有 USB 3 端口,但它仍然使用 UAS 加载硬盘驱动器。据此,UAS在一些高清外壳芯片上坏了。提供的解决方案是禁用 UAS,但是:

1-如果我将UAS完全列入黑名单blacklist uas,我/etc/modprobe.d/blacklist-uas.conf会得到:

lsusb -t
    /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
        |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=, 480M

查看Class=Mass Storage, Driver=, 480M=> 似乎系统没有加载任何其他方式来处理驱动器。

2-如果我只是尝试禁用特定 USB 设备的 UAS,就像推荐的帖子一样,它仍然会加载 UAS:

echo options usb-storage quirks=174c:55aa:u | tee /etc/modprobe.d/blacklist-uas.conf
update-initramfs -u
reboot

(...)

dmesg | grep sda
[    2.488105] sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
[    2.488584] sd 0:0:0:0: [sda] Write Protect is off
[    2.488592] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[    2.489335] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.539288]  sda: sda1
[    2.543875] sd 0:0:0:0: [sda] Attached SCSI disk
[    6.898109] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: errors=remount-ro,data=ordered

lsusb | grep ASMedia
Bus 005 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge

lsusb -t
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 480M

我究竟做错了什么?是否可以禁用UAS并使系统仍然以其他方式使用HD?为什么不options usb-storage quirks=174c:55aa:u按应有的方式禁用 UAS?

谢谢你。

一些注意事项:

  • 4.14.18-sunxi64操作系统:来自 armbian的 Debian GNU/Linux 9.4 (stretch) 内核
  • SBC:NanoPi NEO2
debian usb-drive
  • 3 个回答
  • 15506 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve