LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-28-2010, 07:55 PM   #1
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Rep: Reputation: 21
sendEmail usage - Can't use improperly formatted email address: (for


I have a script to report phishing sites that calls sendEmail. I keep getting the above error and can't seem to figure out just what the problem is. What I see in the output log for sendEmail is at these pastebin links http://pastebin.com/YysSZVDh, http://pastebin.com/tdP1JFde. One as a success and one as a failure. If the sendEmail and sendphish scripts are needed, which I'm sure they will be, I'll attach them here. There are also a few additional files to run sendphish here http://pastebin.com/Vr4fhpmg If I've left something out please let me know. I've contacted the author on this before but all he basically told me was to read the docs on addressing which I've done multiple times to no avail.

Chris
Attached Files
File Type: txt sendEmail.txt (78.5 KB, 204 views)
File Type: txt sendphish.txt (52.2 KB, 51 views)
 
Old 09-28-2010, 10:20 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Can you provide an example of how you're calling the sendEmail script ? ..
 
Old 10-02-2010, 08:14 AM   #3
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Sorry I haven't gotten back, for some reason I didn't get an email notification of your reply. Here is where I believe it's called:

Code:
sendemailbg=0
		if test "$msgto" != "skip" ; then
			telluser "3;Sending to the Anti-Phishing Mailing List"
			if test "$msgto" != "phishreport@funchords.com" ; then  
				sendEmail -l $maillogfile -s $smtpserver -o tls=auto -xu $smtpuseracct -xp $smtppassword -o reply-to=$msgreplyto -t $msgto -f "$msgfrom" -bcc "$msgbcc" -u "Phish URL" -m "$phishurl" > /tmp/sendemailbglog.$$ &
			else ## robb needs this dumb if-then-else routine for a local mail account quota issue
				sendEmail -l $maillogfile -s aspmx.l.google.com -o reply-to=$msgreplyto -t $msgto -f "$msgfrom" -bcc "$msgbcc" -u "Phish URL" -m "$phishurl" > /tmp/sendemailbglog.$$ &
			fi
			sendemailbg=1
		fi
		last=0
		if test `grep -c -E -e " $regexphishurl .*sighted" $logfile` -gt 0  ; then 
			last=$(( ($timestamp - $( grep -E -e " $regexphishurl .*sighted" $logfile | sort -r | grep -o -E --max-count=1 -e "[[:digit:]]{10,10}$" )) / 3600 ))
			if test $last -lt 1 ; then
				telluser "3;Not logging this sighting since it was previously logged within the hour"
			else
				logentry $ipaddr Phish Sighting $phishurl sighted
			fi
		else
			logentry $ipaddr Phish Sighting $phishurl sighted
		fi
		msgto=""
That was lines 592-613 of the sendphish script, there is also this

Code:
sendEmail -l $maillogfile -s $smtpserver -o tls=auto -xu $smtpuseracct -xp $smtppassword -f $msgfrom -o reply-to=$msgreplyto -bcc $msgbcc -t $msgto -u $msgsubject -m  "$msgbody"
						if test `grep -c -e "successfully" /tmp/sendEmail` -eq 1 ; then
							telluser "4;Message sent successfully"
							logentry $emaildrop Email Drop $phishurl $msgto
							telluser "5;Log entry: $(tail -n 1 $logfile)"
						else
							telluser "1;Error in sending message. The output was:"
							telluser "1;$(cat /tmp/sendEmail)"
						fi
at lines 691-698
 
Old 10-02-2010, 07:24 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
This part of the script:
Code:
   ## Make sure email addresses look OK.
    foreach my $addr (@to, @cc, @bcc, $from, $opt{'reply-to'}) {
        if ($addr) {
            if (!returnAddressParts($addr)) {
                printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
                printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
                quit("", 1);
            }
        }
    }
.. shows that there should be an email address listed after the first error message but I can't see one in your error:

Code:
Can't use improperly formatted email address: (for Sep 21 19:26:55 cpollock sendEmail[17050]: HINT => Try viewing the extended help on addressing with "--help addressing"
Try modifying sendEmail like this and maybe we'll be able to see what the problem is:
Code:
    ## Make sure email addresses look OK.
    foreach my $addr (@to, @cc, @bcc, $from, $opt{'reply-to'}) {
        if ($addr) {
	    printmsg("[*] kbp_debug: current address: \"$addr\"", 0); 
            if (!returnAddressParts($addr)) {
                printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
                printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
                quit("", 1);
            }
        }
    }
