Guest User

Untitled

a guest
Mar 2nd, 2018
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. use Email::Simple;
  6. use utf8;
  7.  
  8. my $input_mail;
  9. while(<DATA>){
  10. $input_mail .= $_;
  11. }
  12. my $email = Email::Simple->new($input_mail);
  13. my $from = $email->header("From");
  14. my $to = $email->header("To");
  15.  
  16. print 'hoge';
  17.  
  18.  
  19. __DATA__
  20. Return-Path: <sundar@foo.com>
  21. Received: from murder ([unix socket])
  22. (authenticated user=adam bits=0)
  23. by mail1.foo.com (Cyrus v2.2.12-OS X 10.4.0) with LMTPA;
  24. Tue, 25 Oct 2005 07:26:59 -0400
  25. X-Sieve: CMU Sieve 2.2
  26. X-Original-To: adam@mail1.internal.foo.com
  27. Delivered-To: adam@mail1.internal.foo.com
  28. Received: from localhost (localhost [127.0.0.1])
  29. by mail1.foo.com (Postfix) with ESMTP id C24ABADEA15
  30. for <adam@mail1.internal.foo.com>; Tue, 25 Oct 2005 07:26:58 -0400 (EDT)
  31. Received: from mail1.foo.com ([127.0.0.1])
  32. by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
  33. id 20330-05 for <adam@mail1.internal.foo.com>;
  34. Tue, 25 Oct 2005 07:26:55 -0400 (EDT)
  35. Received: from mta.internal.foo.com (mta.internal.foo.com [0.0.0.0])
  36. by mail1.foo.com (Postfix) with ESMTP id 1D919ADE9FE
  37. for <adam@mail1.internal.foo.com>; Tue, 25 Oct 2005 07:26:55 -0400 (EDT)
  38. Received: from [0.0.0.0] ([0.0.0.0])
  39. (authenticated bits=0)
  40. by mta.internal.foo.com (8.12.8/8.12.8) with ESMTP id j9PBQoCT026374
  41. (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO)
  42. for <adam@foo.com>; Tue, 25 Oct 2005 07:26:53 -0400
  43. Message-ID: <blah@foo.com>
  44. Date: Tue, 25 Oct 2005 07:30:17 -0400
  45. From: x <x@foo.com>
  46. Reply-To: x@foo.com
  47. User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
  48. X-Accept-Language: en-us, en
  49. MIME-Version: 1.0
  50. To: Adam Worrall <adam@foo.com>
  51. Subject: My subject
  52. X-Enigmail-Version: 0.91.0.0
  53. Content-Type: multipart/mixed;
  54. boundary="------------040701020305070002070307"
  55. X-PMX-Version: 4.6.1.107272
  56. X-Virus-Scanned: by amavisd-new at foo.com
  57.  
  58. This is a multi-part message in MIME format.
  59. --------------040701020305070002070307
  60. Content-Type: text/plain; charset=ISO-8859-1
  61. Content-Transfer-Encoding: 7bit
  62.  
  63. Blah blah
  64.  
  65. --------------040701020305070002070307--
Add Comment
Please, Sign In to add comment