由于在学校申请的帐号向国外发邮件或者收邮件都要单独交纳流量费用,因此在给学校的人发送邮件时,应当使用国内的邮件服务器,而跟其它人交流,譬如订阅邮件列表,则不能使用学校的服务器。原先我是有一台服务器可以relay自己的信的,但现在那台服务器已经换了,因此发信的时候就必须特别小心。
在发邮件时,我使用esmtp,它根据我所使用的地址的不同去选择不同的SMTP服务器,因此只要在使用Mutt发信时设定好正确的邮件地址就可以了。
在前几天,这个工作我都是手工做的,不过时不时就会忘掉,也就是时不时地浪费别人的钱。为了能够不再一不小心让别人花钱,我又看了看Mutt的文档,其中的send-hook正好符合我的需要。
send-hook在发送信件时生效,无论是回复还是发送新邮件都会有用。和其它hook一样,send-hook有一个匹配条件,然后执行一些动作,我所使用的配置如下:
send-hook '~t .*\.edu\.cn$' 'unmy_hdr From:'
send-hook '~t .*\.edu\.cn$' 'my_hdr From: MyName '
这样一来,如果我给.edu.cn的邮件地址发信,都会切换到学校的地址和服务器了。
回應
In your .procmail, sort incom
In your .procmail, sort incoming email to folders:
In your .muttrc, hook folder with folder specific settings:
Thanks very much for charset
Thanks very much for charset suggestion. I used to use UTF-8 charset by default, but this makes it difficult to read my mail using some webmail systems which support gb2312 only.
And I like send-hook because I can send mail directly without changing to a specific mail folder.