procmail
[Top] [All Lists]

Re: procmail mailping ( was Re: test)

2004-08-29 00:16:41
On Sat, 28 Aug 2004, Bob George wrote:

antenneX wrote:

Bob: I'd like to see those recipes....


Here it is. It's just a modification of an auto-responder, modified to
send back the original message, including headers. The idea is you send
a message to mailping(_at_)yourdomain(_dot_)com and "Otto Pinger" replies
automatically.

I'd post mine here, but I don't want it to be abused. If anyone would
like to try it, just message me off-list and I'll send you the addresses.

- Bob

--- cut here --- cut here ---

#======================================================
# Implement e-mail pingbot
#======================================================
:0
* ^TO(pingbot|mailping)
* !^X-Loop: pingbot
* ^Subject: \/.*
{
        # Get sender (now recipient) address
        FROM_=`formail -rt -xTo: \
        | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`

        # Save the full message content to a temp file
        :0c:formail.lock
        | cat > return.tmp

        # Send the response message
        :0c:formail.lock
        | (formail -r -I"Subject: Re: $MATCH" \
          -I "Cc: mailings(_at_)ttlexceeded(_dot_)com" \
          -A "X-Loop: pingbot"; \
          echo -e "This is an automated response by PINGBOT."; \
          echo -e "Replies to this message will be ignored!\n"; \
          echo -e "Your message appeared as:"; \
          echo -e "\n--- begin received message ---\n"; \
          cat return.tmp; \
          echo -e "\n--- end received message ---\n"; \
          rm -f return.tmp)\
          | /usr/sbin/sendmail -t -F "Otto Pinger"
}


        Where is the time treatment?  It's important in ping :)
        Something like:

...
        echo "Received at $RTIME"
        echo "Current time $TIME"
...

        In this case you can figure out and learn the time that
        messages waited in the queue.

Bye,
 Udi

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>