On Friday 27 November 2020 at 13:12:44, Indunil Jayasooriya wrote:
+----------------------------------------------------------------+ | from_addr | +----------------------------------------------------------------+ | admin@sender.com | | userl@mysys.net | | Firstname Lastname <user622@yahoo.com> | | userl@mysys.net | | Firstname Lastname <user75@gmail.com> | | root@domain.net (root) | | userl@mysys.net | | userl@mysys.net | | Firstname Lastname <user75@gmail.com> | | userl@mysys.net | +--------------------------------------------------------------+
When Users send mails this from_addr column fills. some times with just email addresses, Some times email address with Display names.
What I expect is to remove all the display name part. I only need email addresses.
I would look at whatever process is putting this information IN to MariaDB - it seems that you are not parsing the address sufficiently to pick out just the part enclosed within < > Given that you are accepting Internet-supplied input and simply feeding it in to a MariaDB table like this, I would strongly advise you also to consider input sanitisation to ensure that someone doesn't claim that their lastname is, for example "; drop table msgs" in the hope that your input parser simply passes this through as part of a SQL statement... Regards, Antony. -- How I want a drink, alcoholic of course, after the heavy chapters involving quantum mechanics. - mnemonic for 3.14159265358979 Please reply to the list; please *don't* CC me.