cheers
 
Old 10-02-2010, 09:43 PM   #5
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Here's the output I got when reporting this URL:

http://alkom.com/yonetici/images/fot...enturyLink.htm

Code:
[15394] Sending to: abuse@turktelekom.com.tr,(for,doruk.net.tr),abuse@ttnet.net.tr,(for,doruk.net.tr),abuse@doruk.net.tr,(for,doruk.net.tr),postmaster@doruk.net.tr,(for,doruk.net.tr)
[15394] Error in sending message. The output was:
[15394] Log entry: 2010-10-02 21:36:39 localhost /usr/local/bin/sendphish[15394]: Error in sending message. The output was: 1286073379
[15394] Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: tls => auto
Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.15394
Oct 02 21:36:39 cpollock sendEmail[16754]:[*] kbp_debug: current address: "abuse@turktelekom.com.tr"
Oct 02 21:36:39 cpollock sendEmail[16754]:[*] kbp_debug: current address: "(for"
Oct 02 21:36:39 cpollock sendEmail[16754]: ERROR => Can't use improperly formatted email address: (for
Oct 02 21:36:39 cpollock sendEmail[16754]: HINT => Try viewing the extended help on addressing with "--help addressing"
[15394] Log entry: 2010-10-02 21:36:39 localhost /usr/local/bin/sendphish[15394]: Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: tls => auto Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com Oct 02 21:36:39 cpollock sendEmail[16754]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.15394 Oct 02 21:36:39 cpollock sendEmail[16754]:[*] kbp_debug: current address: "abuse@turktelekom.com.tr" Oct 02 21:36:39 cpollock sendEmail[16754]:[*] kbp_debug: current address: "(for" Oct 02 21:36:39 cpollock sendEmail[16754]: ERROR => Can't use improperly formatted email address: (for Oct 02 21:36:39 cpollock sendEmail
 
Old 10-02-2010, 10:04 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Looks like part of a syslog entry is creeping into one of these - @to, @cc, @bcc, $from, $opt{'reply-to'}

Try splitting it out into each argument to see which one's dodgy:
Code:
    foreach my $addr (@to) {
        if ($addr) {
            printmsg("[*] kbp_debug (to): current address: \"$addr\"", 0); 
            if (!returnAddressParts($addr)) {
                printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
                printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
                quit("", 1);
            }
        }
    }

    foreach my $addr (@cc) {
        if ($addr) {
            printmsg("[*] kbp_debug (cc): current address: \"$addr\"", 0); 
            if (!returnAddressParts($addr)) {
                printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
                printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
                quit("", 1);
            }
        }
    }

    foreach my $addr (@bcc) {
        if ($addr) {
            printmsg("[*] kbp_debug (bcc): current address: \"$addr\"", 0); 
            if (!returnAddressParts($addr)) {
                printmsg("ERROR => Can't use improperly formatted email address: $addr", 0);
                printmsg("HINT => Try viewing the extended help on addressing with \"--help addressing\"", 1);
                quit("", 1);
            }
        }
    }

# etc...
 
Old 10-03-2010, 08:28 AM   #7
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Actually those entries goto the sendEmail log and sometimes it works fine as in this entry:
Code:
[*] kbp_debug (to): current address: "admin@fraudwatchinternational.com"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "phishing-report@us-cert.gov"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "reportphishing@antiphishing.org"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "spam@mailpolice.com"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "submit@phishcop.net"
cpollock sendEmail[23679]:[*] kbp_debug (bcc): current address: "cpollock@embarqmail.com"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
cpollock sendEmail[23679]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
Email was sent successfully!  From: <cpollock@embarqmail.com> To: <admin@fraudwatchinternational.com> <phishing-report@us-cert.gov> <reportphishing@antiphishing.org> <spam@mailpolice.com> <submit@phishcop.net> Bcc: <cpollock@embarqmail.com> Subject: [Phish URL] Server: [smtp.embarqmail.com:587]
Then on the next report it just doesn't work:
Code:
DEBUG => Assigned $opt{} key/value: tls => auto
cpollock sendEmail[24749]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
cpollock sendEmail[24749]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.22674
cpollock sendEmail[24749]:[*] kbp_debug (to): current address: "abuse@limestonenetworks.com"
cpollock sendEmail[24749]:[*] kbp_debug (bcc): current address: "cpollock@embarqmail.com"
cpollock sendEmail[24749]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
cpollock sendEmail[24749]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"[*] kbp_debug (to): current address: "info@kickme.to"
cpollock sendEmail[26310]:[*] kbp_debug (to): current address: "(for"
ERROR => Can't use improperly formatted email address: (for
 
