undesired string "?utf-8?Q?" in received email
undesired string "?utf-8?Q?" in received email
am 20.06.2006 18:44:07 von raffe
Hej !
I've the following problem :
When I received email from an hp-scan-printer, and get it with
fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
and at the end of each line.
How can I suppress them ?
Does this means that the mail is encode in utf-8 charset ?
Thanks in advance,
sample part of the received email :
From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
Subject: =?utf-8?Q?0467602983?=
To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
Raphael
Re: undesired string "?utf-8?Q?"in received email
am 21.06.2006 02:10:24 von Sam
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-11528-1150848621-0001
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
RaFFe writes:
> Hej !
>
> I've the following problem :
>
> When I received email from an hp-scan-printer, and get it with
> fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
> and at the end of each line.
>
> How can I suppress them ?
> Does this means that the mail is encode in utf-8 charset ?
>
> Thanks in advance,
>
> sample part of the received email :
>
> From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
> Subject: =?utf-8?Q?0467602983?=
> To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
Although this is technically unnecessary, this is perfectly valid.
hp-scan-printer's programming is a bit sloppy, but this is a technically
valid header.
--=_mimegpg-commodore.email-scan.com-11528-1150848621-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQBEmI5tx9p3GYHlUOIRAgcXAJkBjdKTt8XvdAQ8mate+XQXOAJR1QCc Cw3r
oGxx31kT1UEsbHUyKJpLD2A=
=mPJX
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-11528-1150848621-0001--
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 11:14:26 von raffe
> RaFFe writes:
>
>> Hej !
>>
>> I've the following problem :
>>
>> When I received email from an hp-scan-printer, and get it with
>> fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
>> and at the end of each line.
>>
>> How can I suppress them ?
>> Does this means that the mail is encode in utf-8 charset ?
>>
>> Thanks in advance,
>>
>> sample part of the received email :
>>
>> From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
>> Subject: =?utf-8?Q?0467602983?=
>> To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
>
>
> Although this is technically unnecessary, this is perfectly valid.
>
> hp-scan-printer's programming is a bit sloppy, but this is a technically
> valid header.
>
But, when I parse lines with a bash script I can't remove added
characters and just keep real data (like in subject whose contain a fax
number that I can't read)
When I open this email with a MUA (like thunderbird) or in my webmail,
data are correct... But I need to read this email from command line.
Re: undesired string "?utf-8?Q?"in received email
am 21.06.2006 12:17:06 von Sam
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-18180-1150885025-0001
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
RaFFe writes:
>
>> RaFFe writes:
>>
>>> Hej !
>>>
>>> I've the following problem :
>>>
>>> When I received email from an hp-scan-printer, and get it with
>>> fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
>>> and at the end of each line.
>>>
>>> How can I suppress them ?
>>> Does this means that the mail is encode in utf-8 charset ?
>>>
>>> Thanks in advance,
>>>
>>> sample part of the received email :
>>>
>>> From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
>>> Subject: =?utf-8?Q?0467602983?=
>>> To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
>>
>>
>> Although this is technically unnecessary, this is perfectly valid.
>>
>> hp-scan-printer's programming is a bit sloppy, but this is a technically
>> valid header.
>>
>
> But, when I parse lines with a bash script I can't remove added
> characters and just keep real data (like in subject whose contain a fax
> number that I can't read)
A bash script is not the right tool for handling E-mail message formats.
> When I open this email with a MUA (like thunderbird) or in my webmail,
> data are correct... But I need to read this email from command line.
Define "read this email from command line".
--=_mimegpg-commodore.email-scan.com-18180-1150885025-0001
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQBEmRyhx9p3GYHlUOIRAm/5AJ4oI6f6tc2F5XwKSbwGE7YdV6SzAgCf TvAv
r1dPBrhSAgoH25EZ6c043r8=
=p09J
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-18180-1150885025-0001--
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 12:35:18 von raffe
Sam a écrit :
> RaFFe writes:
>
>>
>>> RaFFe writes:
>>>
>>>> Hej !
>>>>
>>>> I've the following problem :
>>>>
>>>> When I received email from an hp-scan-printer, and get it with
>>>> fetchmail, the string "?utf-8?Q?" and "?=" was added at the
>>>> beginning and at the end of each line.
>>>>
>>>> How can I suppress them ?
>>>> Does this means that the mail is encode in utf-8 charset ?
>>>>
>>>> Thanks in advance,
>>>>
>>>> sample part of the received email :
>>>>
>>>> From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
>>>> Subject: =?utf-8?Q?0467602983?=
>>>> To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
>>>
>>>
>>>
>>> Although this is technically unnecessary, this is perfectly valid.
>>>
>>> hp-scan-printer's programming is a bit sloppy, but this is a
>>> technically valid header.
>>>
>>
>> But, when I parse lines with a bash script I can't remove added
>> characters and just keep real data (like in subject whose contain a
>> fax number that I can't read)
>
>
> A bash script is not the right tool for handling E-mail message formats.
>
>> When I open this email with a MUA (like thunderbird) or in my webmail,
>> data are correct... But I need to read this email from command line.
>
>
> Define "read this email from command line".
>
From command line is not the good expression, that I need is an
automatic treatment of received emails. So, I can write this in a bash
script or php script or ... I don't know.
I can adapt myself, but I'm working with emails for the first time and
it seems to be a bit complex.
I need to fetch emails from a distant server, parse subject of each
received email for extract fax numbers and submit attachment pieces of
each emails to extracted numbers with hylafax.
My bash script work fine with "normal" emails, but failed with emails
whose come from hp-scan-printer because of "utf-8?Q?" string that I not
able to remove.
If I install a mail's server in the local network and submit emails from
hp-scan-printer to it, can it transform emails correctly ?
Or must I need to recode my program in C or other compiled language ?
Raphael
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 17:57:03 von Mark Crispin
On Wed, 21 Jun 2006, RaFFe wrote:
> Or must I need to recode my program in C or other compiled language ?
That may well be the path of least resistance, especially if you use one
of the many excellent email message parsing libraries that various
individuals have written over the years.
A bash (or other shell) script that correctly parses email messages would
be extremely complicated. I don't say that such is impossible. But it
hasn't been since the 1970s that one could reasonably assume a few simple
syntax rules for an email header; and over time it's gotten (far) worse,
not better.
-- Mark --
http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 18:35:49 von Bob
Mark Crispin wrote:
> On Wed, 21 Jun 2006, RaFFe wrote:
>> Or must I need to recode my program in C or other compiled language ?
If you want to have a go with PHP, you may find the following useful:
http://php.net/iconv-mime-decode
> That may well be the path of least resistance, especially if you use one
> of the many excellent email message parsing libraries that various
> individuals have written over the years.
Care to share some of these excellent libraries? I've looked at quite a
few IMF/MIME parsing libraries over the past few years, but haven't
found any I'd call excellent. The majority seems to have been written by
people who think actually reading RFC2822/RFC204[5,6,7,8] is a colossal
waste of time! The one exception that comes to mind is some of Bruce
Lilly's code, but the last time I looked at that I got the impression it
was a bit too "correct" for real-world use (though I may be wrong about
this).
Bob
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 20:22:25 von ynotssor
In news:44990e16$0$1006$ba4acef3@news.orange.fr,
RaFFe wrote:
>>> I've the following problem :
>>> When I received email from an hp-scan-printer, and get it with
>>> fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
>>> and at the end of each line.
....
>>> sample part of the received email :
>>> From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
>>> Subject: =?utf-8?Q?0467602983?=
>>> To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
....
> But, when I parse lines with a bash script I can't remove added
> characters and just keep real data (like in subject whose contain a fax
> number that I can't read)
Since you're parsing with a script, it seems natural to pipe the data
through
sed -e 's|=?utf-8?Q?||g' -e 's|?=||g'
to remove the unwanted characters. What prevents you from doing that?
Re: undesired string "?utf-8?Q?"in received email
am 21.06.2006 23:49:02 von Sam
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-24866-1150926542-0003
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
RaFFe writes:
> If I install a mail's server in the local network and submit emails from
> hp-scan-printer to it, can it transform emails correctly ?
It "can", but only if the term "can" is defined as "technically possible for
a mail server to do something like this". But since something like this is
completely and totally irrelevant to the process of delivering an E-mail
message (since the mail server is fully capable of delivering the message to
the mailbox without giving a fig as to the contents of the said message's
headers, and delivering messages is really the only job the mail server is
obligated to do), it would be extremely unlikely that any one of the
commonly available mail servers on the market would expend even a single CPU
cycle on such a task.
Of course, you are welcome to write your own mail server from scratch, that
does such as thing (or modifying an existing one).
> Or must I need to recode my program in C or other compiled language ?
You can certainly code something like this in C; but I'll bet there are Perl
modules out there that can solve this problem faster.
But first, you need to understand what this encoding means, and what needs
to be done about it. Unless you understand the purpose and the meaning of
this encoding, you're in danger of making some blunders along the way.
--=_mimegpg-commodore.email-scan.com-24866-1150926542-0003
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQBEmb7Ox9p3GYHlUOIRAjamAJwPsyb0uTWY+ulc68fOrnQUUFdrigCf REVu
MHtdsdTCeyhvi5/+/1cRmKg=
=ssLc
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-24866-1150926542-0003--
Re: undesired string "?utf-8?Q?" in received email
am 21.06.2006 23:57:56 von Oliver Block
RaFFe wrote:
> How can I suppress them ?
> Does this means that the mail is encode in utf-8 charset ?
It does mean, that the header field is an 'encoded word' (RFC2047) which is
encoded in quoted-printable. The character set is UTF-8, which is the cause
of the use of an encoded word, because it is 8bit. To avoid it, the header
field must be 7bit.
But a better way may be to decode the encoded word.
Best Regards,
Oliver
Re: [SOLVED] undesired string "?utf-8?Q?" in received email
am 22.06.2006 13:51:50 von raffe
ynotssor a écrit :
> In news:44990e16$0$1006$ba4acef3@news.orange.fr,
> RaFFe wrote:
>
>
>>>>I've the following problem :
>>>>When I received email from an hp-scan-printer, and get it with
>>>>fetchmail, the string "?utf-8?Q?" and "?=" was added at the beginning
>>>>and at the end of each line.
>
> ...
>
>>>>sample part of the received email :
>>>>From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
>>>>Subject: =?utf-8?Q?0467602983?=
>>>>To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
>
> ...
>
>>But, when I parse lines with a bash script I can't remove added
>>characters and just keep real data (like in subject whose contain a fax
>>number that I can't read)
>
>
> Since you're parsing with a script, it seems natural to pipe the data
> through
> sed -e 's|=?utf-8?Q?||g' -e 's|?=||g'
> to remove the unwanted characters. What prevents you from doing that?
>
>
>
Nothing prevent me for doing this ! But it's exatly that I need, the
simplest solution for my problem, the most effective. Your are my
champion ynotssor !
I a poor user of sed, but I understand day after day the powerful of
this little utility.
THANKS A LOT !
Re: undesired string "?utf-8?Q?" in received email
am 22.06.2006 21:20:39 von Kari Hurtta
Sam writes:
> RaFFe writes:
>
> > Hej !
> > I've the following problem :
> > When I received email from an hp-scan-printer, and get it with
> > fetchmail, the string "?utf-8?Q?" and "?=" was added at the
> > beginning and at the end of each line.
> > How can I suppress them ?
> > Does this means that the mail is encode in utf-8 charset ?
> > Thanks in advance,
> > sample part of the received email :
> > From: "=?utf-8?Q?MARKKOENIG@FREESBE.FR?="
^ This is NOT mime encoded word (because it is on quotes)
> > Subject: =?utf-8?Q?0467602983?=
^ This is mime encoded word
> > To: "=?utf-8?Q?TECH@POCKETCOMUNICAT.COM?="
^ this is NOT mime encoded word
>
> Although this is technically unnecessary, this is perfectly valid.
>
> hp-scan-printer's programming is a bit sloppy, but this is a
> technically valid header.
But result is not necessary what is wanted.
Re: [SOLVED] undesired string "?utf-8?Q?" in received email
am 23.06.2006 16:25:20 von ynotssor
In news:449a8478$0$823$ba4acef3@news.orange.fr,
RaFFe wrote:
> THANKS A LOT !
You're welcome, but to be honest it seemed rather too obvious, given the
circumstances.