关于exim4configuration语法的问题

当邮件发送到本地域中的一个地址([email protected])时,我试图向邮件的发件人发送通知。

Q1:条件语法如何(上述不起作用)? :

notify_reply: driver=accept domains = +local_domains senders = ! ^.*-request@.*:\ ! ^bounce-.*@.*:\ ! ^.*-bounce@.*:\ ! ^owner-.*@.*:\ ! ^postmaster@.*:\ ! ^webmaster@.*:\ ! ^listmaster@.*:\ ! ^mailer-daemon@.*:\ ! ^root@.*:\ ! ^noreply@.* condition = ${if eq {$received_for}{[email protected]}} no_expn transport=notify_transport unseen no_verify 

Q2:如何在configuration文件中为“文本”写多行string? :

 notify_transport: driver=autoreply [email protected] to=$sender_address subject=Your mail for text="Please resend your messasge to [email protected] This is a temporary modification." 

Q1:条件对string“true”/“yes”或“no”/“false”进行操作,所以你必须使扩展的最终结果成为这些string之一。 同样, ${if不会返回绝对的真或假,它将评估语句,然后根据语句的真实性(您将这些stringclosures)返回string。 这里有一个例子:

 g3 0 /home/jj33 > exim -be > ${if eq{string}{string}{true}{false}} true > ${if eq{string}{STRING}{true}{false}} false > ${if eqi{string}{STRING}{true}{false}} true > 

重要的是要注意,“真”和“假”string是任意的,你${if可以返回任何值,但是真假对你来说是最有用的。 Anyhoo,基于你列出的条件,我会改变它:

 condition = ${if eq {$received_for}{[email protected]}{yes}{no}} 

编辑:我认为更新版本的exim可能不需要额外的“如果真”和“假”部分,所以我可能会在这里吠叫错误的树。 我认为$ received_for可能实际上不是你想要的variables,我怀疑它包含了你在运行该路由器的时间。 相反,试试这个:

 condition = ${if eqi{$local_part@$domain}{[email protected]}} 

Q2:有几种方法可以解决这个问题,但我喜欢使用$ {expand:operator:

 g3 0 /home/jj33 > exim -be > ${expand:line1\nline2} line1 line2 

所以,就你而言,这将是:

 text=${expand:Please resend your messasge to\n\[email protected]\n\nThis is a temporary modification.}