RE: [Exim] pb using "mail" in filters and using vacation scr…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Bernard Stern
Dátum:  
Címzett: exim-users
Tárgy: RE: [Exim] pb using "mail" in filters and using vacation script...
On Sun, 5 Aug 2001 22:57:37 +0200 "icar" wrote:

(...)

> with the config bellow i have :



> 2001-08-05 22:30:12 15TUXM-0005D4-00 <= xxx@???
> H=web20106.mail.yahoo.com [216.136.226.43] P=smtp S=713
> id=20010805203013.35842.qmail@???
> 2001-08-05 22:30:14 15TUXM-0005D4-00 => icar <icar@???> D=localuser
> T=local_delivery
> 2001-08-05 22:30:14 15TUXM-0005D4-00 == icar@??? <icar@???>
> T=vacation_reply defer (0): Failed to send message from vacation_reply
> transport (69)


... which does not tell very much. You certainly want to play a bit
with exim -d 9 to get more debugging info.

> vacation_reply:
> driver = autoreply
> file = ${home}/tripnote
> file_expand
> log = ${home}/tripnote.log
> once = ${home}/tripnote.db
> from = icar@??? (i tried some settings here ...)
> to = $sender_address
> subject = "Re: $h_subject"
> text = "\
> Dear $h_from\n\n\
> This is an automatic reply. Feel free to send additional\n\
> mail, as only this one notice will be generated. The following\n\
> is a prerecorded message, sent for ${local_part}@???:\n\
> ====================================================\n\n\
> "


mmhhh... it is unnecessary to repeat the "file = " stuff here.
Also, you probably want to be a bit more cautious in the way you
deal with the subject.

vacation_delivery:
  driver  = autoreply
  from    = ${local_part}-vacation@$domain
  to      = $sender_address
  subject = ${if def:header_subject:\
                {${if match {$header_subject:} {^\\s*\$}\
                    {I am on vacation}\
                    {VACATION-RE: ${quote:${escape:${length_50:$header_subject:}}}}\
                  }\
                }\
                {I am on vacation}\
             }
  text = "\
    Dear $header_from:,\n\n\
    This is an automatic reply. Feel free to send additional mail,\n\
    as this one notice will be generated every one week only. The\n\
    following is a prerecorded message, sent for ${local_part}@${domain}.\n\n\
    =================================================================\n\n\
    "
  file_expand
  once_repeat = 7d
  return_message
  mode = 0600
  file = USERS_HOME/${LOOKUP_ADDR_TO_LOGIN{$value}}/OLD_VACMSG
  log  = USERS_HOME/${LOOKUP_ADDR_TO_LOGIN{$value}}/OLD_VACLOG
  once = USERS_HOME/${LOOKUP_ADDR_TO_LOGIN{$value}}/OLD_VACONCE



> in directors :


> user_vacation:
> driver = localuser
> require_files = ${local_part}:${home}/tripnote
> no_verify
> transport = vacation_reply
> unseen


You really WANT to put some condition to avoid sending
vacation messages to list servers, daemons, ...
I'm quite sure the localuser driver is not the correct
one for a vacation mail config.
I have something like that (the all caps are exim macros;
also, the ${LOOKUP_ADDR_TO_LOGIN bit is to "convert"
addresses that don't match unix logins; you most probably don't
want to use that, so you can use your ${local_part}:${home}/tripnote
part instead)

vacation_users:
  driver = smartuser
  suffix = +*
  suffix_optional
  require_files = \
    ${LOOKUP_ADDR_TO_LOGIN \
    {USERS_HOME/${LOOKUP_ADDR_TO_LOGIN{$value}}/OLD_VACMSG} \
    {NO_SUCH_FILE} }
  condition = "${if and { H_TO_CC_MATCH_LOCALPART \
                          SENDER_NOT_NIL          \
                          H_SUBJ_NOT_CIRCULAR     \
                          H_FROM_NOT_MATCH_ADMINS \
                          SENDER_NOT_MATCH_ADMINS \
                          PRECEDENCE_NOT_JUNK     \
                        }  \
                    {yes}  \
                    {no}   \
                }"
  transport = vacation_delivery
  user = ${LOOKUP_ADDR_TO_LOGIN {USERS_UID} {EXIM_UID}}
  group = ${LOOKUP_ADDR_TO_LOGIN {USERS_GID} {EXIM_GID}}
  unseen




> In other hand, i need to use "mail" in filters file. I have (again) :
> Failed to send message from address_reply transport (69)


RTFM about filers, or the separate "exim's interface to mail filtering".

> # Exim filter


> if $message_body contains "test" and not error_message
> then
> mail
>    to $reply_address
>    subject "Re: $h_subject:"
> finish
> endif


> (i tried with seen mail ... too)


> but i dont know what to put in message_filter_reply_transport
> I tried all transports and no one works. I tried a perl script too without
> success.


RTFM chapter 10 (embedded perl)

(...)

Bernard Stern, SWITCH

____________S_W_I_T_CH___Swiss Academic_______________________________________
        mail: SWITCH Head Office       a          Tel: +41 1 268 1520
              Limmatquai 138           n          Fax: +41 1 268 1568
              CH-8001 Zurich           d        e-mail: stern@???
________________________________________Reseach Network_______________________