Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Sifting out mail addresses with grep and regex Post 303039343 by RudiC on Tuesday 1st of October 2019 10:43:23 AM
Old 10-01-2019
Mayhap sth. like
Code:
echo "name1 <mail1@domain1.com>, name2 <mail2@domain2.com>  " | grep -ioE "<[^>]*>"
<mail1@domain1.com>
<mail2@domain2.com>

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix-mail to external websites/addresses

Hi all, I would like to know if I can send unix mail to 'external email addresses'. My unix server is leo@ABCcompany.com. I am able to send emails to firstname.lastname@ABCcompany.com. But, we have some email addresses in our team on our parent company's server - ex:... (2 Replies)
Discussion started by: Joy_K
2 Replies

2. Shell Programming and Scripting

How can i send mail to multiple addresses in same domain in bash?

Suppose i have a txt file that is the list of the addresses,something like: lala0045 john james lala0234 george james and i want to send an email to lala0045@blabla.com and lala0234@blabla.com,the same domain...what is the exact syntax i should use in my script? there is a command... (10 Replies)
Discussion started by: bashuser2
10 Replies

3. UNIX for Dummies Questions & Answers

| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax

Hello, I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax a guide. ls -aLl /bin | grep "\(x\)" Which works, just highlights 'x' where ever, when ever. I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies

4. Shell Programming and Scripting

Echo - Sending mail to multiple addresses

Hi, If I want my script to send a mail to multiple recipients I can do the following: if then echo $err_string1 | mailx -s "UAT CPU ALERT" 1@email.com echo $err_string1 | mailx -s "UAT CPU ALERT" 2@email.com fi Can this also be done something like: ... (1 Reply)
Discussion started by: runnerpaul
1 Replies

5. Shell Programming and Scripting

Perl - match e-mail addresses in multiple files

Hi, I'm trying to write a script that will check multiple files in a directory (all the relevant filenames begin "TT04.NOTES") for e-mail addresses, and then print these addresses to screen with a count at the bottom. I'm a bit of a novice with Perl but thought it would be the best tool for the... (2 Replies)
Discussion started by: wf1974
2 Replies

6. Shell Programming and Scripting

Formatting list of IP addresses into a grep command

Hi I have an input file with a list of random IP addresses, each on a new line. Below is just an example as I omitted the real IP addresses for obvious reasons. Input: random_ip.txt 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1 10.0.0.1... (7 Replies)
Discussion started by: lewk
7 Replies

7. Shell Programming and Scripting

Extract e-mail addresses on a page

Hi I normally ask questions on coding but I think there is a code that can do this. I have regular text throughout my file and I want to extract all e-mail addresses from it (rather than going and searching each one). E-mails all have @ so I assume there is a way. Thanks Phil (6 Replies)
Discussion started by: phil_heath
6 Replies

8. Homework & Coursework Questions

Search email addresses using grep command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Let's say if we have a file with a lot of information. For example: iiadam otterhedgehog kayleigh... (2 Replies)
Discussion started by: ForeignGuy
2 Replies

9. Shell Programming and Scripting

Grep for all ip addresses mentioned in all files in a Directory

I wish to traverse all files and folders under a given directory say "/tmp/configuration" and for all ip address mentioned therein. I tried find ./ -type f | xargs grep "*.*.*.*" but it does not populated the correct results. Can you please suggest. (1 Reply)
Discussion started by: mohtashims
1 Replies
INNMAIL(1)						    InterNetNews Documentation							INNMAIL(1)

NAME
innmail - Simple mail-sending program SYNOPSIS
innmail [-h] [-s subject] address [address ...] DESCRIPTION
innmail is a Perl script intended to provide the non-interactive mail-sending functionality of mail(1) while avoiding nasty security problems. It takes the body of a mail message on standard input and sends it to the specified addresses by invoking the value of mta in inn.conf. At least one address (formatted for the MTA specified in inn.conf, if it matters) is required. innmail will sanitize the addresses so that they contain only alphanumerics and the symbols "@", ".", "-", "+", "_", and "%". innmail was written to be suitable for the mailcmd setting in inn.conf. OPTIONS
-h Gives usage information. -s subject Sets the Subject: header of the message. A warning is issued if this option is omitted. EXAMPLES
This sends a one-line message to the local user "joe": echo "A one-line message." | innmail -s "Simple message" joe innmail by default is used by INN for sending nightly reports and control message reports. BUGS
innmail fails on addresses that begin with "-", although one might hope that the news server will not need to contact any such addresses. There are many "correct" addresses that will be silently modified by the sanitization process. A news administrator should be careful to use particularly sane addresses if they may be passed to innmail. HISTORY
innmail was written by James Brister <brister@vix.com> for InterNetNews. This manual page was originally written by Jeffrey M. Vinocur. $Id: innmail.pod 7851 2008-05-26 19:33:08Z iulius $ SEE ALSO
inn.conf(5), mail(1). INN 2.5.3 2009-05-21 INNMAIL(1)
All times are GMT -4. The time now is 04:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy