← Back to team overview

maria-discuss team mailing list archive

Remove everything except email addresses in from_addr table in mariaDB

 

Hi list,

I am running MariaDB Server version: 10.4.17-MariaDB in Cent OS7.

I have a column called from_addr from table msgs.

Plz see its OUTPUT.

select from_addr from msgs;


+----------------------------------------------------------------+
| from_addr                                                             |
+----------------------------------------------------------------+
| admin@xxxxxxxxxx                                             |
| userl@xxxxxxxxx                                                 |
| Firstname Lastname <user622@xxxxxxxxx>     |
| userl@xxxxxxxxx                                                 |
| Firstname Lastname <user75@xxxxxxxxx>      |
| root@xxxxxxxxxx (root)                                     |
| userl@xxxxxxxxx                                               |
| userl@xxxxxxxxx                                               |
| Firstname Lastname <user75@xxxxxxxxx>      |
| userl@xxxxxxxxx                                               |
+--------------------------------------------------------------+

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 expect from_addr column in this way.

+--------------------------------------------+
| from_addr                                     |
+--------------------------------------------+
| admin@xxxxxxxxxx                      |
| userl@xxxxxxxxx                            |
| user622@xxxxxxxxx                    |
| userl@xxxxxxxxx                            |
| user75@xxxxxxxxx                         |
| root@xxxxxxxxxx                            |
| userl@xxxxxxxxx                            |
| userl@xxxxxxxxx                            |
| user75@xxxxxxxxx                         |
| userl@xxxxxxxxx                            |
+--------------------------------------------+

How can I solve it. I tried a lot. But, I could NOT get what I expect.
finally I subscribed to mariaDB mailing list.

I need your INPUTS.








-- 
cat /etc/motd

Thank you
Indunil Jayasooriya
http://www.theravadanet.net/

Follow ups