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

Re: exim: misleading package description?



On Thu, Nov 29, 2001 at 11:05:05PM -0400, cmasters wrote:
...
| Hope you don't mind the interruption. You may have noticed my slew of
| postings about difficulties with sorting mail. I read your reponse to mean

Yes ;-).

| that I may not even require the services of procmail, as I ~am~ using exim
| as my MTA. Is this correct? I just want fairly simple pre-sorting of mail
| before I read it with mutt.

Yes.  I haven't actually tried it yet since my mail is delivered to a
Solaris box that I am not an admin on and I have a quota.  I might try
setting up exim for filter-only on it, but not yet.

Here's a sample .forward file that I created from my procmail recipes
after reading that part of the exim manual (as you can see, I wrote
part of the manual in my own words at the top) : 
 
-------- .forward file -------
# Exim filter

#
# Some variable/string expansions :
#   ${reply_address}    :   contents of Reply-To: if exists or From:
#   ${sender_address}   :   contents of envelope sender
#   ${message_headers}  :   all headers concatenated (with newlines)
#
#   $header_<header_name>:  :   contents of the header <header_name>
#

#
# Filter commands :
#   save <filename> [ <mode> ]
#   deliver <address>
#   pipe <command>
#
#   if <condition> then <commands>
#           [ elif <condition> then <commands> ]
#           [ else <commands> ]
#           endif
#
#   finish
#   testprint <text>    :   print debug info when filter is being tested
#   logfile <filename>
#   logwrite
#   add <number> to <user var>
#
#   mail [ to <address-list> ] [ cc <address_list> ] [ from <address> ]
#           [ reply_to <address> ] [ subject <text> ] [ text <text> ]
#           [ [ expand ] file <filename> ] [ return message ] [ log <logfile> ]
#           [ once <note filename> ] [ once_repeat <time interval> ]
#   vacation    :   a special case of 'mail', for vacation notices.
#

#
# Operators (for 'if' commands) :
#
#   or
#   and
#   not
#
#   <var> matches <regex>
#   <var> does not match <regex>
#
#   <var> begins <text>
#   <var> does not begin <text>
#
#   <var> ends <text>
#   <var> does not end <text>
#
#   <var> contains <string>
#
#   <var> is <string>
#
#  <number1> is above <number2>
#  <number1> is not above <number2>
#
#  <number1> is below <number2>
#  <number1> is not below <number2>
#
#  personal [ alias <address> ]*    :   shorthand check for personal mail ;
#                                       any number of aliases can be given ;
#                                       see docs for details
#
#  ${error_message} :   true when the message is a mail delivery error message
#
#  foranyaddress <string> ( <condition> )   :
#           iterate over list of addresses in <string> and apply <condition> ;
#           ${thisaddress} is set to the address currently being processed
#

#
# debian-user
#
if $header_X-Mailing-List: contains "debian-user" then
    save ~/Mail/lists/debian-user/
endif

#
# debian-python
#
if ${message_headers} contains "debian-python@lists.debian.org" then
    save ~/Mail/lists/debian-python/
endif

#
# python-tutor
#
if 
    $header_To: contains "tutor" or
    $header_Cc: contains "tutor" 
then
    save ~/Mail/lists/python-tutor/
endif

#
# the default action, if nothing else matches
#
save ~/Mail/filteredinbox/



As you can see it looks more like psuedo code, rather than (arbitry)
delimiters.  I don't know how to do any complex regex matches like
procmail can do, but most of the time my regexes are not complex at
all.

HTH,
-D

-- 

For society, it's probably a good thing that engineers value function
over appearance.  For example, you wouldn't want engineers to build
nuclear power plants that only _look_ like they would keep all the
radiation inside.
    (Scott Adams - The Dilbert principle)



Reply to: