FAQ about patches | More patches | Main Page | MD5 sum for this patch

Pine sends e-mail from the command line
Patch is available for versions:
pine 4.10 pine 4.20 pine 4.21 pine 4.30 pine 4.31 pine 4.32 pine 4.33 pine 4.40 pine 4.41 pine 4.42 pine 4.43 pine 4.44 pine 4.50 pine 4.51 pine 4.52 pine 4.53 pine 4.55 pine 4.56 pine 4.58 pine 4.60 pine 4.61 pine 4.62 pine 4.63 pine 4.64

Note that you if you are applying this patch for version 4.20 or earlier, you must first compile pine, then apply the patch and then compile pine again. Starting from version 4.21, you must apply the patch and compile Pine.
 
Once you have succesfuly applied and compiled the patch, you can send a message through the command line as follows:
 
pine -I ^X,y -subject "this is a subject" foo1@bar1.com foo2@bar2.com < input_file
 
(notice that the first switch is the capital letter I, not the pipe command |, I apologize if this causes you any confusion) This will allow you to send input_file to foo1 and foo2. I could send a message from a script, just enclosing ^X,y in quotes. Please read the note below.
 
Note that depending on the operative system that you are using you may want to enclose the ^X,y part of the command in quotes (like "^X,y" or '^X,y'), if you receive an error saying that the -I option did not have any arguments. Also if you are planning to use this patch in conjunction with a cron job and these suggestions do not work for you, you may want to read some extra suggestions sent to me by Darrel Woodard.
 
You can also use the -attach option with this command. I recommend to alias the part pine -I ^X,y to be another command, to abbreviate the command.
 
A new improvement for version 4.33 has been made, now you can use your roles when sending from the command line, for doing this you need to use the command:
 
pine -I #,^M,^X,y -subject "this is a subject" person@domain.com < file
 
You can use your second role by writting -I #,n,^M,^X,y, your third role by using the command -I #,n,n,^M,^X,y etc.
 
Note that Pine will not confirm the role that you will use when sending a message even if you have set it to use with confirmation, in that way we reduce prompting when sending. If you want to use a specific role, use the method of sending it as described above (#,n,n etc).
 
In version 4.62 I have added code so that you can use commands in Pico and or Pine before you send a message. For example, if you want to attach a file you can use the ^J command to attach a message. Although you can do this from the command line with the -attach switch, you can also use this method to add a comment to the attachment, for example the command
 
pine -I ^J,\"file\",^M,\""Sample Comment"\",^M,^X,y foo@bar.com
 
worked in my Linux machine to send a message with attachments from the command line. Thanks to Paulus Raimund for the suggestion and testing a version of this patch.
 
Another interesting thing you can do is to add Cc:, Bcc:, or any header with any value. For example, you can try adding
 
-customized-hdrs='Cc: "person@some.place,another@somewhere.else",Other-Header: "Here is the value"'
 
As you can see, different headers are separated by commas
...else",Other-Hea...",
while their values are enclosed in double quotes
..."person@some...somewhere.else"...
The full value is enclosed between single quotes
'Cc:...is the value"'.
Since this is done in the command line, the correct way to do this may depend on your shell. The above way works in the tcsh shell.

 
This patch was featured in the issue #20 of the E-Zine Magazine.

Last Updated 19:43:11 PDT Wed Sep 28 2005.