Discussion:
Using .forward files with .exim.
r***@elastica.com
2006-12-29 17:49:24 UTC
Permalink
So I'm moving to a hosting provider who uses exim having come from one who used
qmail.

Previously I had a ~/.qmail file to invoke a perl script as my own filter and
this filter had responsibility using Mail::Audit etc to route the mail into
appropriate mail folders etc.

Firstly, can anybody show me the syntax for .forward with exim.

Also, in the past I have occasionally had an error or two in the filter thus
causes bounces. but these bounces have been temporary.

Can anybody tell me if .forward works the same way with exim. ie. if the perl
script has a syntax error will it be a temporary or permanent bounce? ie. will
I risk losing email in the event of a syntax error in the filter?



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
W B Hacker
2006-12-29 18:29:39 UTC
Permalink
Post by r***@elastica.com
So I'm moving to a hosting provider who uses exim having come from one who used
qmail.
Previously I had a ~/.qmail file to invoke a perl script as my own filter and
this filter had responsibility using Mail::Audit etc to route the mail into
appropriate mail folders etc.
Firstly, can anybody show me the syntax for .forward with exim.
Also, in the past I have occasionally had an error or two in the filter thus
causes bounces. but these bounces have been temporary.
Can anybody tell me if .forward works the same way with exim. ie. if the perl
script has a syntax error will it be a temporary or permanent bounce? ie. will
I risk losing email in the event of a syntax error in the filter?
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Exim *can* action a '.<whatever>' in a similar manner to other MTA which use
that structure, but, in your case:

- it may or may not be configured to do so

- the provider may or may not permit asking 'their' MTA to run 'your' perl
scripts, viz simple .forwards.

How it handles errors (of any kind) is also *highly* configurable.

As a 'customer', it is unlikely that you will have access to the basic OS & Exim
configuration information that folks on this list would need to help, let alone
the ability to modify same.

The new hosting provider should be the best (only?) party able to assist you.

HTH,

Bill
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Ian Eiloart
2006-12-30 11:46:50 UTC
Permalink
Post by r***@elastica.com
Firstly, can anybody show me the syntax for .forward with exim.
<http://www.exim.org/exim-html-4.63/doc/html/filter.html>
--
Ian Eiloart
IT Services, University of Sussex
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Josip Rodin
2006-12-30 12:16:45 UTC
Permalink
Post by Ian Eiloart
Post by r***@elastica.com
Firstly, can anybody show me the syntax for .forward with exim.
<http://www.exim.org/exim-html-4.63/doc/html/filter.html>
But do note the paragraph that starts with "The contents of traditional
.forward files are not described here..." :)
--
2. That which causes joy or happiness.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Robert Nicholson
2006-12-30 18:46:52 UTC
Permalink
Regarding this

"If, however, no significant deliveries are set up, Exim continues
processing the current address as if there were no filter file, and
typically sets up a delivery of a copy of the message into a local
mailbox. In particular, this happens in the special case of a filter
file containing only comments."

....

my perlscript ie. pipe will take care of all mail and I don't want
any deliveries scheduled after my filter has finished.

my perlscript uses Mail::Audit to archive the message content into
the appropriate mail folder and I don't need the filter to deliver
mail after that has happened. ie. the perlscript has a catch all as
well.

So how can you tell the filter file to not schedule any deliveries?

so if my .forward file looks like this

# Exim filter
if error_message then finish endif
pipe $home/perlscripts/filter.pl
#mail subject "message discarded"
finish

will it try to make any significant delivery?
Post by Josip Rodin
Post by Ian Eiloart
Post by r***@elastica.com
Firstly, can anybody show me the syntax for .forward with exim.
<http://www.exim.org/exim-html-4.63/doc/html/filter.html>
But do note the paragraph that starts with "The contents of
traditional
.forward files are not described here..." :)
--
2. That which causes joy or happiness.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Magnus Holmgren
2006-12-30 20:26:40 UTC
Permalink
Post by Robert Nicholson
so if my .forward file looks like this
# Exim filter
if error_message then finish endif
pipe $home/perlscripts/filter.pl
#mail subject "message discarded"
finish
will it try to make any significant delivery?
See section 3.8 of the beforementioned specification, which says that 'The
delivery commands deliver, save, and pipe are by default significant.
However, if such a command is preceded by the word “unseen”, its delivery is
not considered to be significant. In contrast, other commands such as mail
and vacation do not set up significant deliveries unless preceded by the
word “seen”.'

In other words, your example aboves sets up a significant delivery except for
error messages (bounces), which will be delivered "normally". Note that the
decision to pipe the mail through filter.pl is made at routing time, meaning
that Exim won't try a different delivery if the perl script fails. If it
fails, the message will be returned to the sender unless the exit code
indicates a temporary failure (by default EX_TEMPFAIL (75)), in which case
Exim retries later, starting with the routing.
--
Magnus Holmgren ***@lysator.liu.se
(No Cc of list mail needed, thanks)

"Exim is better at being younger, whereas sendmail is better for
Scrabble (50 point bonus for clearing your rack)" -- Dave Evans
Josip Rodin
2006-12-31 15:56:27 UTC
Permalink
Post by Robert Nicholson
so if my .forward file looks like this
# Exim filter
if error_message then finish endif
pipe $home/perlscripts/filter.pl
#mail subject "message discarded"
finish
will it try to make any significant delivery?
If the above is all you need, just use the simple old .forward syntax:

|$HOME/perlscripts/filter.pl

In the usual circumstances, the variable HOME will be set properly.
To find documentation for this, look for the pipe transport in the manual.
--
2. That which causes joy or happiness.
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Robert Nicholson
2006-12-30 19:55:05 UTC
Permalink
Should this .forward file at least put the mail thru the pipe?

# Exim filter
logfile $home/filter.log
if error_message then finish endif
log "sending message $message_id to pipe"
pipe $home/perlscripts/filter.pl
#mail subject "message discarded"
finish
--
## List details at http://www.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/
Continue reading on narkive:
Loading...