SVN Error:Valid UTF8 data...

前不久公司更新了邮件服务器,本来运行很正常的post-commit脚本就不能够发邮件了,而且每次commit后都会出现UTF-8相关的错误,错误如下:

"Error: Valid UTF-8 data"  & relay check local fail"  TITLE="SVN  "Error: Valid UTF-8 data"  & relay check local fail" />

在网上查了相关错误,都说是因为svn库里有文件的名字不是utf-8编码的。但是我建的测试库里根本全是英文名的文件,所以我的这个错误和编码无关。
之后我又发现不使用post-commit脚本的话,这个错误也不会出现。所以这个错误应该和post-commit中调用的commit-email.pl相关。

我又尝试直接使用commit-email.pl发送邮件,发现错误如下:

[root@localhost hooks]# /usr/bin/commit-email.pl    /svnstore/utf8_email 3    --from admin@abc.com -s "utf8_email" --diff  n   pm@abc.com
/usr/bin/commit-email.pl: SMTP Error:relay check local fail. (?????û?????ͨ????֤)

关于这个错误,网上查到的结果是:
553 relay check local fail.(本域用户必须通过验证)

所以第一步要解决发送 邮件失败的问题:
根据553的错误,如下修改 commit-email.pl脚本:

my ($sendmail, $smtp_server);         改为my($sendmail, $smtp_server, $username,$passwd);
$smtp_server = " smtp.abc.com";
$username='mailaccount@abc.com';
$passwd='*******';


my $smtp = Net::SMTP->new($smtp_server)
or die "$0: error opening SMTP session to `$smtp_server':$!/n";
之后加入 handle_smtp_error($smtp,$smtp->auth("$username", "$passwd"));


修改完毕后,再次直接运行commit-email.pl命令,发现错误变成:
[root@localhost hooks]#/usr/bin/commit-email.pl /svnstore/utf8_email 3 --fromadmin@abc.com -s "utf8_email" --diff n  pm@abc.com
SMTP Error: Need MIME::Base64 andAuthen::SASL todo auth

再次搜索万能的网络,得知解决方案是安装libauthen-sasl-perl包,安装方法如下:
# tar zxvf Authen-SASL-2.10.tar.gz
# cd Authen-SASL-2.10
# perl Makefile.pl
# make test   //会有错误,忽略就好
# make install    

安装成功后,发现一切问题都解决了,邮件可以正常发送,UTF8错误也没有了。这个错误还真是出现和消失的都莫名其妙啊






SVN <wbr> <wbr>'Error: <wbr>Valid <wbr>UTF-8 <wbr>data' <wbr> <wbr>& <wbr>relay <wbr>check <wbr>local <wbr>fail

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

w171066

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值