Old 10-03-2010, 10:10 PM   #8
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Ok .. so the the problem may be in what is passed to sendEmail as $msgto by sendPhish. More hax ahead ...

Add a line before each 'sendEmail' call something like this for line 596:
Code:
echo "Line 596: sendEmail -l $maillogfile -s $smtpserver -o tls=auto -xu $smtpuseracct -xp $smtppassword -o reply-to=$msgreplyto -t $msgto -f \"$msgfrom\" -bcc \"$msgbcc\" -u \"Phish URL\" -m \"$phishurl\"" >> /tmp/kbp_debug.log
Note the escaped '"' double-quote characters and the line number.

This should log each call to 'sendEmail' then we'll know for sure whether the garbage is being introduced in sendPhish.

cheers
 
Old 10-04-2010, 05:42 PM   #9
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Hopefully I did this correctly, for instance I put this above the actuall sendEmail call:

Code:
echo "Line 596: sendEmail -l $maillogfile -s $smtpserver -o tls=auto -xu $smtpuseracct -xp $smtppassword -o reply-to=$msgreplyto -t $msgto -f \"$msgfrom\" -bcc \"$msgbcc\" -u \"Phish URL\" -m \"$phishurl\"" >> /tmp/kbp_debug.log 
				sendEmail -l $maillogfile -s $smtpserver -o tls=auto -xu $smtpuseracct -xp $smtppassword -o reply-to=$msgreplyto -t $msgto -f "$msgfrom" -bcc "$msgbcc" -u "Phish URL" -m "$phishurl" > /tmp/sendemailbglog.$$ &
These are the log entries:
Code:
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://www.8bit.at/"
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://www.8bit.at/index.html"
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://8bit.at/index.html"
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://8bit.at/"
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://8bit.at"
Line 596: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t admin@fraudwatchinternational.com,phishing-report@us-cert.gov,reportphishing@antiphishing.org,spam@mailpolice.com,submit@phishcop.net -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://www.8bit.at"
Line 1095: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t info@kickme.to,(for,kickme.to),hostmaster@lunarpages.com -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://www.8bit.at/"
Line 1095: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t info@kickme.to,(for,kickme.to),hostmaster@lunarpages.com -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://zyngabonus-gift-luckywinner.8bit.at/"
Code:
Oct 04 17:30:26 cpollock sendEmail[8258]: DEBUG => Assigned $opt{} key/value: tls => auto
Oct 04 17:30:26 cpollock sendEmail[8258]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
Oct 04 17:30:26 cpollock sendEmail[8258]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.2873
Oct 04 17:30:26 cpollock sendEmail[8258]:[*] kbp_debug (to): current address: "info@kickme.to"
Oct 04 17:30:26 cpollock sendEmail[8258]:[*] kbp_debug (to): current address: "(for"
Oct 04 17:30:26 cpollock sendEmail[8258]: ERROR => Can't use improperly formatted email address: (for
Oct 04 17:30:26 cpollock sendEmail[8258]: HINT => Try viewing the extended help on addressing with "--help addressing"
 
Old 10-04-2010, 06:05 PM   #10
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
This looks like the culprit ..
Code:
Line 1095: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t info@kickme.to,(for,kickme.to),hostmaster@lunarpages.com -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://www.8bit.at/"
Line 1095: sendEmail -l /home/chris/sendEmaillogfile.txt -s smtp.embarqmail.com:587 -o tls=auto -xu cpollock@embarqmail.com -xp XXXXXXXXX -o reply-to=cpollock@embarqmail.com -t info@kickme.to,(for,kickme.to),hostmaster@lunarpages.com -f "cpollock@embarqmail.com" -bcc "cpollock@embarqmail.com" -u "Phish URL" -m "http://zyngabonus-gift-luckywinner.8bit.at/"
.. it doesn't pass the email address validator in sendEmail (correctly), can you tell where this is coming from ?

