I set up a perl script to snap the mail by forward from .qmail file:

# to_file.pl    grasp the output by directed from .qmail
#!/usr/bin/perl -w

use strict;

open (DEST, ">>/home/test_sms/testfile.dat")||die "$!";
while (<STDIN>) {
        print DEST $_;
}
print DEST  scalar(localtime),"The Line Is End Of Here.\n";
print DEST "*" x 80;
print DEST "\n\n\n";
close (DEST);
#end********************

and the .qmail-vpc is:

[root@mail test_sms]# less /home/vpopmail/domains/vpc.jeje/.qmail-vpc
| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
| /home/test_sms/to_file.pl

so, the one copy sent to owner's localbox and another one copy written to
/home/test_sms/to_file.pl

and here is a copy of an entry of this file:

****************************************************************************
****


Received: (qmail 2050 invoked from network); 5 Jan 2003 09:03:45 -0000
Received: from unknown (HELO jerrydell) (172.16.2.122)
  by 0 with SMTP; 5 Jan 2003 09:03:45 -0000
Message-ID: <01d301c2b496$fc718f70$7a0210ac@jerrydell>
From: "Test" <[EMAIL PROTECTED]>
To: "vpc" <[EMAIL PROTECTED]>
Subject: AaBbCc1234567890*'#()
Date: Sun, 5 Jan 2003 16:46:48 +0800
MIME-Version: 1.0
Content-Type: text/plain;
        charset="gb2312"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

AaBbCc1234567890*'#()
Sun Jan  5 17:18:46 2003The Line Is End Of Here.
****************************************************************************
****

but I go to see the copy of owner's, only diffrence is
there are two lines than above:

Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]

but any mail I forward with .qmail and .qmail-EXT has no such lines
and I notice many mailling list soft only has reciept user's email address
in that tow lines in whole header.

as qmail-local trasfer this parameter to vdelivermail but can not
trasfer to a file by a pipe ?

how vdelivermail knows who is the real destination of mail if
it get a mail from mailling list?

Thanks

Jerry


Reply via email to