<div dir="ltr">Dear list, <div><br></div><div><div><br></div><div>I use below line in amavisd.conf file to get the Subject of the mail. It shows MAIL FROM (with display name) as well.</div><div><br></div><div>$log_templ = $log_verbose_templ;</div><div><br></div><div>Some times, when I get mais with NON ASCII charactors, amavisd-new shows subjects of the mails incorectly. this happens sometimes.(NOT always)</div><div><br></div><div>A few examples. Pls look at below 2 subjects </div><div><br></div><div>Subject: "Last Day To Enjoy Extra 15% OFF On Everything For NDB Credit Cards (raw: =?utf-8?Q?Last=20Day=20To=20Enjoy=20Extra=2015%=20OFF=20On=20Everything=20For=20NDB=20Credit=20Cards)</div><div><br></div><div>Subject: "Sing Along and Dance with Desmond De Silva at Pegasus Reef Hotel! (raw: =?utf-8?Q?Sing=20Along=20and=20Dance=20with=20Desmond=20De=20Silva=20at=20Pegasus=20Reef=20Hotel=21?)"</div><div><br></div><div>These above subects parts are NOT properly terminated. </div><div><br></div><div>they don't end with ?=</div><div><br></div><div><br></div><div>These are 2 Proper Subject having ?= </div><div><br></div><div>Subject: "Big Data & Data Driven Marketing (raw: =?utf-8?Q?Big=20Data=20&=20Data=20Driven=20Marketing?=)"</div><div><br></div><div>Subject: "Room Rush \303\242\302\200\302\223 Enjoy 25% off on your stay. (raw: Room Rush =?utf-8?b?4oCT?= Enjoy 25% off on your stay.) </div><div> </div><div><br></div><div>So, I can't use "encode decode" in perl, when subject contains wrong raw: =?utf-8 </div><div><br></div><div>my amavisd version is amavisd-new-2.9.1-3.el6.noarch on CentOS 6.9 64 bit</div><div><br></div><div>Is there anyway to get it displayed properly?</div><div><br></div><div>looking for your answers.</div><div><br></div><div>Hope to hear from you. </div></div><div><br></div><div><br></div><div>here's my perl code.</div><div><br></div><div><div>#!/usr/bin/perl</div><div>use CGI ':standard';</div><div>use strict;</div><div>use warnings;</div><div>use CGI::Carp 'fatalsToBrowser'; # use only for testing</div><div>use Encode qw(encode decode);</div><div>no warnings 'utf8'; </div><div><br></div><div>print "Content-Type: text/html; charset=utf-8\n\n";</div><div><br></div><div>#my $subject = "\303\251\302\203\302\255\303\250\302\265\302\236\303\250\302\276\302\21120180804-20180828\303\244\302\274\302\221\303\245\302\201\302\207\303\247\302\224\302\263\303\250\302\257\302\267\303\250\302\241\302\250 (raw: =?utf-8?B?6YOt6LWe6L6JMjAxODA4MDQtMjAxODA4MjjkvJHlgYfnlLPor7fooag=?=)";</div><div>my $subject = "Throwback to Choe Peng Sum & Michael Issenberg Interviews | HOSI: A few days away... (raw: =?utf-8?Q?Throwback=20to=20Choe=20Peng=20Sum=20&=20Michael=20Issenberg=20Interviews=20|=20HOSI=3A=20)";</div><div>#my $subject = "Room Rush \303\242\302\200\302\223 Enjoy 25% off on your stay. (raw: Room Rush =?utf-8?b?4oCT?= Enjoy 25% off on your stay.)";</div><div><br></div><div>#$subject =~ s/[^[:ascii:]]+//g; # get rid of non-ASCII characters</div><div><br></div><div>my $subject_decoded = decode("MIME-Header", $subject);</div><div>#my $subject_decoded = decode("MIME-B", $subject);</div><div>#my $subject_decoded = decode("MIME-Q", $subject);</div><div><br></div><div>print "\n";</div><div>print "<br/>";</div><div>print "subject: $subject \n\n";</div><div>print "<br/>";</div><div>print "subject_decoded: $subject_decoded \n\n";</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">cat /etc/motd<br><br>Thank you<br>Indunil Jayasooriya <br><a href="http://www.theravadanet.net/" target="_blank">http://www.theravadanet.net/</a><br><br></div></div></div></div>
</div></div>