<edit>Just had some time to look at it further, looks like you may have to add the bad address to abuseaddrdel.txt as it's managing to get through the validation in getabuseaddr()</edit>

Last edited by kbp; 10-04-2010 at 06:41 PM.
 
Old 10-04-2010, 07:48 PM   #11
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Hmm, I put

info@kickme.to
kickme.to

in my abuseaddrdel file and still get:
Code:
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: tls => auto
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: reply-to => cpollock@embarqmail.com
Oct 04 19:31:32 cpollock sendEmail[6672]: DEBUG => Assigned $opt{} key/value: message-file => /tmp/msgbody.5170
Oct 04 19:31:32 cpollock sendEmail[6672]:[*] kbp_debug (to): current address: "info@kickme.to"
Oct 04 19:31:32 cpollock sendEmail[6672]:[*] kbp_debug (to): current address: "(for"
Oct 04 19:31:32 cpollock sendEmail[6672]: ERROR => Can't use improperly formatted email address: (for
Oct 04 19:31:32 cpollock sendEmail[6672]: HINT => Try viewing the extended help on addressing with "--help addressing"
I don't understand where the script is getting this:

kbp_debug (to): current address: "(for"
ERROR => Can't use improperly formatted email address: (for

a to: address of 'for'

While a successful post shows:

Code:
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "abuse@ntt.net"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (bcc): current address: "cpollock@embarqmail.com"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
Oct 04 19:07:26 cpollock sendEmail[27934]:[*] kbp_debug (to): current address: "cpollock@embarqmail.com"
Checking at 'whois.abuse.net' for kickme.to I get

Code:
[chris@localhost ~]$ telnet whois.abuse.net 43
Trying 64.57.183.95...
Connected to whois.abuse.net (64.57.183.95).
Escape character is '^]'.
kickme.to
info@kickme.to (for kickme.to)
So the script appears to be parsing the correct address for abuse, or am I just confusing myself more?
 
Old 10-04-2010, 09:15 PM   #12
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
No .. the script isn't parsing it correctly. I just tested the command from line 381 and it seems to work ok for me(output in red):

Code:
# cat <<'EOF'> /tmp/test.txt
blah1
info@kickme.to (for kickme.to)
blah3
EOF

# cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
blah1,info@kickme.to,blah3
Maybe your version of grep is not doing what it's assumed to in the script, please try the same test

thanks
 
Old 10-04-2010, 09:42 PM   #13
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
Looks ok to me:

Code:
[root@localhost ~]# cat <<'EOF'> /tmp/test.txt
> blah1
> info@kickme.to (for kickme.to)
> blah3
> EOF
[root@localhost ~]# cat /tmp/test.txt | grep -v -e "default" | grep -o -E -e "[^[:space:]]*" | tr '\012' "," | sed -r s/",$"/"\n"/g
blah1,info@kickme.to,(for,kickme.to),blah3

/tmp/test.txt shows

blah1
info@kickme.to (for kickme.to)
blah3
 
Old 10-04-2010, 09:55 PM   #14
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Sorry, doesn't look ok to me -

Quote:
blah1,info@kickme.to,(for,kickme.to),blah3
Which version of grep are you using ? <edit> and sed and tr ? </edit>

Last edited by kbp; 10-04-2010 at 10:01 PM.
 
Old 10-05-2010, 06:04 AM   #15
Toadman
Member
 
Registered: Aug 2002
Location: Copperas Cove, Texas
Distribution: Ubuntu 20.04 LTS
Posts: 304

Original Poster
Rep: Reputation: 21
GNU grep 2.5.3
GNU sed version 4.1.5
tr (GNU coreutils) 8.5
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run a shell script/cronjob when any email arrive to specific email address ikillu Linux - General 3 05-30-2009 08:18 AM
Very Newbie question, My system generated email are not being formatted in HTML dcarnold56 Linux - Server 1 01-20-2009 12:25 PM
Outgoing email improperly marked as spam by yahoo/msn terataz Linux - Server 6 08-22-2008 11:09 AM
Can I email (formatted) directly to a printer? ayhopkins Linux - Newbie 4 02-25-2008 02:58 PM
usb hard disk has 57% usage after formatted... sugar2 Linux - Hardware 2 08-10-2007 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration