LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-04-2007, 07:35 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
About running telnet


Hi folks,


I have been googling around for cc and attachment commands on running telnet so I can cc copies to other recipients and attach doc on the mail sent.

I found following doc;
Sending Mail (SMTP)
http://www.cs.cf.ac.uk/Dave/PERL/node175.html


but can't find the commands for such actions. Please shed me some light. TIA


B.R.
satimis
 
Old 11-04-2007, 11:24 AM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Re: About running telnet

The link you listed has this line:

RCPT TO: <user@email.com>. You can indicate more than one user by issuing multiple RCPT commands.

You can use multiple RCPT commands to send to multiple users. Seems simple enough.
 
Old 11-04-2007, 01:01 PM   #3
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Possible How-To

Our Linux servers use mailsend to pack up reports and send them through sendmail as attachments. This is sendmail's website, and you can download the source.

http://www.muquit.com/muquit/softwar.../mailsend.html
 
Old 11-04-2007, 11:13 PM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by David1357 View Post
The link you listed has this line:

RCPT TO: <user@email.com>. You can indicate more than one user by issuing multiple RCPT commands.

You can use multiple RCPT commands to send to multiple users. Seems simple enough.
Thanks for your advice.

I have been googling around for "multiple rcpt commands" w/o result. Is it a plugin?

Tried follows w/o result

rcpt to:<user1> session
555 5.5.4 Unsupported option: session
rcpt to:<user1> SESSION
555 5.5.4 Unsupported option: SESSION

Please advise? TIA


satimis
 
Old 11-04-2007, 11:20 PM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by cmnorton View Post
Our Linux servers use mailsend to pack up reports and send them through sendmail as attachments. This is sendmail's website, and you can download the source.

http://www.muquit.com/muquit/softwar.../mailsend.html
Thanks for your advice and URL.

I'm running postfix on this server. Can I use this package? If YES, where will be an ideal directory to download "mailsend1.15b5.tar.gz"? Shall I run "telnet" at start OR just this package ONLY?

TIA


B.R.
satimis
 
Old 11-05-2007, 01:14 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
multiple recepients - SOLVED

Hi folks,


I got it done. Each "rcpt to:user1/2/3...@xyz.com" must be a new line.

Previously I made a mistake by running;
Code:
rcpt to:user1@xyz.com, user2@xyz.com, etc.
It failed.

I'm now searching for solution on the remaining problem, attchachment.

Thanks


satimis
 
Old 11-05-2007, 09:45 AM   #7
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by satimis View Post
I have been googling around for "multiple rcpt commands" w/o result. Is it a plugin?
No, it is a standard command. It is part of RFC 821: RFC 821: SIMPLE MAIL TRANSFER PROTOCOL
Quote:
Originally Posted by satimis View Post
Tried follows w/o result

rcpt to:<user1> session
555 5.5.4 Unsupported option: session
rcpt to:<user1> SESSION
555 5.5.4 Unsupported option: SESSION

Please advise? TIA
RCPT only takes one option, an e-mail address. You cannot add the "session" at the end.

You might want to read the entire RFC before continuing your efforts.
 
Old 11-05-2007, 10:27 AM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Using mutt:
http://www.linuxquestions.org/questi...d-file-383997/
 
Old 11-05-2007, 03:52 PM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Re: About running telnet

Quote:
Originally Posted by satimis View Post
I'm now searching for solution on the remaining problem, attchachment.
You will need to convert the attachment to text and add it to the mail. Here is an example of how it will look:

------_=_NextPart_001_01C815FA.3D2B8065
Content-Type: application/x-zip-compressed;
name="messages.zip"
Content-Transfer-Encoding: base64
Content-Description: messages.zip
Content-Disposition: attachment;
filename="messages.zip"

UEsDBBQAAAAIAKRFVjfgzzbDlU4BAFDBEAAIAAAAbWVzc2FnZXPUXW1z2ziS/n6/AlezdetU2TQJ
...
There will be many lines that look like the last one before the "...". You will also need to indicate that the e-mail is a multi-part message somewhere in the header. I will leave the details as an exercise for you to complete.
 
