perl.pep http://www.nntp.perl.org/group/perl.pep/ ... Copyright 1998-2008 perl.org Wed, 20 Aug 2008 18:44:52 +0000 ask@perl.org Email::Simple::Creator CRLF handling broken (1 message) Email::Simple::Creator seems to be putting too many newlines into my emails. I <br/>can get the desired behaviour by changing the return value of _crlf() in <br/>Creator.pm. It comes from CPAN set to &quot;\x0d\x0a&quot;, but it works better for me <br/>if it&#39;s &quot;\x0a&quot;.<br/><br/>I use Perl v5.8.8 and Email::Simple::Creator v1.424. I also use a Qmail as <br/>MTA. OS is Linux.<br/><br/><br/>Here is my test code:<br/><br/>#!/usr/bin/perl<br/><br/>use Email::Simple;<br/>use Email::Simple::Creator;<br/>use IO::File;<br/>my $somefh = new IO::File;<br/><br/>$email_obj = Email::Simple-&gt;create(<br/> header =&gt; [<br/> From =&gt; &quot;someone@someone.com&quot;,<br/> To =&gt; &#39;se456@rohan.id.au&#39;,<br/> Subject =&gt; &#39;This is a subject&#39;<br/> ],<br/> body =&gt; &quot;This is the body&quot;<br/> );<br/><br/>open $somefh,&quot;|/var/qmail/bin/qmail-inject&quot;;<br/>print $somefh $email_obj-&gt;as_string();<br/>close $somefh;<br/><br/># --------------------------<br/><br/><br/><br/>Here is the result in Mozilla Thunderbird (Windows) when Creator.ph has <br/>&quot;\x0d\x0a&quot;:<br/><br/>&gt; From - Sat Jul 12 19:19:14 2008<br/>&gt; X-Account-Key: account2<br/>&gt; X-UIDL: 1215861550.14312.ambassador.digitalinscription.com<br/>&gt; X-Mozilla-Status: 0001<br/>&gt; X-Mozilla-Status2: 00000000<br/>&gt; X-Mozilla-Keys: <br/>&gt; Received: (qmail 14307 invoked by uid 501); 12 Jul 2008 11:19:10 -0000<br/>&gt; Message-ID: &lt;20080712111910.14306.qmail@ambassador.digitalinscription.com&gt;<br/>&gt; From: someone.com@ambassador.digitalinscription.com<br/>&gt; To: se456@rohan.id.au<br/>&gt; Subject: This is a subject<br/>&gt; <br/>&gt; Date: Sat, 12 Jul 2008 19:19:10 +0800<br/>&gt; <br/>&gt; <br/>&gt; <br/>&gt; <br/>&gt; This is the body<br/><br/><br/><br/>Here is the result in Mozilla Thunderbird (Windows) when Creator.pm has &quot;\x0a&quot;:<br/><br/>&gt; From - Sat Jul 12 19:17:58 2008<br/>&gt; X-Account-Key: account2<br/>&gt; X-UIDL: 1215861477.14298.ambassador.digitalinscription.com<br/>&gt; X-Mozilla-Status: 0001<br/>&gt; X-Mozilla-Status2: 00000000<br/>&gt; X-Mozilla-Keys: <br/>&gt; Received: (qmail 14293 invoked by uid 501); 12 Jul 2008 11:17:57 -0000<br/>&gt; Message-ID: &lt;20080712111757.14292.qmail@ambassador.digitalinscription.com&gt;<br/>&gt; From: someone.com@ambassador.digitalinscription.com<br/>&gt; To: se456@rohan.id.au<br/>&gt; Subject: This is a subject<br/>&gt; Date: Sat, 12 Jul 2008 19:17:57 +0800<br/>&gt; <br/>&gt; This is the body<br/><br/><br/>BTW I censored some of the headers above.<br/>I also checked in Outlook Express 6.<br/><br/><br/>-- <br/>Rohan Carly<br/><br/> http://www.nntp.perl.org/group/perl.pep/2008/07/msg339.html Sat, 12 Jul 2008 04:27:58 +0000 new module: Email::Address::Loose/Email::Address::JP::Mobile (1 message) Hi<br/><br/>I&#39;m going to upload 2 modules to CPAN.<br/><br/>1.<br/>Email::Address::Loose<br/>http://coderepos.org/share/browser/lang/perl/Email-Address-Loose/trunk<br/><br/>This module provides &quot;loose parse()&quot; like Email::Valid::Loose.<br/>and, it has a &quot;override Email::Adddrss::parse&quot; option.<br/><br/>The mobile carrier in Japan supply a RFC-invalid account address.<br/>They do not improve this specification still now. (e.g. foo..bar..@example.com)<br/>So, I think that Email::Address::Loose helps a Japanese web developer.<br/><br/>2.<br/>Email::Address::JP::Mobile<br/>http://coderepos.org/share/browser/lang/perl/Email-Address-JP-Mobile/trunk<br/><br/>Japanese has a various encoding,<br/>but encoding that can be used by MUA on cellular phone of Japan is limited.<br/><br/>e.g.<br/>SoftBank cellphone: iso-2022-jp, utf-8, variant utf-8<br/>(Encode::JP::Mobile support as x-utf8-softbank)<br/>DoCoMo cellphone: iso-2022-jp, Shift_JIS, variant Shift_JIS<br/>(Encode::JP::Mobile support as x-sjis-docomo)<br/><br/>Then, I wrote Email::Address::JP::Mobile that extends Email::Addrss object.<br/><br/>Any advices and patches are welcome.<br/># that is used only by Japanese, though.<br/><br/>thanks<br/><br/>-- <br/>Tomita &lt;n.tomita@gmail.com&gt;<br/>http://e8y.net/<br/>http://search.cpan.org/~tomita/<br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg337.html Sat, 28 Jun 2008 19:27:49 +0000 I hate Unicode (3 messages) (Dangitall, if 7-bit ASCII was good enough for Fidonet, it ought to be <br/>good enough for email. Kids these days.)<br/><br/>I&#39;m getting this when I try to retrieve<br/>$SomeEmailMimeMessage-&gt;header(&#39;subject&#39;):<br/><br/>Unknown encoding &quot;X-UNKNOWN&quot; at /usr/lib/perl/5.8/Encode.pm line 166<br/><br/>A fair cop, the subject line *does* go all &quot;=?X-UNKNOWN?Q?Re=3A_&quot; and some <br/>junk. In weird cases like this I just want to preserve it as is, so I go <br/>to Encode to see how best to tell it to ignore crazy talk.<br/><br/>Hmm. Encode&#39;s POD sez ignoring it is default behavior already. But it <br/>also sez, it sez:<br/><br/>&quot;Some encodings ignore CHECK argument. For example, Encode::Unicode <br/>ignores CHECK and it always croaks on error.&quot;<br/><br/>Well, crud. But here&#39;s the funky thing, that I&#39;m not quite getting: it&#39;s <br/>not happening when I *create* $SomeEmailMimeMessage. I could deal with <br/>that. It&#39;s happening when I *look* at that header. Why is that, and how <br/>can I trap it (or ideally, detect it when I first load up the message)?<br/><br/>Or should I not be handing Email::MIME something that&#39;s gone through <br/>encode(&#39;unicode&#39;, $mailstring) at all? It&#39;s mail that was improperly <br/>stored in an SQL-ASCII database, and is going into a UNICODE database, so <br/>it&#39;s a one-time conversion utility on what may well be lightly-fried data. <br/>If this is something that&#39;s never going to come up on fresh mail, I can <br/>code for the finite number of exceptions in this database.<br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg332.html Thu, 26 Jun 2008 12:38:30 +0000 bug in MIME::Entity make_singlepart (5 messages) <br/>I thought I&#39;d cc the list since this is sort of a weird, fun bug.<br/><br/>Sometimes, when collapsing a message into single part, the C-T is horked up.<br/><br/>It starts as:<br/><br/> Content-Type: multipart/related; boundary=xyzzy; type=foo<br/><br/>...and ends as:<br/><br/> Content-Type: text/plain; boundary=xyzzy; type=foo<br/><br/>Erk! Boundary? Type? What?<br/><br/>Demonstration attached.<br/><br/>-- <br/>rjbs<br/><br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg330.html Thu, 26 Jun 2008 10:37:23 +0000 parse out the email body (5 messages) Hi,<br/> <br/>I want to be able to read a MIME encoded email file (Thunderbird) and <br/>have a way of returning just the VIEWABLE body part.<br/>I tried Email::Simple but I get all the MIME encoding and both the TEXT <br/>and the HTML parts.<br/>I tried Mail::Internet but then besides everything that Email::Simple <br/>gives I also get all the header data as part of the body.<br/>and I tried Email::MIME but as per the documentation all I got then was <br/>&quot;This is a multi-part message in MIME format.&quot; I&#39;m not sure how that is <br/>the BODY, but its not the VIEWABLE BODY that I was looking for.<br/><br/>Any help?<br/><br/> my $obj = Mail::Internet-&gt;new([ /\n/, $message ] ); <br/> my $body = $obj-&gt;body;<br/> print @$body,&quot;\n&quot;;<br/> That returned the entire email, headers and everything, so much for <br/>getting the body.<br/><br/><br/> my $email = Email::Simple-&gt;new($message);<br/> my $old_body = $email-&gt;body;<br/> print &quot;Body: $old_body\n&quot;;<br/> This is a bit better at least it removed the headers but still <br/>leaves in all the MIME and stuff.<br/><br/>eg.<br/>------=_NextPart_000_016D_01C8C0EF.6816A390<br/>Content-Type: text/html;<br/> charset=&quot;us-ascii&quot;<br/>Content-Transfer-Encoding: quoted-printable<br/><br/>&lt;html xmlns:v=3D&quot;urn:schemas-microsoft-com:vml&quot; =<br/>xmlns:o=3D&quot;urn:schemas-microsoft-com:office:office&quot; =<br/>xmlns:w=3D&quot;urn:schemas-microsoft-com:office:word&quot; =<br/>xmlns=3D&quot;http://www.w3.org/TR/REC-html40&quot;&gt;<br/><br/>&lt;head&gt;<br/>&lt;META HTTP-EQUIV=3D&quot;Content-Type&quot; CONTENT=3D&quot;text/html; =<br/><br/>Thanks.<br/><br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg325.html Wed, 25 Jun 2008 01:43:58 +0000 ANNOUNCE: Dada Mail 3.0 Released (1 message) Thought people may be interested in this - this is the first Major (2 - <br/> &gt; 3) release of the program since 2000. Not to say I&#39;ve been <br/>lollygagging for that long or anythin&#39;<br/><br/>Download Dada Mail:<br/><br/> http://dadamailproject.com/download<br/><br/>Dada Mail is a Free Download. We suggest upgrading any version of Dada <br/>Mail created to Dada Mail 3.<br/><br/>For a quick tour of the new features:<br/><br/> http://dadamailproject.com/features/3_0/<br/><br/>:: What is Dada Mail?<br/><br/>Dada Mail is a completely contemporary, mature and intuitive web-based <br/>e-mail list management system, which runs on most any Unix-like <br/>hosting account that can run custom CGI scripts. Dada Mail is also a <br/>conceptual art project.<br/><br/>Dada Mail handles Closed-Loop Opt-in/Opt-out subscriptions, sending <br/>complex announce-only and/or discussion mailing list messages with an <br/>advanced, fault-tolerant mass mailing monitor, supports the archiving/ <br/>viewing/searching/resending/syndicating (rss, atom) of sent messages <br/>and doing all this and a whole lot more with style.<br/><br/>Dada Mail can handle custom subscriber fields and you can use the <br/>information it captures for partial list sending based on a query and <br/>Dada Mail&#39;s email templating system allows you to create targeted and <br/>completely custom email messages for each and every one one of your <br/>subscribers.<br/><br/>Dada Mail is bundled with additional plugins and extensions to extend <br/>Dada Mail&#39;s capabilities. Some of the plugins/extensions support <br/>advanced bounce handling, click-through tracking, mass mail <br/>scheduling, blog interfaces of archived messages, AJAX subscription <br/>form trickery and lots of other surprises.<br/><br/>Dada Mail produces XHTML valid web content and sticks to best <br/>practices when creating email messages. Write Once: Distribute <br/>Everywhere. Dada Mail is free software that you&#39;re able to use, <br/>modify, share and enhance under the terms of the GNU General Public <br/>License. Dada Mail is written in Perl because we love Perl.<br/><br/>:: The Dada Mail Demo<br/><br/>Want to play around with the program before downloading? Try our demo:<br/><br/> http://demo.dadamailproject.com<br/><br/>:: Installation Instructions:<br/><br/> http://dadamailproject.com/installation/<br/><br/>:: Docs:<br/><br/> http://dadamailproject.com/support/documentation<br/><br/><br/>:: Change Log:<br/><br/> http://dadamailproject.com/support/documentation-dada-3_0_0/changes.pod.html<br/><br/>Cheers,<br/><br/>Justin<br/>http://dadamailproject.com<br/><br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg324.html Wed, 25 Jun 2008 01:33:06 +0000 help getting email body (4 messages) Hi,<br/><br/>I want to be able to read a MIME encoded email file (Thunderbird) and have a<br/>way of returning just the VIEWABLE body part.<br/>I tried Email::Simple but I get all the MIME encoding and both the TEXT and<br/>the HTML parts.<br/>I tried Mail::Internet but then besides everything that Email::Simple gives<br/>I also get all the header data as part of the body.<br/>and I tried Email::MIME but as per the documentation all I got then was<br/>&quot;This is a multi-part message in MIME format.&quot; I&#39;m not sure how that is the<br/>BODY, but its not the VIEWABLE BODY that I was looking for.<br/><br/>Any help?<br/><br/> my $obj = Mail::Internet-&gt;new([ /\n/, $message ] ); my $body =<br/>$obj-&gt;body;<br/> print @$body,&quot;\n&quot;;<br/> That returned the entire email, headers and everything, so much for getting<br/>the body.<br/><br/><br/> my $email = Email::Simple-&gt;new($message);<br/> my $old_body = $email-&gt;body;<br/> print &quot;Body: $old_body\n&quot;;<br/> This is a bit better at least it removed the headers but still leaves in<br/>all the MIME and stuff.<br/><br/>eg.<br/>------=_NextPart_000_016D_01C8C0EF.6816A390<br/>Content-Type: text/html;<br/> charset=&quot;us-ascii&quot;<br/>Content-Transfer-Encoding: quoted-printable<br/><br/>&lt;html xmlns:v=3D&quot;urn:schemas-microsoft-com:vml&quot; =<br/>xmlns:o=3D&quot;urn:schemas-microsoft-com:office:office&quot; =<br/>xmlns:w=3D&quot;urn:schemas-microsoft-com:office:word&quot; =<br/>xmlns=3D&quot;http://www.w3.org/TR/REC-html40&quot; &lt;http://www.w3.org/TR/REC-html40&gt;&gt;<br/><br/><br/>&lt;head&gt;<br/>&lt;META HTTP-EQUIV=3D&quot;Content-Type&quot; CONTENT=3D&quot;text/html; =<br/><br/>Thanks.<br/><br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg320.html Tue, 24 Jun 2008 20:19:48 +0000 new server: some organizational questions: (2 messages) <br/>For boring reasons, I&#39;m moving emailproject.perl.org to a new box.<br/><br/>My plan is to just port over the existing Subversion repository and MediaWiki.<br/><br/>If you want to demand major changes, this is the time to do it.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2008/06/msg319.html Tue, 24 Jun 2008 18:29:48 +0000 Problem with attachment, 1 becomes 10 (7 messages) Hi,<br/>I&#39;m new to this list.<br/><br/>I&#39;m trying to write a program that can send out mails to companies where <br/>I&#39;m interested in working. These mails are the same except that the <br/>company name is switched. My CV should be attached as a pdf-file.<br/>The problem is that I don&#39;t get one attachment, but ten! Also the <br/>message is repeated 10 times. If I change the program by uncommenting <br/>the commented line in the function load it works but then it doesn&#39;t <br/>send the correct pdf-file. The CV is 129490 bytes. How could I change <br/>this program so that there is only one attachment and no repeated messages?<br/><br/>In the program below some long lines might have been splitted.<br/><br/>#!/usr/bin/perl<br/><br/># jobapplier.pl vN/A (Buggy!)<br/># Author: Mikael O. Bonnier, mikaelb@df.lth.se, <br/>http://www.df.lth.se/~mikaelb/<br/># Copyright (C) 2008 by Mikael O. Bonnier, Lund, Sweden.<br/># License: GNU GPL v3 or later, http://www.gnu.org/licenses/gpl-3.0.txt<br/><br/>use strict;<br/>use Email::Send;<br/>use Email::Simple::Creator;<br/>use Email::MIME::Modifier;<br/>use DBI;<br/>use MIME::Words qw/encode_mimewords/;<br/>use File::stat;<br/><br/>my %settings = (<br/> SMTP =&gt; &#39;mail.df.lth.se&#39;,<br/> PORT =&gt; 588,<br/> FROM_DOMAIN =&gt; &#39;cust.bredbandsbolaget.se&#39;,<br/> DB =&gt; &#39;jobapplier_test&#39;,<br/> DB_HOST =&gt; &#39;localhost&#39;,<br/> FROM =&gt; &#39;mikaelb@df.lth.se&#39;,<br/> SUBJECT =&gt; &#39;Intresseanm&auml;lan som fysiker eller programutvecklare&#39;,<br/> BODY =&gt;<br/> &#39;Det skulle vara intressant att jobba hos er p&aring; $cCompany.&#39;,<br/> UPLDDIR =&gt; &#39;../Documents/LyX&#39;,<br/> FILE =&gt; &#39;MOB_CV.pdf&#39;,<br/>);<br/>@ARGV == 4<br/> or die<br/>&#39;Provide username and password for the SMTP and the MySQL server, <br/>respectively,&#39;<br/> . &quot; on the command line.\n&quot;;<br/>@settings{qw( USER PASS DB_USER DB_PASS)} = @ARGV;<br/><br/>my $dbh = DBI-&gt;connect( &quot;DBI:mysql:$settings{DB}:$settings{DB_HOST}&quot;,<br/> $settings{DB_USER}, $settings{DB_PASS} );<br/><br/>my $q = q|select cCompany, cEmail<br/> from Contacts<br/> order by cId asc|;<br/>my $sth = $dbh-&gt;prepare($q);<br/>$sth-&gt;execute;<br/>my $as = [];<br/>while ( my $hr = $sth-&gt;fetchrow_hashref ) {<br/> push @{$as}, $hr;<br/>}<br/>$dbh-&gt;disconnect;<br/><br/>my $mailer = Email::Send-&gt;new(<br/> {<br/> mailer =&gt; &#39;SMTP::TLS&#39;,<br/> mailer_args =&gt; [<br/> Host =&gt; $settings{SMTP},<br/> Port =&gt; $settings{PORT},<br/> User =&gt; $settings{USER},<br/> Password =&gt; $settings{PASS},<br/> Hello =&gt; $settings{FROM_DOMAIN},<br/> ]<br/> }<br/>);<br/><br/>for my $row (@$as) {<br/> my $body_text = $settings{BODY};<br/> $body_text =~ s/\$cCompany/$row-&gt;{cCompany}/g;<br/> my $email = Email::Simple-&gt;create(<br/> header =&gt; [<br/> From =&gt; $settings{FROM},<br/> To =&gt; $row-&gt;{cEmail},<br/> Subject =&gt; encode_mimewords( $settings{SUBJECT} ),<br/> &#39;Content-Type&#39; =&gt; &#39;text/plain; charset=&quot;utf-8&quot;&#39;,<br/> ],<br/> body =&gt; $body_text,<br/> );<br/> my $body = load( $settings{UPLDDIR}, $settings{FILE} );<br/> my $part = Email::MIME-&gt;new(&#39;&#39;);<br/> $part-&gt;body_set($body);<br/> $part-&gt;disposition_set(&#39;attachment&#39;);<br/> $part-&gt;name_set( $settings{FILE} ); # Both needed?<br/> $part-&gt;filename_set( $settings{FILE} ); # Both needed?<br/> $part-&gt;encoding_set(&#39;base64&#39;);<br/> $part-&gt;content_type_set(&#39;application/octet-stream&#39;);<br/> my @more_parts = ($part);<br/> $email = Email::MIME-&gt;new( $email-&gt;as_string );<br/> $email-&gt;parts_add( \@more_parts );<br/><br/> eval { $mailer-&gt;send($email) };<br/> die &quot;Error sending email: $@&quot; if $@;<br/>}<br/><br/>sub load {<br/> my ( $upldDir, $inFile ) = @_;<br/> my $DNLDFILE;<br/> open $DNLDFILE, &#39;&lt;&#39;, &quot;$upldDir/$inFile&quot;;<br/> binmode $DNLDFILE;<br/> my $st = stat $DNLDFILE;<br/> my $content;<br/> read $DNLDFILE, $content, $st-&gt;size;<br/> close $DNLDFILE;<br/><br/> # $content = &#39;ABC&#39;;<br/> return $content;<br/>}<br/><br/>__END__<br/><br/>Regards,<br/>// Mikael Bonnier<br/>----<br/>// Web: http://www.df.lth.se/~mikaelb/<br/>// E-mail/MSN: mikaelb@df.lth.se<br/>// ICQ # 114635318<br/>// Mob/SMS/MMS: +46730307498<br/>// Phone: +4646323208<br/>// Skype: mikael4u<br/> http://www.nntp.perl.org/group/perl.pep/2008/05/msg312.html Sun, 04 May 2008 17:50:03 +0000 Announcement: Net::Server::Mail::ESMTP::SIZE (1 message) Hi,<br/><br/> Another announcement. Just released to CPAN <br/>Net::Server::Mail::ESMTP::SIZE. I&#39;ve commented a bit more on:<br/><br/> http://www.pplusdomain.net/cgi-bin/blosxom.cgi<br/><br/>Cheers,<br/><br/>Jose Luis Martinez<br/>jlmartinez@capside.com<br/>CAPSiDE<br/> http://www.nntp.perl.org/group/perl.pep/2008/04/msg311.html Wed, 30 Apr 2008 18:04:29 +0000 Announcement Test::SMTP module released (2 messages) Hi,<br/><br/> I released a week ago Test::SMTP. This module is a helper for writing <br/>tests for SMTP servers. I basically announced it on the qpsmtpd list, <br/>but I&#39;ve just found this list, so I&#39;m reannouncing:<br/><br/>---<br/> More info on it on http://www.pplusdomain.net/cgi-bin/blosxom.cgi<br/><br/> Just wanted to apport this testing framework so the quality of <br/>qpsmtp can go up, as automated tests are easier to write, plugin <br/>behaviour can be fully tested, and broken functionalities because of <br/>changes to the core can be predicted.<br/><br/> Please give me your two cents on the module, and if it&#39;s lacking <br/>something, or would like something more on it.<br/>---<br/><br/>Please, don&#39;t doubt in critisizing the module.<br/><br/>Jose Luis Martinez<br/>CAPSiDE<br/>jlmartinez@capside.com<br/> http://www.nntp.perl.org/group/perl.pep/2008/04/msg309.html Mon, 28 Apr 2008 13:16:09 +0000 validating email addresses (4 messages) Hello,<br/><br/>I use Email::Valid to check the syntax and MX record. I&#39;m wondering if<br/>there is any best practice for the next steps:<br/><br/>- verify the existence of the mailbox<br/>- send an email requiring a reply<br/><br/>Is either technique worth doing? Is there a module that helps? Or<br/>perhaps it is better to use a captcha instead/as well. Any pointers to<br/>code or discussions would be helpful. I haven&#39;t found much by searching.<br/><br/>Thanks, Dave<br/> http://www.nntp.perl.org/group/perl.pep/2008/04/msg305.html Thu, 17 Apr 2008 02:43:22 +0000 Developer release of Email::VirusScan (3 messages) As the next step on the road to cleaning up the mimedefang.pl code, I&#39;ve<br/>factored the virus scanner integration out into a separate set of<br/>modules -- Email::VirusScan.<br/><br/>The modules are now available as a developer release on CPAN, available<br/>from http://search.cpan.org/dist/Email-VirusScan/<br/><br/>The virus scanning engines supported are all of those supported by<br/>MIMEDefang, with the exception of two or three that I didn&#39;t bother<br/>converting as they appeared to be entirely obsolete.<br/><br/>In a future release of MIMEDefang, this virus scanner code will replace<br/>the current virus scanner methods in mimedefang.pl. The immediate<br/>benefit will be the removal of about 2k lines of virus scanner code in<br/>favour of loading only the necessary modules. This should save a couple<br/>hundred kb of memory per scanning slave. In the long term, being able<br/>to validate and test virus scanner plugins outside of MIMEDefang should<br/>be a big win.<br/><br/>But first, before it gets integrated into MIMEDefang, it needs testing.<br/>The ClamAV::Clamscan and ClamAV::Daemon modules are relatively well<br/>tested, but the modules for scanners I don&#39;t have access to are almost<br/>entirely untested.<br/><br/>I would appreciate it if anyone using one of the supported virus engines<br/>would download this code, try it out, and provide feedback. Patches<br/>and bug reports can be sent to the list or to me directly.<br/>Alternatively, if you are willing to provide me with shell access on a<br/>system with one of the supported scanners, I will run the tests and make<br/>any necessary fixes.<br/><br/>Cheers,<br/>Dave<br/>-- <br/>Dave O&#39;Neill &lt;dmo@roaringpenguin.com&gt; Roaring Penguin Software Inc.<br/>+1 (613) 231-6599 http://www.roaringpenguin.com/<br/>For CanIt technical support, please mail: support@roaringpenguin.com<br/> http://www.nntp.perl.org/group/perl.pep/2008/04/msg302.html Thu, 10 Apr 2008 11:16:45 +0000 Announcement: Email::Builder (1 message) Hello!<br/>I&#39;d like to announce a new stable version of the Mail-Builder module at <br/>CPAN. The module facilitates the creation of e-mail messages with <br/>attachments, inline images and html content.<br/><br/>A short example how the module works:<br/><br/> use Mail::Builder;<br/> <br/> my $mail = Mail::Builder-&gt;new();<br/> <br/> $mail-&gt;from(&#39;mightypirate@meele-island.mq&#39;,&#39;Guybrush Threepwood&#39;);<br/><br/> $mail-&gt;to(&#39;manuel.calavera@dod.mx&#39;,&#39;Manuel Calavera&#39;); <br/> $mail-&gt;cc-&gt;add(&#39;meche@lod.mx&#39;,&#39;Mercedes Colomar&#39;);<br/> $mail-&gt;cc-&gt;add(&#39;glotis@dod.mx&#39;);<br/> # To,CC and BCC fields (as well as attachments and images) are <br/>handled as list objects. There are several utility methods to work with <br/>these lists (add new item, remove item, serialize, find, ...)<br/><br/> $mail-&gt;subject(&#39;Party at Sam\&#39;s place&#39;);<br/> # The module has accessors for subject lines, priority, language, <br/>sender organisation, charset, ...<br/><br/> $mail-&gt;htmltext(&#39;&lt;h1&gt;Party invitation&lt;/h1&gt; ... &lt;img src=&quot;cid:logo&quot;/&gt; &#39;);<br/> # Mail-Builder automatically converts HTML code to plaintext with <br/>pseudo markup if you don&#39;t provide it yourself<br/><br/> $mail-&gt;attachment-&gt;add(&#39;direction_samandmax.pdf&#39;);<br/> # Mail-Builder tries to guess the correct mime type if you don&#39;t <br/>provide it yourself.<br/><br/> $mail-&gt;image-&gt;add(&#39;logo.gif&#39;);<br/><br/> print $mail-&gt;stringify;<br/><br/>Mail-Builder uses modules like Email::MessageID, MIME::Tools and <br/>MIME::Types and works well with Email::Send.<br/><br/>I&#39;d be glad about hearing feedback from you.<br/><br/>Cheers<br/>Maros<br/> http://www.nntp.perl.org/group/perl.pep/2008/02/msg296.html Fri, 22 Feb 2008 06:22:19 +0000 Email::Classifier (13 messages) Hi!<br/><br/>I have looked at Mail::DeliveryStatus::BounceParser<br/><br/>and I needed to use it in combination with Mail::IMAPClient and<br/>IMAP::BodyStructure.<br/><br/>The MD::BounceParser seemed to bee a bit disorganized and had seems to<br/>have the assumption that you only would want to use it for finding out<br/>email-addresses to remove from send-lists.<br/><br/>I was looking for something to get a lot of information from any email<br/>message, for the purpose of updating a CRM database. For that, it would<br/>be interesting to analyze vacation messages, attached v cards and more.<br/><br/>I also want to catch all automated emails and do the right thing with<br/>them, in updating the CRM database, or mark an entry for followup.<br/><br/>Therefore, it should catch anything that doesn&#39;t have to be manually<br/>handled by a human. The rest of the email should be sorted into the<br/>right &quot;Request Tracker&quot; queue.<br/><br/>I&#39;m using IMAP because I think that it&#39;s more fault tolerant. If a<br/>process dies or misbehaves, you can still find the original messages on<br/>the IMAP server, using a regular IMAP client.<br/><br/>And since the Emails are administrated, in relationship with customer<br/>and project information, through a web interface, I think it&#39;s important<br/>to NOT download all those big attachments that are sent around all the<br/>time. All the email handling can be done without having to download,<br/>read into memory, or parse the parts of the message not relevant for<br/>sorting.<br/><br/>I looked around a bit, and found some commonly used terms in regard of<br/>email bounce handling. I think it would be nice to introduce the<br/>classification of a bounce message in the categories of<br/><br/> hard<br/> soft<br/> transient<br/><br/>Depending of what you want to do, you will treat these cases differently.<br/>A hard bounce is a response that the mailbox no longer exist. A soft<br/>bounce is a mailbox over quota or some other thing that may not be a<br/>permanent condition, but could be. A transient bounce is just a status<br/>report and not a failure. But I still want to catch those transient<br/>error messages. They should certainly not go into the request queue, but<br/>they should still be parsed and used to update the status of the<br/>original email and receiving user. This can be done then there is a<br/>custom built web interface for the email handling.<br/><br/><br/><br/>Anyway...<br/><br/><br/>I have set up Email::Classifier. I just took all the code of<br/>MD::BounceParser and converted it. It uses modules that loads on<br/>demand. Most of the code ended up in the Email::Classifier::Bounce<br/>module, that still needs a lot of cleaning up.<br/><br/>The Email::Classifier::Bounce module, in turn, loads it&#39;s own plugin<br/>modules for handing different types of bounces. For now, I created<br/>Email::Classifier::Bounce::AOL_Senderblock.<br/><br/>A lot of MD::Bounceparser code has been cleaned up, corrected and<br/>simplified. But there are bits not yet converted.<br/><br/>Still, it passes all the original tests from MD::Bounceparser<br/><br/><br/>And here is the package:<br/><br/>http://jonas.liljegren.org/perl/dist/Email-Classifier-0.01.tar.gz<br/><br/>-- <br/>/ Jonas - http://paranormal.se/Jonas_Liljegren.html<br/> http://www.nntp.perl.org/group/perl.pep/2008/02/msg288.html Sun, 17 Feb 2008 16:50:58 +0000 IMAP and message modification (2 messages) ! Email:: directly but the third step in my quest.<br/><br/>I&#39;ve read (most of) the IMAP RFCs and searched and looked at many of the <br/>CPAN modules that deal with IMAP but I&#39;m having no success finding what <br/>I&#39;m looking for. I&#39;m probably using the wrong terminology.<br/><br/>Is is possible to have an IMAP client modify or add a header to a <br/>message on the server?<br/><br/>This is part of a reporting system and once a message has been reported <br/>I don&#39;t want it to be reported again.<br/><br/>Currently I have direct access to the files on the (MS Windows) mail <br/>server and use Mail::Box and friends but appear to be running into into <br/>share or network issues. I&#39;d like to make this reporting a little more <br/>generic and IMAP access seems like the way to go. May not help network <br/>issues but it should future proof if the email software vendor decides <br/>to change their file format.<br/><br/>So I&#39;ll start here as I&#39;ve been using several Email modules to test IMAP <br/>access to collect and report messages.<br/><br/>Is the something in the IMAP protocol to modify message headers? Is it <br/>accessible via any of the Email modules?<br/><br/><br/>Thanks,<br/>Rod<br/>-- <br/> http://www.nntp.perl.org/group/perl.pep/2008/01/msg286.html Mon, 14 Jan 2008 14:08:47 +0000 Email::Corpus building (1 message) <br/>To build a corpus distribution, you&#39;ll use Module::Install::EmailCorpus. It<br/>will cause &#39;make&#39; to build an SQLite database out of the contents of ./corpus<br/>(see below) and will cause that file ot be installed to the package&#39;s sharedir.<br/><br/>./corpus will contain one directory per message, each of which will contain a<br/>&quot;message&quot; file and a &quot;meta&quot; file. The &quot;meta&quot; file will contain a single YAML<br/>document with a sequence of data about the message.<br/><br/>Every message will have a guid. (Module::Install::EmailCorpus will, I hope,<br/>provide a &#39;make guidify&#39; to add guids where needed, and will refuse to &#39;make<br/>dist&#39; if not every message has one.) A sample meta file might be:<br/><br/> ---<br/> guid: 3F2504E0-4F89-11D3-9A0C-0305E82C3301<br/> tags:<br/> - mime<br/> - crlf:lf<br/> - 8bit<br/><br/> Email::Corpus::Magic:<br/> magic: 1<br/> moon: full<br/><br/>The meaning of package-named mapping entries are left up to the owner of the<br/>namespace to define, by convention.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2008/01/msg285.html Fri, 11 Jan 2008 15:45:56 +0000 Email::Corpus (1 message) <br/>Two emails. First, a sample of what I think it will look like:<br/><br/> use Email::Corpus;<br/> use Test::More;<br/> use Hypthetical::DKIM::Tester qw(check_dkim);<br/><br/> my $collection = Email::Corpus-&gt;search({<br/> package =&gt; [ -Core, -DKIM ],<br/> name =&gt; $name,<br/> tags =&gt; [ qw(mime tnef) ],<br/> filter =&gt; sub { exists $_-&gt;meta-&gt;{dkim} },<br/> });<br/><br/> plan tests =&gt; $collection-&gt;count;<br/><br/> while (my $email = $collection-&gt;next) {<br/> my ($pkg, $guid) = map { $email-&gt;$_ } qw(package guid);<br/><br/> is(<br/> check_dkim($email-&gt;abstract),<br/> $email-&gt;meta-&gt;{dkim},<br/> &quot;expected dkim result on $guid in $pkg&quot;,<br/> );<br/> }<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2008/01/msg284.html Fri, 11 Jan 2008 15:35:49 +0000 (non-)progress on Email::Base and Email::Sender (1 message) <br/>I&#39;m tired of trying to fix hard-to-fix issues in Email::Send, and tired of<br/>saying, &quot;Yeah yeah, Email::Sender someday soon blah blah.&quot;<br/><br/>So, I&#39;m doing a bit more work on it. Here are my current thoughts:<br/><br/>Email::Base is good enough for now. All it does is provide -&gt;throw, which is<br/>enough. Someday, I imagine there will be more to it.<br/><br/>The big thing it doesn&#39;t do that we talked about is a generic constructor and<br/>attributes. This isn&#39;t a big thing, but it&#39;s starting to mildly irritate me as<br/>I work on Email::Sender. I don&#39;t want to just &quot;bless $arg =&gt; $class&quot;, and I<br/>don&#39;t want to say, &quot;all guts are available to all subclasses&quot; or &quot;stick your<br/>subclass&#39;s guts in $self-&gt;{__PACKAGE__}. These all suck.<br/><br/>Also, I&#39;ve refactored &quot;args for the Sender&quot; from &quot;envelope data.&quot; Given a mail<br/>with a &quot;prec&quot; send-time option, this is still correct:<br/><br/> $sender-&gt;send($email, { to =&gt; $rcpt, from =&gt; $sender, prec =&gt; &#39;bulk&#39; });<br/><br/>...but it is turned into:<br/><br/> $sender-&gt;send_email(<br/> $email,<br/> { to =&gt; $rcpt, from =&gt; $sender },<br/> { prec =&gt; &#39;bulk&#39; },<br/> );<br/><br/>Now, you end up writing:<br/><br/> sub send_email {<br/> my ($self, $email, $env, $arg) = @_;<br/> ...<br/> }<br/><br/>Blech. What I really want is something we&#39;ve long talked about internally at<br/>work, and something that DaveO and I talked about once or twice at YAPC:<br/>messages with attached envelopes. Email + Envelope = Delivery. The you say:<br/><br/> $sender-&gt;send($email, { to =&gt; $rcpt, from =&gt; $sender, prec =&gt; &#39;bulk&#39; });<br/><br/>...and it becomes:<br/><br/> $sender-&gt;send($delivery, { prec =&gt; &#39;bulk&#39; });<br/><br/>If you already have a Delivery ready to go, you pass it to the $sender-&gt;send to<br/>begin with.<br/><br/>The way I see it, a Delivery does the Email and Envelope roles. It has-a Email<br/>and has-a Envelope, and delegates the roles to them. This (plus the pair of<br/>fuzzy antler headgear I received for Christmas) is making me start to decide<br/>that I&#39;m going to say &quot;screw it&quot; and use Moose. If Email::Sender is a Moose<br/>object, it becomes very simple to deal with the attribute issues. I also think<br/>(but cannot yet prove) that it will make Email::Sender::Wrapper trivial to do<br/>away with, letting Email::Sender::Failable operate directly on concrete Sender<br/>classes.<br/><br/>I will start work on this in the next week, and it should be very easy. If you<br/>have objections, voice them now.<br/><br/>My only concern at the moment is that I want the Email role to be easy to grow<br/>in the future. I&#39;ll spill my guts on some of that now:<br/><br/>I want method naming to be uniform across all of these classes, and I think it<br/>may have to be set/get. Here is why: headers. It is very convenient to say:<br/><br/> $email-&gt;header($header_name);<br/><br/>This is also convenient:<br/><br/> $email-&gt;header($header_name =&gt; $value);<br/><br/>This starts to get weird:<br/><br/> $email-&gt;header($header_name =&gt; $value, $value2);<br/><br/>This sucks:<br/><br/> $email-&gt;header($header_name =&gt; undef);<br/><br/>I&#39;m also not crazy about &quot;well you use set to set it to anything except for<br/>nothing, which requires delete.&quot; I could be convinced, though. There&#39;s always<br/>&quot;setting multiple values requires an array ref, and [] clears.&quot; I don&#39;t know,<br/>I welcome thoughts on the matter.<br/><br/>There will be a EmailHeader role, I think. I&#39;m not sure how it will work yet,<br/>either. I will probably steal or at least think about stealing from Mail::Box,<br/>which does some cool stuff with how bodies and headers interact.<br/><br/>Ok, this message is now officially too long. I look forward to hearing your<br/>thoughts.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/12/msg282.html Sun, 30 Dec 2007 11:50:21 +0000 pep and 5.005 (1 message) <br/>I was mildly surprised when I saw Michael Schwern&#39;s recent announcement that he<br/>would no longer be supporting 5.005. I was happy to see it, though, because my<br/>plan has been to drop 5.005 support, with perl 5.010 coming out.<br/><br/>This will mean, at the very least, that &#39;warnings&#39; and &#39;our&#39; will no longer be<br/>taboo. I&#39;m not going to go out of my way to break things, but as modules get<br/>worked on, I will no longer shy away from breaking compatibility with perls<br/>more than seven years old.<br/><br/>Email::Date::Format, today&#39;s new module, requires 5.006. In a few days,<br/>MIME::Lite will require it (to drop Email::Date) and I&#39;m sure more will follow.<br/><br/>That&#39;s all -- I hope everyone&#39;s upgraded sometime in the last seven years.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/11/msg279.html Fri, 30 Nov 2007 19:06:00 +0000 How to update (header added) a message via IMAP (1 message) I&#39;m (re)writing a script to do reports on email caught by SPAM filters <br/>that isn&#39;t really SPAM to the user. This script reads the <br/>folder/mailbox then sends a message with a list of the messages.<br/><br/>Sender( From: ), Subject, Date, Size<br/><br/>to the user.<br/><br/>The current (and not working) version was broken when the mail server <br/>software provider (protecting the guilty) made some changes to the way <br/>the messages are stored. I can no longer mount the share and access the <br/>messages raw.<br/><br/>So the low hanging fruit seemed to be to use IMAP. Currently I&#39;m <br/>getting pretty good results using Net::IMAP::Simple and Email::Simple. <br/>For simple reporting and clearing out user defined _old_ messages it is <br/>great. The problem comes with a variation where already reported <br/>messages should not be _reported_ again.<br/><br/>Much searching, reading, head scratching, and a few curses later I&#39;m <br/>still kind of confused/lost. I think I just need to extend <br/>Net::IMAP::Simple to have a store method. (STORE is already being used <br/>to mark a message as Deleted.) Where the confusion creeps in is can I <br/>just modify the message object and not use any flags?<br/><br/>Using the Net::IMAP::Simple example code; add in<br/><br/> $es-&gt;set_header( &#39;MY-Header&#39;, $value );<br/> $imap-&gt;store( $i );<br/><br/><br/>TIA,<br/>Rod<br/>-- <br/><br/> http://www.nntp.perl.org/group/perl.pep/2007/11/msg278.html Tue, 27 Nov 2007 14:42:28 +0000 new Email::Abstract! (1 message) <br/>At long last (and about 3 months past due, says my OmniFocus) I have released a<br/>new stable release of Email::Abstract. This release should be significantly<br/>saner, with better facilities for a plugin to declare when it will work and<br/>when it should be ignored.<br/><br/>Email::Abstract is likely to be the email representation passed around in<br/>Email::Sender, which should be the next thing to get some attention. Please<br/>let me know if you have any problems or concerns about it.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/11/msg277.html Fri, 16 Nov 2007 16:14:47 +0000 the big todo list, posted (1 message) <br/> http://emailproject.perl.org/wiki/Big_Todo_List<br/><br/>I&#39;ve dumped my previous mail on this topic to the wiki, in response to the<br/>occasional, &quot;What can I do?&quot; mails and privmsgs.<br/><br/>So far, these haven&#39;t led to much, but... well, a fellow can hope.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/09/msg273.html Mon, 24 Sep 2007 18:26:19 +0000 Email::Store is dead! Long live Email::Store! (38 messages) I&#39;ve been working on cobbling together a modern mailing list manager<br/>written in Perl (Saddlebags), because I find it absolutely<br/>unacceptable that things like the dbic list are running on mailman. As<br/>a part of this, the subject of storing emails in databases came up.<br/>Obviously, we turned to Email::Store.<br/><br/>Of course, those of you who&#39;ve looked at E::S know that it was written<br/>in the CDBI days, and is in fact rather tightly woven together with<br/>CDBI. Saddlebags is a primarily DBIC project, and I&#39;d rather not bring<br/>in a module, for new code, that would have to use other new code&#39;s<br/>compat layers. I mentioned this offhand to mst, who mentioned it to<br/>other people, namely one Brian Cassidy on #dbix-class. Discussion<br/>moved to #email and with rjbs&#39; advice, we have the very beginnings of<br/>Email::Archive.<br/><br/>Right now things are at the general planning stage. I was discussing<br/>things with Brian Cassidy on #dbix-class and then #email; right now<br/>the basic plan is to put something together that has a data store<br/>abstraction, so someone can say &quot;dbic sucks, I want $THIS_ORM instead&quot;<br/>and be able to write some code that DTRT. We also discussed<br/>Email::Store::Entity, and decided it&#39;s a good idea, but that we want<br/>something more basic for now, with the plan of extending it in the<br/>future.<br/><br/>We&#39;ve got a (mostly empty for the moment) repo at<br/>http://www.coitusmentis.info/repos/email-archive/ , hosted on my home<br/>cable connection; will see how things go with that. There were a few<br/>more things discussed that I&#39;ll put in an irclog.txt file in the repo.<br/>Anyone interested in contributing can privmsg me an htpasswd line<br/>(SHA1 preferably) on IRC (nick apeiron, I&#39;m on magnet, freenode,<br/>efnet), or you can Jabber me at apeiron@coitusmentis.info .<br/> http://www.nntp.perl.org/group/perl.pep/2007/09/msg238.html Fri, 14 Sep 2007 14:06:07 +0000 Messages won't import into MySQL (7 messages) <br/>I&#39;ve got a simple script that is called from Sendmail (smrsh) :<br/><br/>while (&lt;&gt;) {<br/> $message .= $_;<br/>}<br/>Email::Store::Mail-&gt;store($message);<br/><br/>Most messages import just fine, but I&#39;m running into more and more messages that don&#39;t make it.<br/>Sendmail complains with the following :<br/><br/>dsn=5.3.0, stat=unknown mailer error 255<br/><br/>The message content gets inserted into the &#39;mail&#39; table, but the message ID never makes it into the<br/>&#39;mail_date&#39; table. Unfortunately I use the mail_date table to sort messages by date.<br/><br/>If I run the script at the command line (i.e. cat msg.txt | script.pl), the script exits with a<br/>status 0 and no errors. Is there a way I can turn up some debugging within the module to find out<br/>what is happening?<br/><br/>Regards,<br/> Chris<br/><br/> http://www.nntp.perl.org/group/perl.pep/2007/08/msg231.html Fri, 03 Aug 2007 16:26:39 +0000 MIME-Lite in pep svn (1 message) <br/>As those of you on pep-checkins saw (sorry for the huge noise), MIME-Lite is<br/>now in the PEP subversion repository. I&#39;ve made a new dev release with zero<br/>code changes.<br/><br/>I&#39;m not a fan of MIME-Lite, as it&#39;s fairly buggy and not all that lite. I&#39;m<br/>not really interested in making it the best MIME generator around (though feel<br/>free to do that), but I would like to reduce its bugginess, since a lot of<br/>things use it.<br/><br/>As those of you on pep-bugs know (sorry for the brief outage; my bug aggregator<br/>script is lame), there are about 120 bugs against email-related modules. 31 of<br/>those (that is: 25%) are filed against MIME::Lite.<br/><br/>Testing so that 3.020 can be released would be great. Commits to fix bugs<br/>would be great. Be great!<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg230.html Sun, 29 Jul 2007 06:53:56 +0000 base exceptions (1 message) <br/>Right now, Email::Sender uses -Sender::Failure, and two subclasses of that.<br/><br/>The only core exception (beyond the root class) that I can imagine is<br/>Unimplemented.<br/><br/>Thoughts?<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg229.html Sat, 28 Jul 2007 14:26:04 +0000 Email::Sender updated to use Email::Base (4 messages) <br/>So, now Email::Sender isa Email::Base, and uses -&gt;throw.<br/><br/>I&#39;m not 100% comfortable with the current Sender behavior. I&#39;ve changed it a<br/>few times, but here&#39;s the rough outline: a sending with a sender seems to have<br/>three possible outcomes:<br/><br/> 1. everything worked!<br/> 2. it worked, but not for every recipient or destination<br/> 3. it didn&#39;t work at all<br/><br/>These are currently handled like this:<br/><br/> 1. return true with &quot;return $self-&gt;success&quot;<br/> 2. throw an Email::Exception::Sender::PartialFailure<br/> there&#39;s a -&gt;failures field that&#39;s a hashref, { $dest =&gt; $reason }<br/> 2. throw an Email::Exception::Sender::FailureFailure<br/><br/>That means that you must always eval the -&gt;send call and check for both partial<br/>and total failure, if you want to be handle all three cases.<br/><br/>So, first of all: any immediate and personal reactions?<br/><br/>Here are some of mine:<br/><br/>How many people are going to shoot themselves in the foot by re-sending to all<br/>recipients after a PartialFailure? How many would shoot themselves in the foot<br/>by not noticing failed destinations if partial failure was treated as a form of<br/>success? I think the current behavior is righter, and no likelier to trick<br/>users into messing up.<br/><br/>Do we need to have a built-in distinction between temporary and permanent<br/>failure?<br/><br/>What are the $reason data? Strings? If so, how do we represent a mixture of<br/>temporary and permanent failures? (Is this possible? I am not going to check<br/>the RFCs at this second, but during SMTP, can the remote respond with 4xx&#39;s<br/>to some RCPT commands and 5xx&#39;s to others? I don&#39;t see why not.) Exceptions<br/>may make suitable values. It makes a multiplexing Sender easy to write,<br/>anyway.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg219.html Mon, 23 Jul 2007 21:23:47 +0000 Email::Base 0.000 (7 messages) <br/>Everyone following along with the svn checkins? If so, this won&#39;t be news.<br/><br/>I&#39;ve added a super-rough first draft at Email::Base. All it does is require<br/>Email::Exception and provide a -&gt;throw method. It works like this:<br/><br/> $object-&gt;throw($exception_moniker =&gt; $arg);<br/><br/>The moniker is either &#39;::Foo&#39; to get Email::Exception::Foo or &#39;Bar::Baz&#39; to get<br/>just that. I don&#39;t think I like this, but it&#39;s where I started. The exact<br/>opposite might be better.<br/><br/>$arg is either a string, which is used as the error param to the exception, or<br/>a hashref, which is used as the entire set of params. A &quot;thrower&quot; param is<br/>always added, referring to the object on which throw was called.<br/><br/>Email::Exception has only one field in the base class: thrower.<br/><br/>Next email: Email::Sender.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg218.html Mon, 23 Jul 2007 21:14:36 +0000 more Mail::Box interop (1 message) <br/>Awesome! I mentioned, at YAPC, wanting to get more interoperability between<br/>Mail::Box and Email::*. As of this morning&#39;s release of Mail-Box, there are<br/>native conversions from Email::Simple and Email::Abstract, and there is a<br/>native conversion to Email::Simple.<br/><br/>They&#39;re crude now, but they&#39;ll get better. This should make it easier to delay<br/>loading Mail::Box until needed, for example.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg217.html Thu, 19 Jul 2007 05:39:44 +0000 Email::Abstract: big updates; test please! (1 message) <br/>So, I spent a few hours today writing more comprehensive tests for<br/>Email::Abstract. It started when Mark Overmeer noted that he thought there was<br/>a bug in the way Mail::Message objects&#39; newlines were handled. I had a look at<br/>the tests for Email::Abstract and basically found that there were a huge number<br/>of bugs not exposed by the lousy testing.<br/><br/>I&#39;ve tried to fix them all, and I&#39;ve gotten 100% test coverage, with much more<br/>assertive tests. Here are some of the most important bugs I&#39;ve addressed:<br/><br/> * newlines were lost in the bodies of Mail::Message and Mail::Internet objs<br/> * headers were not unfolded from Mail::Internet and MIME::Entity objects<br/> * the means of determining the adapter classes were not consistent<br/><br/>I&#39;m a little worried about some of the changes, especially my forcible<br/>unfolding of headers for Mail::Header objects. Then again, I believe things<br/>are correct NOW and it&#39;s hard to imagine anyone relied on this BEFORE.<br/><br/>I want to use Email::Abstract in Email::Sender, so getting this right is<br/>important. I want to make sure the existing behavior is good before I add<br/>anything else -- and I will definitely add a stream_to (print_to?) method in a<br/>release soon.<br/><br/>So, testing, patches, and / or review appreciated. It&#39;s in svn and on the<br/>CPAN.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg215.html Wed, 18 Jul 2007 19:58:49 +0000 Email::Base (ad Email::Sender) (8 messages) <br/>I am eager to get Email::Sender ready for use. The prototype that I use at<br/>work is one of the most useful pieces of code in our internal toolkit, I think.<br/>It makes all sorts of email-related testing much simpler.<br/><br/>Toward that, I&#39;ve been doing some of the simple stuff required to get<br/>Email-Sender in shape, and now that much of the simple stuff is done, I&#39;m going<br/>to start writing (stealing) more tests. That&#39;s not enough, though. For those<br/>of you who saw my talk on PEP at YAPC::NA, you know that one of my biggest<br/>dislikes about Email:: is the way that its modules *utterly* fail to display<br/>signs of design for organic interoperation. (Today&#39;s amusing nit:<br/>Email::Abstract doesn&#39;t use Email::Simple&#39;s method names for common<br/>operations.)<br/><br/>When we spoke about solving this problem at YAPC, we talked about a small set<br/>of common behaviors for new Email:: modules. These would form Email::Base, the<br/>name of which has been used to mock the idea of Email:: being overly complex.<br/>To that, I say, &quot;whatever.&quot; We, the current custodians of that code, don&#39;t<br/>want to turn it into a giant monolith. In fact, I think it&#39;s safe to say that<br/>Email::Simple won&#39;t take on the Base behavior at all, both to stay as small as<br/>it is and because it would require too much reworking.<br/><br/>That said, I think Email::Base is a good idea. It can certainly be seen as<br/>step one in the PEP Plugin System, which should help make things easier to deal<br/>with.<br/><br/>At YAPC, the basic idea was that Base would need to include two kinds of<br/>things: exceptions and attributes.<br/><br/>I think exceptions are simple: Exception::Class is very popular, very good,<br/>and fairly lightweight. It works, I believe, on 5.005. Its prereqs are<br/>Scalar::Util and Devel::StackTrace (both of which we&#39;d probably need anyway)<br/>and Class::Data::Inheritable, which doesn&#39;t strike me as a big worry.<br/><br/>Possibly the cheapest option for attributes is Class::Accessor, but I think<br/>it&#39;s too simple. I think it&#39;s important that we have a system that makes you<br/>really notice when you&#39;re violating encapsulation. A lot of Email:: bugs have<br/>come about because of a cavalier attitude toward doing things like<br/>$email-&gt;{head}{names} = $whatever. Once that&#39;s in Email::Foo, you can&#39;t change<br/>the internals of Email::Simple without trauma.<br/><br/>I&#39;m not sure what we really want, and I am eager to hear ideas. I would like<br/>to keep things fairly simple. Here&#39;s a simple idea whose merits and flaws I<br/>have not deeply considered, yet (it just popped in there):<br/><br/> Objects are hashes in the form { namespace =&gt; $guts, ... }. Guts are<br/> namespace specific. The objects&#39; classes also have a mapping of attributes<br/> to providing namespaces. When you say $obj-&gt;attr(&#39;foo&#39;) it does something to<br/> get it from the namespace that owns &#39;foo&#39;. When two plugins attempt to claim<br/> authority over the same attribute, an exception is raised, at compile time if<br/> possible.<br/><br/>Ok, I know this was a little wordy, but I&#39;m eager to get this ball rolling, so<br/>I&#39;m just going to send it. Replies anticipated eagerly.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg204.html Tue, 17 Jul 2007 15:39:48 +0000 replacing the BounceParser (5 messages) <br/>I&#39;m not sure how many of you have used &quot;the BounceParser.&quot; We use it<br/>extensively at work, and speak of it only in hushed tones -- or, if we&#39;re sure<br/>it can&#39;t hear us, we proclaim its wickedness loudly, dreaming of a day when we<br/>can be free of it. In the meantime, though, we suffer through its horrible<br/>reign of terror.<br/><br/>Mail::DeliveryStatus::BounceParser sucks. If you don&#39;t already know this, here<br/>is a primer on what to hate:<br/><br/> * MDSBP-&gt;new($input) either returns a BounceParser object or false<br/> * the BounceParser object represents a bounce, not a parser<br/> * and that&#39;s why you can call it as -&gt;parse, now, too<br/> * hey, it&#39;s 400 lines long, so maybe it deserves two names<br/> * if it returns false, you still might not have a bounce<br/> * falsity means &quot;we&#39;re sure it&#39;s not a bounce&quot;<br/> * an object means &quot;it might be a bounce, but check -&gt;is_bounce&quot;<br/> * a true result from is_bounce means we&#39;re sure it IS a bounce<br/> * an ideal bounce is an RFC1892 message<br/> * other messages are s///d to look more like RFC1892 before parsing<br/> * a bounce has many reports<br/> * you can get report data with, for example, $bounce-&gt;addresses<br/> * but don&#39;t try $report-&gt;addresses, that doesn&#39;t work<br/> * reports have std_reason fields, explaining WHY the message bounced<br/> * one of these is standard reasons is &quot;no_problemo&quot;<br/> * not one of them is &quot;spam&quot; or &quot;blacklisted&quot;<br/> * go look at the source<br/><br/>After all that, it just doesn&#39;t work very well, either.<br/><br/>I want a good bounce parser for two main reasons:<br/><br/> 1. Recognize bouncing mailing list subscribers so they can be booted.<br/> 2. Recognize bounces that say that my MXes are being blocked so I can<br/> address the situation.<br/><br/>I&#39;m not sure what this system needs to look like, but from 1,000 feet up, the<br/>BounceParser isn&#39;t totally wrong.<br/><br/> my $bounce = $parser-&gt;parse($email_abstract);<br/><br/> my $remote = $bounce-&gt;bounced_by;<br/> my $local = $bounce-&gt;originally_sent_by;<br/> my @reports = $bounce-&gt;reports; # may be ()<br/><br/> my $reason = $report-&gt;bounce_reason; # one of a fixed list<br/> my @addrs = $report-&gt;bounced_to;<br/><br/>I don&#39;t see any reason for this to notice autoresponders at all. If we can<br/>tell they&#39;re not bounces, there&#39;s no reason to report them, is there?<br/><br/>The parse method probably does something like:<br/><br/> for my $plugin (@prioritized_list) {<br/> return $plugin-&gt;parse($message) if $plugin-&gt;can_parse($message);<br/> }<br/><br/> return;<br/><br/>Have I been twisted and blinded by The BounceParser? Is there a significantly<br/>better way to design this?<br/><br/>I have a few million bounce messages sitting in an archive, just waiting to<br/>become test cases.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg203.html Tue, 17 Jul 2007 15:39:47 +0000 pep-checkins is operational again (1 message) <br/>About three months ago, we moved pep.pobox.com (which hosts<br/>emailproject.pobox.com) to a new server. A few things broke for a few hours,<br/>but svnnotify hasn&#39;t been working since then. I &quot;fixed&quot; it a few times, but<br/>never bothered checking that it was fixed, since I viewed the commit list as<br/>unimportant.<br/><br/>Since I want people to be able to see WTF is going on, though, I&#39;ve realized<br/>that the commit list is actually very important. It&#39;s been fixed as of this<br/>morning.<br/><br/>To join pep-checkins, visit http://listbox.com/subscribe/?list_id=4142<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg202.html Tue, 17 Jul 2007 05:56:30 +0000 things you can do (1 message) <br/>I&#39;ve gotten a few &quot;What can *I* do?&quot; emails lately, so here&#39;s a recap. These<br/>are all things that should be do-able without having to learn anything really<br/>esoteric, make any design decisions, or worry about breaking things too much:<br/><br/>Dists desperately in need of more tests (roughly in order of urgency):<br/> * Email-MIME, Email-MIME-Modifier, Email-MIME-Creator<br/> * Email-Address - there are some cases in which it still seems to hang<br/> * Email-Filter<br/> * Email-MIME-Attachment-Stripper<br/> * Email-LocalDelivery - it used to fail to report some class of errors<br/> * Email-Sender<br/> * Email-Simple, Email-Simple-Creator<br/> * Email-Thread<br/> * Mail-Audit<br/><br/>Determine minimum version:<br/> * all dists should get a t/perl-minver.t like Email-Simple has<br/> * the minimum version Perl::MinimumVersion suggests should be documented<br/> * ...and tested to ensure that it&#39;s right<br/> * ...and corrected if it is not<br/><br/>Wikimastering:<br/> * just dump ideas and other thoughts onto the wiki!<br/><br/>Miscellaneous other tasks:<br/> * port any changes to the Mail::Audit delivery routines to Mail::LocalD<br/> * ...and then make Mail::Audit use that<br/> * update Email::Valid to use Email::Address for RFC2822 address checks<br/><br/>Then, here are some more technically-involved tasks:<br/> * the Email::Abstract enhancements listed here:<br/> http://emailproject.perl.org/wiki/Email::Abstract<br/> * improve Email::Address to require no preprocessing of whitespace<br/> * improve Email::Address to handle address groups (at least the empty one)<br/> * make Email::MessageID not isa Email::Address<br/> * make Email::MessageID use Sys::Hostname::Long if available<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg201.html Mon, 16 Jul 2007 04:47:21 +0000 simpler than simple, the newest e-mail module (1 message) <br/>For those of you who read my journal, I apologize for the duplication.<br/><br/>For the rest of you, I apologize for the content.<br/><br/> http://use.perl.org/~rjbs/journal/33806<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg200.html Mon, 16 Jul 2007 04:32:37 +0000 Email::Simple 2.0 immanent (2 messages) <br/>I&#39;ve re-privatized some of the extra API I had added to ::Header in order to<br/>get a release out while still waffling a bit about how much interface to add to<br/>Email-Simple itself.<br/><br/>The current trunk of Email-Simple is, I think, ready to be released as<br/>Email::Simple 2.000. This is not some magic 2.000 all new API or anything.<br/>It&#39;s just the version after 1.999.<br/><br/>Please have a look, give it a go, and let me know if there&#39;s any reason to<br/>hesitate. I plan to release this week.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/07/msg198.html Tue, 03 Jul 2007 15:09:45 +0000 notes from YAPC (1 message) <br/>YAPC is done. I gave a talk on handling email with Perl, and I think it went<br/>fairly well. We had a get-together after the talk and spoke about what we need<br/>to do in the future. I think that also went well. I&#39;m going to start dumping<br/>out some of the results from all of that over the next few days, and I hope we<br/>can start building some momentum.<br/><br/>Here&#39;s a dump from my OmniFocus for PEP tasks. Some of them are stupid and<br/>only for my notes, some may provide some reminders to people who were (or<br/>weren&#39;t) there about things we&#39;d like to start talking about or working on.<br/><br/>Anyway, I&#39;m on a bus and I think I&#39;d like to try to get a few more disconnected<br/>tasks done before I arrive at the office. More soon!<br/><br/> build db of known email headers<br/> fix all copyright notices<br/> standardize dist layouts<br/> add MinimumVersion tests to *<br/> Email-Simple-Header<br/> finalize api for 2.0<br/> Email-Corpus<br/> design api<br/> basic implementation plan<br/> Mail-LocalDelivery<br/> actually use it in Mail::Audit (or E::LD or E::Sr)<br/> improve email sending<br/> tested Email-Sender<br/> Mail::Message::Coerce::Email<br/> colon / semi typo in Mail::Mailer docs<br/> Email::Base<br/> BounceParser 2.0<br/> Email::Metadata<br/> Email::KB<br/> Email::Return (Zion)<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/06/msg197.html Fri, 29 Jun 2007 08:06:14 +0000 Email::Sender in Subversion (1 message) <br/>It&#39;s been festering in my ~/tmp for too long, half ported from Work Code, so<br/>I&#39;ve put it in Subversion, hoping that either I&#39;ll feel more compelled to get<br/>it release-worthy or someone else will. Heck, maybe someone will just have<br/>some snide remarks.<br/><br/>It would be nice to get this more demonstrable by YAPC.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/06/msg196.html Mon, 18 Jun 2007 19:39:36 +0000 toward Email::Simple 2.000 (1 message) <br/>First:<br/><br/> In case you&#39;re subscribed, note that the pep-checkins is currently busted. I<br/> haven&#39;t even looked into it, yet. We moved PEP svn from a standalone machine<br/> to a Solaris zone recently, and I probably broke something stupid.<br/><br/>I bring this up because I know that it means none of you have probably seen the<br/>Email::Simple checkins I made yesterday. I&#39;m trying to get ready to release<br/>Email::Simple 2.000. It&#39;s going to be a great release, I think. I&#39;m not<br/>trying to do the crazy &quot;not-backwards-compatible changes at major version<br/>number!&quot; thing. Instead, I&#39;m trying to document and standardize more of the<br/>interface. My mantra for the 2.x series of Email::Simple is &quot;better interface<br/>standardization.&quot; I want it to do roughly the same amount of stuff, with<br/>roughly the same performance. I just want it to be clearer how one can<br/>subclass Email::Simple, and I want to refactor, document, and improve the<br/>usability of the core features of Email::Simple. (This will probably include a<br/>rewrite of the Email::Simple&lt;-&gt;Data::Message relationship.)<br/><br/>Here&#39;s a summary of things I checked in last night:<br/><br/> * better documentation for the Email::Simple::Header object<br/> * provide a means to request a different header class<br/> * public interface for header folding<br/> * documented how options are passed to Email::Simple constructor<br/> * add options to as_string, namely options to alter header folding<br/> * add methods that return default values of various options<br/> * some performance improvements<br/><br/>These changes are mostly here to make it easier to subclass Email::Simple&#39;s<br/>behavior. In almost every case, I want the answer to &quot;how do I change<br/>Email::Simple&#39;s&quot; behavior to be &quot;subclass&quot; or (later) &quot;use a plugin.&quot; Since<br/>some features are really very fundamental core features, though, they seemed<br/>like a good place to demonstrate my intentions.<br/><br/>I&#39;m going to release this as a _x release, soon. Please let me know, now or<br/>then, if you have any thoughts.<br/><br/>-- <br/>rjbs<br/> http://www.nntp.perl.org/group/perl.pep/2007/05/msg190.html Wed, 30 May 2007 06:19:05 +0000