🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
4 messages
4 total messages Started by Arnold Shore Thu, 28 Jul 1994 13:57
tin and mailer aliases - please help!
#10419
Author: Arnold Shore
Date: Thu, 28 Jul 1994 13:57
23 lines
1592 bytes
Using tin 1.2 PL2, I'm trying to get at my elm aliases without success.  
I'm using the info in FAQ para 3.3, and have edited the noted parameter 
line into the tinrc file.

1.  The alias doesn't get picked up.

2.  The parameter line plus preceding # comment line are dropped from
tinrc. 

If tin removes offending parameter lines then this is a clue, I suppose.  
(But also the adjacent comment?)  But I've used the FAQ information 
literally, since it coincides with what I'm after.

Will appreciate any insights/suggestions/wisecracks/whatever.

Thanks.
 --

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          |
ashore@access.digex.net   |  Signature?  I don't need no steenkeen'
                          |           signature!
                          |
Re: tin and mailer aliases - please help!
#10430
Author: Iain Lea
Date: Thu, 28 Jul 1994 21:31
14 lines
1377 bytes
Arnold Shore (ashore@access1.digex.net) wrote:
: Using tin 1.2 PL2, I'm trying to get at my elm aliases without success.  
: I'm using the info in FAQ para 3.3, and have edited the noted parameter 
: line into the tinrc file.
: 1.  The alias doesn't get picked up.
: 2.  The parameter line plus preceding # comment line are dropped from
: tinrc. 
: Will appreciate any insights/suggestions/wisecracks/whatever.

It states that the FAQ is written for the upcoming 1.3 release.

-- 
iain.lea@erlm.siemens.de  +49-9131-7-43402
 'Raus aus dem Alltag, rein in die Kiste'
Re: tin and mailer aliases - please help!
#10538
Author: Frederik Ramm
Date: Tue, 02 Aug 1994 08:46
140 lines
4887 bytes
Arnold Shore (ashore@access1.digex.net) wrote:
: Using tin 1.2 PL2, I'm trying to get at my elm aliases without success.  
: I'm using the info in FAQ para 3.3, and have edited the noted parameter 
: line into the tinrc file.

I use my elm aliases with tin the following way: I've set the environment
variable MAILER to a small program named 'elmcall' which someone in some
newsgroup once sent me :-)... this 'elmcall' calls elm which then sends the
mail.

You can also use 'elm' directly as a mailer but then it may happen that
your subject line is replaces with "no subject - file transmision", 
which is the reason for using 'elmcall' - it takes the subject and puts
it onto the elm command line (or was it vice versa?) to avoid this.

Here goes elmcall.c: (Sorry I've forgotten the author and can't credit
him but it was a great idea):

/* Fix to use elm as mailer for tin
 * -- Reads standard in, finds subject, and sends to elm
 * to mail.  If a subject line exists it is removed,as elm adds it back in.
 * Advantage over tin builtin mailer is that
 * messages get written to elm 'sent' folder, and elm aliases can be used.
 * This code written rather than hacking tin, so that I don't have to search
 * out every occurance of mailing .... wold not be so much of a problem if 
 * invoke-mailer() routine actually existed.
 * @(#) tin_mailer.c 1.3@(#) R.E.May. BBC Research Department. December 1993.
 * usage: tin_mailer to_addr [ to_addr ... ] < send_file 
 */
/* Compile using ansi c compiler (I've only tried it with gcc, although it
 * should be straightfoward to hack it to work with standard cc.)
 * i.e. gcc -O -o tin_mailer tin_mailer.c
 * Then set environmental variable MAILER to the path of this program.
 * e.g for c-shell users setenv MAILER ~/bin/tin_mailer
 * and for bourne-shell users MAILER=~/bin/tin_mailer;export MAILER
 * try it and see !!
 */
#include <stdio.h>
#include <string.h>
#define LEN 1024
#define FALSE 0
#define TRUE 1
/* set MAILER to the full path of your elm executable */
#define MAILER "/usr/bin/elm"

void my_strncpy (char *p, char *q, int n);

void main(int argc, char *argv[])
{
	char buf[LEN];
	char subj[LEN];
	char mailer[LEN];
	char mail_to[LEN];
	char cmd[LEN];
	char tmpfile[L_tmpnam];
	char *p;
	int found = FALSE;
	int i;
	FILE *fp;

	*subj = '\0';

	strcpy(mailer,MAILER);
	/* get mail_to address(es) */
	if(argc > 1)
	{
		strcpy(mail_to,argv[1]);
		if(argc > 2)
		{
			for(i=2;i<argc;i++)
			{
				strcat(mail_to," ");
				strcat(mail_to,argv[i]);
			}
		}
	}
	else
	{
		fprintf(stderr,"%s: No address to send mail to\n",argv[0]);
		exit(1);
	}

	/* get a tmp file name */
	(void)tmpnam(tmpfile);
	if((fp = fopen(tmpfile,"w")) ==NULL)
	{
		fprintf(stderr,"%s: could not open tmp file %s.\n",argv[0],tmpfile);
		exit(1);
	}

	/* find first Subject:  line, and keep its contents.
	 * write anything else to the tmp file.
	 * Don't write Subject:  line, as elm will add it
	 */
	while (fgets (buf, sizeof (buf), stdin) != NULL)
	{
		if (!found && strncmp (buf, "Subject: ", 9) == 0)
		{
			my_strncpy (subj, &buf[9], sizeof (subj));
			found = TRUE;
		}
		else
			fputs(buf,fp);
	}

	(void)fclose(fp);

	/* If we didn't find a Subject: line in the text to be posted
	 * make one up ...
	 */
	if(!found)
		sprintf(subj,"%s: No Subject",argv[0]);

	sprintf(cmd,"%s -s \"%s\" \"%s\" < %s",mailer,subj,mail_to,tmpfile);
	system(cmd);

	/* remove tmp file */
	if(unlink(tmpfile) == -1)
	{
		fprintf(stderr,"%s: could not remove tmp file %s\n",argv[0],tmpfile);
		exit(1);
	}

	exit(0);
}

/* copy up to n characters */
/* don't copy RETURN char, if there is one */
void my_strncpy (char *p, char *q, int n)
{
	while (n--) {
		if (! *q || *q == '\n')
			break;
		*p++ = *q++;
	}
	*p = '\0';
}

--
Frederik Ramm  ##  eMail ule3@rz.uni-karlsruhe.de  ## fax +49 721 379786
Re: tin and mailer aliases - please help!
#10541
Author: Rob May
Date: Tue, 02 Aug 1994 09:33
20 lines
1652 bytes
Frederik Ramm (ule3@rzstud1.rz.uni-karlsruhe.de) wrote:
: Arnold Shore (ashore@access1.digex.net) wrote:
: : Using tin 1.2 PL2, I'm trying to get at my elm aliases without success.  
: : I'm using the info in FAQ para 3.3, and have edited the noted parameter 
: : line into the tinrc file.

The info about this in the FAQ is only good for Tin 1.3.

: I use my elm aliases with tin the following way: I've set the environment
: variable MAILER to a small program named 'elmcall' which someone in some
: newsgroup once sent me :-)... this 'elmcall' calls elm which then sends the
: mail.

Glad people are still finding this useful.

Rob.
--
--- Robert May. e-mail: robert.may@rd.eng.bbc.co.uk Tel: +44 737 836535 ---
-- You may post,  repost or publish *ANY* communication received from me --
----- All opinions are mine and are not necessarily shared by the BBC -----
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads