0

我正在为 web 项目使用基于 perl 的 cgi 页面。我遇到了一个sendmail随机发生的模块的奇怪问题。

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

示例图片(请参阅 Karl 的姓氏在他的名字后面的“.”处被截断。)

在此处输入图像描述

电子邮件的标题。

  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\"}  : ";
} 
4

1 回答 1

0

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

让我知道这是否可能!

于 2013-05-22T17:32:56.947 回答