--e7ytifu4m7upqtfl
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On 2025-01-04 19:07:57 +0000, Chris Green via Python-list wrote:
Stefan Ram <ram@zedat.fu-berlin.de> wrote:
Chris Green <cl@isbd.net> wrote or quoted:
From: =3D?utf-8?B?U8OpYmFzdGllbiBDcmlnbm9u?=3D <sebastien.crignon@amvs=
=2Efr>
=20
Is there a simple[r] way to extract just the 'real' address between
the <>, that's all I actually need. I think it has the be the last
chunk of the From: doesn't it?
No,
From: <
sebastien.crignon@amvs.fr> (S=E9bastien Crignon)
would also be permissible (properly encoded, of course), and even
From: < sebastien (S=E9bastien) . crignon (Crignon) @ amvs . fr >
(although I think the latter is deprecated).
And also, there can be more than one address in a From header.
To properly extract email addresses from a header, use email.utils.getaddresses(). You don't have to decode the header first.
The MIME-encoding is supposed to not interfere with parsing headers for machine-readable information like addresses or message ids.
hp
--=20
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | |
hjp@hjp.at | -- Charles Stross, "Creative writing
__/ |
http://www.hjp.at/ | challenge!"
--e7ytifu4m7upqtfl
Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmd8MlMACgkQ8g5IURL+ KF0cpRAApcdq2w7t5+wi7xUEpTpJoZvoW7VbuAfm5LUh5YKYZImjrAyZf7o7t02S wAFyUSEqr5UmcDYE3Fvg2zizYi8ua1QTKIJbLfR88qwTGOHkLDfu0bVn7DvvEiTW 5dlU6ykxFUk7YeNtdBgtmiaUNi5iuONrDcWK+ddFm4oyDesCcaTnLlqIQnR524kU xord18YoGwMDxI+LAXeMNgX/tndqh3339r6Av/UwLq96O+1e+lHOC1bUKYng+Pwm IdeZEfHJMFKvylTV2tqh5zhut3g9F3WiWAoC0Gr5Ib3tIoKXXA1KPwSpHBSzNqP0 tEfi5KIOmScbCtd8vIlE0Qpkg+4Z3Eb7RGWsxMiuk/KGxblHBxkKgBrAkLJSY1Sd PT9YnU/6h/z1i6x4Rp34zXfdg+yfN3nO1DqRK17bWvvCKIiNvT5G4JldgAcSme8L QgQdY8Ls1keGUSggy35xYkpLxzafFFc0uZuFzJrm1oVXb0NKcldyiMJDAqegnaMR wTueBj2QFTJYZqrAlHgUyGzOnP4HZxTfYwyynoFkuzQpDrla3QHnjUFFAIz6mv0W CVBVo48wPuyiqgPU/UgWb1sQZ2YDv+pFmlUJUqpbUC+H3JrWU7wg9rljIU218HYn /6pSzIwEIuscCji4iVCZXIVXaWI8XqQqO0BqjJuhCJfGnFSC0jE=
=ooym
-----END PGP SIGNATURE-----
--e7ytifu4m7upqtfl--
--- MBSE BBS v1.0.8.4 (Linux-x86_64)
* Origin: ---:- FTN<->UseNet Gate -:--- (3:633/280.2@fidonet)