On Friday 27 November 2020 at 13:12:44, Indunil Jayasooriya wrote:

> +----------------------------------------------------------------+
> | from_addr                                                             |
> +----------------------------------------------------------------+
> | [email protected]                                             |
> | [email protected]                                                 |
> | Firstname Lastname <[email protected]>     |
> | [email protected]                                                 |
> | Firstname Lastname <[email protected]>      |
> | [email protected] (root)                                     |
> | [email protected]                                               |
> | [email protected]                                               |
> | Firstname Lastname <[email protected]>      |
> | [email protected]                                               |
> +--------------------------------------------------------------+
> 
> 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.

_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to