Old 11-06-2007, 03:08 AM   #10
tsquared
LQ Newbie
 
Registered: Nov 2007
Posts: 1

Rep: Reputation: 0
Thank You! I hope my daughter will like these.
 
Old 11-06-2007, 06:48 AM   #11
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by nx5000 View Post
Thanks for your advice and link.

I have mutt installed.

Where shall I run the command;
Code:
echo "Body" | mutt -a file1 -a file2 -s "Subject" email@domain.com
On running telnet command;
Code:
telnet localhost 25
ehlo domain.com
mail from: user1@domain.com
rcpt to: recepient@his_domain.com
data
Subject:
...
...
.[Enter]
quit
Is the command to be modified as;
Code:
echo "Body" mutt -a /path/to/file1 -a /path/to/file2 -s "Subject" recepient@his_domain.com
???

TIA


I'm prepared to attach .pdf files. Does it work to attach .pdf files. Any additional steps in between before sending the attachment. Thanks


B.R.
satimis
 
Old 11-06-2007, 07:23 AM   #12
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Run it like you run telnet, in a shell


echo "Body" | mutt -a file1 -a file2 -s "Subject" email@domain.com

It depends on your experience in shell scripting.
| means take the output of the left command and "inject" it in the right command.
echo "body" .. prints "body"
mutt takes as input the body of the email
So this command will send a mail with subject "Subject" to recipient email@domain.com , attaches file1 and file2 and in the body of the email adds a single line: "Body".

If you have the body of the email in file body.txt (containing several lines for example), you can also do:

cat body.txt | mutt ...

I highly suggest that you read the man page of mutt, I don't know all the options and it depends on what you need. Especially the part about muttrc where you can put the "from user1@domain.com"

Ah yes, I haven't tried this command actually but it should work. Pdf or whatever should work.
 
Old 11-07-2007, 05:00 AM   #13
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by nx5000 View Post
Run it like you run telnet, in a shell


echo "Body" | mutt -a file1 -a file2 -s "Subject" email@domain.com

It depends on your experience in shell scripting.
| means take the output of the left command and "inject" it in the right command.
echo "body" .. prints "body"
mutt takes as input the body of the email
So this command will send a mail with subject "Subject" to recipient email@domain.com , attaches file1 and file2 and in the body of the email adds a single line: "Body".

If you have the body of the email in file body.txt (containing several lines for example), you can also do:

cat body.txt | mutt ...

I highly suggest that you read the man page of mutt, I don't know all the options and it depends on what you need. Especially the part about muttrc where you can put the "from user1@domain.com"

Ah yes, I haven't tried this command actually but it should work. Pdf or whatever should work.
Hi nx5000,


mutt is a wonderful package, easy and straight forward to use,

On echo "message_body", to change a new line just pressing [Enter]. Pressing [Enter] twice adds a blank line. The options;

-b for bcc followed by email_address
-c for cc followed by email_address

Any format of doc, .jpd, .pdf, .doc, etc can be attached.

Thanks again.


satimis
 
Old 11-07-2007, 10:40 AM   #14
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Hummm easy I'm not sure.
Using mutt for this case (in CLI) is very easy yes but start mutt TUI (simply by typing "mutt") and that's another story. It's like when you discover vi, it's either you love it or hate it..
I'm using it as my localmail reader (syslog, logwatch). It has very powerfull possibilties.
 
  


Reply

Tags
offtopic



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't get Kerberos telnet daemon running on RHEL 3 nickgarnett Linux - Networking 0 11-21-2006 04:58 PM
Running Telnet in a script, want to save Telnet output, howtodothis??? anil3 Linux - Software 2 03-08-2006 04:01 PM
How to tell if telnet server is running? quintan Linux - Networking 4 08-30-2005 11:31 AM
Telnet no response to port 25 running Postfix shyee Fedora 2 01-09-2005 09:13 PM
Running X applications via telnet orlenok Linux - Networking 22 10-05-2003 03:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:26 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