Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 11:31
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Using sylpheed to send mail from the command line.
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
menno
Guest


PostPosted: Fri 03 Jun 2005, 16:52    Post_subject:  Using sylpheed to send mail from the command line.  

I like to send messages with sylpheed , from the command line .
Sorry I know it has been told before someware , but I cann't find it .
Can someone tel me how to do it ?

This is because I like to generate mail by a script .
Back to top
Rich

Joined: 04 May 2005
Posts: 278
Location: Middlesbrough - UK

PostPosted: Fri 03 Jun 2005, 17:40    Post_subject:  

from the command line, type sylpheed --help

This brings up the embedded commands needed.

'sylpheed --compose' and 'sylpheed --send' for example

( is that what you mean - or have I missed the point? ) Smile


Rich
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11122
Location: Arizona USA

PostPosted: Fri 03 Jun 2005, 21:25    Post_subject:  

Thinking that menno meant he couldn't find sypheed in his version of Puppy, I opened rxvt and typed "sylpheed help." Boy, it's there, at least in Puppy 1.0.2. I forgot how much is involved in setting up an email account. Smile
Back to top
View user's profile Send_private_message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sat 04 Jun 2005, 13:16    Post_subject:  

nc would probably work
you might need something like nail
http://nail.sourceforge.net/
Back to top
View user's profile Send_private_message 
menno
Guest


PostPosted: Sat 04 Jun 2005, 13:52    Post_subject:  

Thanks Flash , but it is working .
Thanks Rich , that was I where I was looking for .

I think GuestToo understand what I want . That is sending a eMail by a scriptprogram . I hoped that Sylpheed had a possebility to send a textfile in a way as 'mail' or MAPI does . 'mail <emailadres> <textfile> <attachfiles>' or something like that . I would not make PUPPY bigger and bigger , if posseble I would like to use the programs how are already in PUPPY .

Is it posseble ?
Back to top
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sat 04 Jun 2005, 14:04    Post_subject:  

netcat (called nc in Puppy) might work
see the bottom of this page:
http://www.webservertalk.com/archive109-2004-7-302560.html

nail would be easier ... this deb might work
http://packages.debian.org/stable/mail/nail
Back to top
View user's profile Send_private_message 
menno
Guest


PostPosted: Fri 10 Jun 2005, 17:26    Post_subject: sending eMail  

GuestToo thanks , that was a great help .
Have to send a mail to a mailserver is well documenten by :
http://cr.yp.to/smtp.html this is also found in RFC 2821 .
So start in console : nc <yourmailserver> 25 .
It wil welcom you . Give HELP and you will see the option your mailserver has .
Give QUIT to leave it .
Here is a script than can send a mail :
Code:
#!/bin/sh
log=/dev/tty
smtp_server=your.mail.server
mkfifo /tmp/$$.out
hostname=localhost


read_response () {
 local status=""
 while [ -z "$status" ] ; do
 read line < /tmp/$$.out
 case "$line" in
  [0-9]??' '*) status="$(echo "$line" | sed -e 's/^\(.\).*/\1/')" ;;
  [0-9]???*) true ;;
  *) echo "QUIT" ; sleep 3 ; exit 1 ;;
 esac
 done
 echo "$status"
}

error () {
 echo "RSET"
 if [ $(read_response) != "2" ] ; then echo "RSET Failed" > $log; fi
 echo "QUIT"
 if [ $(read_response) != "2" ] ; then echo "QUIT Failed" > $log; fi
 sleep 3
 exit 1
}

(
if [ $(read_response) != "2" ] ; then error ; fi
echo "HELO $hostname"
if [ $(read_response) != "2" ] ; then echo "HELO Failed" > $log; error ; fi
echo "MAIL FROM:<your.name@your.mail.server>"
if [ $(read_response) != "2" ] ; then echo "MAIL Failed" > $log; error ; fi
echo "RCPT TO:<your.frind@his.mail.adres>"
if [ $(read_response) != "2" ] ; then echo "RCPT Failed" > $log; error ; fi
echo "DATA"
if [ $(read_response) != "3" ] ; then echo "DATA Failed" > $log; error ; fi
echo "To: your.frind@his.mail.adres"
echo "Subject: testje"
echo ""
echo "iets zinnig zeggen"
echo "Eigenlijk nooit !"
echo "."
if [ $(read_response) != "2" ] ; then echo "Delivery Failed" > $log; sleep 3 ; exit 1 ; fi
echo "QUIT"
if [ $(read_response) != "2" ] ; then echo "Closed Failed" > $log; sleep 3 ; exit 1 ; fi
)| nc $smtp_server 25 > /tmp/$$.out
rm /tmp/$$.out
exit 0

#the way QUIT is send as response to a error leads to broken-pipe error in NC
#therefore I changed it a little (menno).

#Thanks to Pascal J. Bourguignon <pjb@informatimago.com> for a LOT of
#help with the above. A great guy.

The real mail , inbetween DATA and the .(dot) has its own protocol most of it is publised in RFC 1521 . It seems to be wise to try it out on your mailserver because I saw that there is a big differrence in how they act to given information . How you eMail program(sylpheed,outlook) reacts to the RFC 1521 is very different .
I hope it helps some other people .
Back to top
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0606s ][ Queries: 11 (0.0061s) ][ GZIP on ]