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

bradlis7's questions

Martin Hope
bradlis7
Asked: 2010-04-02 12:46:19 +0800 CST

监控绑定接口是否断开连接

  • 1

我正在尝试监视机器上的网络故障,其中一部分是监视旨在处于活动状态的接口也是“正在运行”。

如果以物理方式连接到另一个设备,以太网端口(例如eth0)将显示“正在运行”。

问题在于绑定的接口,例如bond0. 如果所有以太网设备都断开连接,它仍然表示它正在运行,并且仍然可以 ping 通。这是设计使然,还是我的系统设置不正确?该miimon选项与此有关吗?


编辑

感谢 Gregor,我发现了一个可能的问题。当我跑步cat /proc/net/bonding/bond0时,它给了我这个(注意MII Polling Interval):

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth7
MII Status: up
Link Failure Count: 0

但是在我的 /etc/modprobe.conf 中,我是这样设置的:

alias bond0 bonding
options bond0 -o bond0 mode=0 miimon=100

因此,显然,miimon 设置无法正常工作。

linux networking bonding
  • 2 个回答
  • 572 Views
Martin Hope
bradlis7
Asked: 2010-03-25 08:30:29 +0800 CST

Procmail 邮件列表(带访问控制)

  • 0

这似乎应该很容易做到,但我遇到了一些问题。

我添加了一个 cron 作业来解析 UID 大于 500 的所有用户:

## This checks if the passwd file has been updated, and generates
## the .forward file from all users whose UID > 500, excluding nobody.
* * * * *       root /usr/bin/test /etc/passwd -nt ~allusers/.forward \
&& /bin/egrep '([5-9]|[0-9]{2})[0-9]{3}' /etc/passwd | /bin/grep -v 65534 \
| /bin/cut -d ':' -f 1 > ~allusers/.forward

然后我创建了一个 .procmailrc 文件:

VERBOSE=yes
LOGFILE=/var/log/procmailrc


#Allow only certain users to send
:0
* ^From.*[email protected].*
{}
:0E
/dev/null

但是,.forward 文件显然在它到达 procmail 之前就被处理了。如果我将 .forward 文件移动到另一个文件名,我可以在 procmail 中使用它来向该文件中的用户发送电子邮件吗?

procmail mailing-list
  • 1 个回答
  • 175 Views
Martin Hope
bradlis7
Asked: 2010-03-24 14:04:41 +0800 CST

Sendmail:对本地邮件使用 SMART_HOST

  • 0

我们正在运行一个出站垃圾邮件过滤器,我们希望能够通过该过滤器发送邮件,即使它是发送给本地用户的。有没有办法强制 sendmail 使用 SMART_HOST,即使它要在本地发送?

例子

这就是我想要的。我的主机是example.com。如果我从 [email protected](使用 SMTP)向 [email protected] 发送电子邮件,我希望电子邮件从 mail.example.com 到 outbound.example.com 到 inbound.example.com,然后返回邮件.example.com。在不创建无限循环的情况下这可能吗?

linux sendmail
  • 2 个回答
  • 835 Views
Martin Hope
bradlis7
Asked: 2010-03-19 05:55:26 +0800 CST

使用 Maildir 格式的 procmail 脚本出错

  • 2

我在 /etc/procmailrc 中有这段代码:

DROPPRIVS=yes

DEFAULT=$HOME/Maildir/

:0
* ? /usr/bin/test -d $DEFAULT || /bin/mkdir $DEFAULT
{ }
:0 E
{
        # Bail out if directory could not be created
        EXITCODE=127
        HOST=bail.out
}

MAILDIR=$HOME/Maildir/

但是,当目录已经存在时,有时它会发送一封带有此错误的返回电子邮件:554 5.3.0 unknown mailer error 127. 请注意,电子邮件仍会送达,但它也会将错误代码发送回发送用户。

我通过注释掉EXITCODE和HOST线暂时解决了这个问题,但我想知道是否有更好的解决方案。

我在网络上的多个地方找到了这段代码,但真的找不到为什么这个错误会回到我身边。当我向本地用户发送电子邮件时似乎会发生这种情况。有时用户有一个.forward文件要发送给其他用户,有时没有,但结果是一样的。我也试过删除DROPPRIVS,以防它搞砸了转发,但它似乎并没有影响它。

  • 线路开始有* ? /usr/bin/test问题吗?
  • *表示一个正则表达式,但它?使它返回一个整数值,对吗?
  • 匹配的整数是什么?还是只是比较整数返回值?
  • 我需要两个块之间的空间吗?

谢谢您的帮助。

linux email procmail maildir
  • 2 个回答
  • 996 Views
Martin Hope
bradlis7
Asked: 2010-01-21 12:49:24 +0800 CST

Procmail:管道到程序,否则返回错误给发件人

  • 1

我正在尝试使用 procmail将某个域的所有消息发送到RT(请求跟踪器)。不过,这更多是关于 .procmailrc 文件的问题。

这是我当前的 .procmailrc 文件:

#Preliminaries
SHELL=/bin/sh               #Use the Bourne shell (check your path!)
MAILDIR=${HOME}        #First check what your mail directory is!
LOGFILE=${MAILDIR}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
MAILDOMAIN='rt.mydomain.com'
RT_MAILGATE="/opt/rt3/bin/rt-mailgate"
RT_URL="http://rt.mydomain.com/"

LOGABSTRACT=all

### Trying to  process using the rt-mailgate script
:0
{
# the following line extracts the recipient from Received-headers.
# Simply using the To: does not work, as tickets are often created
# by sending a CC/BCC to RT
TO=`formail -c -xReceived: |grep $MAILDOMAIN |sed -e 's/.*for *<*\(.*\)>* *;.*$/\1/'`
QUEUE=`echo $TO| $HOME/get_queue.pl`
ACTION=`echo $TO| $HOME/get_action.pl`
:0 h b w 
|/usr/bin/perl $RT_MAILGATE --queue $QUEUE --action $ACTION --url $RT_URL
}


### Upon failure, I want to send back an error message to the user, saying
###   "Queue does not exist." I took this code from the procmailex manpage.
:0 Wh: no-queue.lock
{
## Reply if error
* !^FROM_DAEMON
* !^X-Loop: [email protected]
| formail -rD 8192 no-queue.cache

  :0 ehc
  |(formail -rI"Precedence: junk" -A"X-Loop: [email protected]" ; \
    echo "The Queue or Action was invalid."; echo "--" \
    ) | $SENDMAIL -oi -t

}

您看到我的 .procmailrc 文件有问题吗?如果队列存在,它可以正常工作,但在那之后,它只是将邮件发送到 /var/mail/username。我想丢弃电子邮件并返回错误消息。

procmail
  • 1 个回答
  • 2855 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