[oclug] Postfix Autoreply Software

Collin McCrank collin.mccrank at atlantis-scientific.com
Tue Jun 24 12:29:01 EDT 2003


I thought that this section

# test if message is to and from the same address and if suject is
# "vacation on" or "vacation off"
:0
# adressed to a system user
*$ ^TO_$LOGNAME@
# and is from that same user
*$ ^From:.*$LOGNAME@

Handled that.  The only way to turn off someone else's message is to make it appear that it is coming from that user.

I may be wrong since I don't know all that much about procmail

Dan Langille wrote:

>Don't forget how this can be abused.  One person turning on/off 
>another's message....
>
>On 24 Jun 2003 at 12:16, Collin McCrank wrote:
>
>  
>
>>Hi,
>>
>>I was actually able to track down a pretty good recipe that allows the 
>>user to email him/herself with the subject "vacation on" which will turn 
>>on a vacation message.  The vacation message will consist of the body of 
>>the email.  To turn it off all the use has to do is email him/herself 
>>again with the subject "vacation off".
>>
>>It may not be perfect but it definately fits my needs.  Now I don't have 
>>to manually setup their vacation messages since most wouldn't know the 
>>first thing about editing a file on linux :)
>>
>>I just added the following to the end of my /etc/procmailrc file
>>
>>#
>>LOGFILE=/tmp/procmail.log
>>VERBOSE=on
>>XLOOP=$LOGNAME@$HOST
>>VAC_MESSAGE=$HOME/.vacation.msg
>>VAC_CACHE=$HOME/.vacation.cache
>>VAC_LOCK=$HOME/.vacation.lock
>>NL="
>>"
>>
>># test if message is to and from the same address and if suject is
>># "vacation on" or "vacation off"
>>:0
>># adressed to a system user
>>*$ ^TO_$LOGNAME@
>># and is from that same user
>>*$ ^From:.*$LOGNAME@
>># has subject containing only "vacation (on|off)"
>>*  ^Subject: *vacation *\/o(ff|n) *$
>># clean out extra space
>>*  MATCH ?? ()\/o(ff|n)
>>{
>>    ACTION=$MATCH
>>    LOG="ACTION: $ACTION, USER: $LOGNAME, HOME: $HOME $NL"
>>
>>    :0c
>>    * ACTION ?? off
>>    # remove vacation message and cache
>>    | rm $VAC_MESSAGE $VAC_CACHE
>>    :0Ebc
>>    # create vacation message from body
>>    | cat > $VAC_MESSAGE
>>    # FIXME: extra newline in output; how to deal with attachements?
>>
>>    # As confirmation that vacation works the user will receive his own
>>    # auto-reply from the next recipe
>>}
>>
>>
>>:0
>># is there a vacation message for that user?
>>*$? "test -e $VAC_MESSAGE"
>>{
>>
>>    # from procmailex
>>    :0 Whc: $VAC_LOCK
>>    # Perform a quick check to see if the mail was addressed (to|cc) us
>>    *$ ^TO_$\LOGNAME@
>>    # Don't reply to daemons and mailinglists
>>    *  !^FROM_DAEMON
>>    # Mail loops are evil
>>    *$ !^X-Loop: $XLOOP
>>    | formail -rD 8192 $VAC_CACHE
>>
>>    # if the name was not in the cache
>>    :0 ehc        
>>    | (formail -rI"Precedence: junk" -A"X-Loop: $XLOOP" ; \
>>        cat $VAC_MESSAGE ) | $SENDMAIL -oi -t
>>
>>}
>>
>>-Collin
>>
>>Carl St-Jacques wrote:
>>
>>    
>>
>>>Hi Collin,
>>>
>>>Yes, I think it's possible to use procmail + vacation. Try this: 
>>>http://web.bilkent.edu.tr/Online/Mail/Procmail/vacation.html
>>>
>>>Hope this help.
>>>Carl
>>>
>>>Collin McCrank wrote:
>>>
>>>      
>>>
>>>>I don't use maildrop for local delivery.  One thing I was wondering 
>>>>is would it be possible to somehow use procmail to accomplish an 
>>>>autoreply or vacation message?  I use procmail for other things on 
>>>>the server and have read a little bit saying that it could be used?
>>>>
>>>>If so is there any specific format or syntax that I'd need to use?
>>>>
>>>>Thanks
>>>>
>>>>Carl St-Jacques wrote:
>>>>
>>>>        
>>>>
>>>>>Hi Collin,
>>>>>
>>>>>If you use maildrop for local delivery I can give you the syntax for 
>>>>>creating aureply messages with mailbot.
>>>>>
>>>>>Thanks.
>>>>>Carl St-Jacques
>>>>>
>>>>>Collin McCrank wrote:
>>>>>
>>>>>          
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>I currently have postfix running and am looking for an easy to use 
>>>>>>autoreply solution.  Does anybody out there use an autoreply with 
>>>>>>postfix?  If so where did you get it and how did you set it up?
>>>>>>
>>>>>>Thanks
>>>>>>Collin
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>
>>>>        
>>>>
>>
>>-- 
>>OCLUG general discussion list
>>OCLUG at lists.oclug.on.ca
>>http://www.oclug.on.ca/mailman/listinfo/oclug
>>
>>    
>>
>
>
>  
>






More information about the OCLUG mailing list