[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

perl and exim filter



I have recently been setting up my email on 
the linux side and decided to use a tip that 
I found in an old addition of the linux gazette.

Basically the idea is to create a filter for mail
leaving the local system. I tried to use it a few 
times but the mail keep being sent back with the 
following:

	A message that you sent could not be delivered 
	to all of its recipients. The following address(es) 
	failed:

  	ulla.russell@pp.inet.fi:
    	SMTP error from remote mailer after MAIL FROM:
    	<irvine@hampaita.fi> SIZE=1412:
    	host mail.inet.fi [192.54.155.189]:
    	553 hampaita.fi does not exist

Anyway here is the code in question. 
	#!/usr/bin/perl 

	while (<>) {
        	if (/^From: /) { 
			s/<.*>/<ulla.russell@pp.inet.fi>/; 
			print; 
			last; 
		}
        print;  	
	}
	while(<>){ 	
		print; 
	}


The idea is to place a reference to this on exim.conf and it would
be used when mail was being sent outside of the system.
I know next to nothing about perl  and I'm not sure whether the 
author may have made a typo or the syntax may be outdated. When I 
try to source it I get the following:

	bash: /usr/local/bin/mail-filter: line 3: syntax error near unexpected t	oken `()'
	
	bash: /usr/local/bin/mail-filter: line 3: `while () {'

	



Reply to: