Re: perl and exim filter
On Sat, 3 Jun 2000 ulla.russell@pp.inet.fi wrote:
> 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 () {'
>
I'm afraid I won't be of much help, but whenever I check for either
hampaita.fi or pp.inet.fi I don't seem to be able to find the domains at
all:
[jortega@coimbra jortega]$ nslookup pp.inet.fi
Server: ns3.mn.uswest.net
Address: 204.147.80.1
*** No address (A) records available for pp.inet.fi
[jortega@coimbra jortega]$ nslookup hampaita.fi
Server: ns3.mn.uswest.net
Address: 204.147.80.1
*** ns3.mn.uswest.net can't find hampaita.fi: Non-existent host/domain
Are you sure you're not dealing with a simple name resolution and mail
problem here, as opposed to a scripting problem?
--
Nitebirdz
http://www.linuxnovice.org
Tips, articles, news, links...
Reply to: