Perl sendmail到列表被截断

时间:2013-05-22 17:08:12

标签: perl cgi sendmail

我正在使用基于perl的cgi页面来处理webproject。我遇到了一个随机发生的sendmail模块的奇怪问题。

问题:  Sendmail会截断最后附加的用户的电子邮件。但并非总是如此,它随机发生。我在发送电子邮件之前记录了电子邮件列表,我没有看到任何错误。

示例图片(看到卡尔的姓氏在他的名字后面被'。'截断。)

enter image description here

电子邮件的标题。

  Message-ID: <201305221503.r4MF3dYf022792@pazmo.internal.company.com>
  Subject: < ...>
  MIME-Version: 1.0
  Content-Type: text/plain
  To: <biradavolu.ln@company.com>, <dessimira.ln@company.com>,
  <yun.ln@company.com>, karl.
 Date: Wed, 22 May 2013 10:03:39 -0500
 From: <tool@company.com>
 Return-Path: tool@company.com
 X-MS-Exchange-Organization-AuthSource: eusaamw0712.domain.company.com
 X-MS-Exchange-Organization-AuthAs: Internal
 X-MS-Exchange-Organization-AuthMechanism: 10
 X-MS-Exchange-Organization-AVStamp-Mailbox: MSFTFF;1;0;0 0 0

发送电子邮件前记录的输入:(我看不出格式有什么问题)         biradavolu.ln@company.com; dessimira.ln@company.com; yun.lastName@company.com; karl.LastName@company.com;

use Mail::Sendmail;

# Step 1: Declare the mail variable
%mail = (
    from => 'test@company.com',
    to => 'user1FN.user1LN@company.com;user2FN.user2LN@company.com;user3FN.user3LN@company.com;' . "$requester_email; $responsible_email",
    subject => ... ,  
    'content-type' => "multipart/alternative; "
);

my $toList='user1FN.user1LN@company.com;user2FN.user2LN@company.com;user3FN.user3LN@company.com;' . "$requester_email;";   

# Step 2: Add members to toList based on different conditions
if(condition1)
    $toList= $toList.'user4FN.user4LN@company.com;';
if(condition2)
    $toList= $toList.'user5FN.user5LN@company.com;';

... # few other similar condition statement
...

# Step 3: Assign toList based on different conditions
$mail{ 'to' } = $toList;

# Step 4: Set Body of the $mail
if(sendmail(%mail)){
    print LOGFILE "Mail send successfully to $mail{\"to\"}:  ";
}else{
    print LOGFILE "Mail was not send : Mail list was $mail{\"to\"}  : ";
} 

1 个答案:

答案 0 :(得分:0)

疯狂猜测。你隐藏了你的用户的实际姓氏(这很好),但是有可能在姓氏上有空格的用户上总是发生“随机”截断?喜欢“圣皮埃尔”。您的字符串可能会在空格处被截断。

如果可能,请告诉我!