NEEDED: Auto Mail Reply program/script 
Author Message
 NEEDED: Auto Mail Reply program/script

NEEDED: Auto Mail Reply program/script

Hello out there. I am in desperate need of some sort of program or script
that will automaticly reply to mail with pre-specified subject header and
attach a file (in the same or similar manner PINE uses to encode a file
into mail) and send the reply to the sender. I have a standard unix shell
account to which I will be dedicating this activity.

This is what I am looking to do:


SUBJ: request-file:mysalesdemo.exe


sends mysalesdemo.exe which is located in the shell account's home
directory.

Anyone reading this have any ideas/suggestions?


Thanks.



Sat, 17 Jan 1998 03:00:00 GMT  
 NEEDED: Auto Mail Reply program/script

Quote:

>NEEDED: Auto Mail Reply program/script
>This is what I am looking to do:

>SUBJ: request-file:mysalesdemo.exe

>sends mysalesdemo.exe which is located in the shell account's home
>directory.


Ok, my first c.l.p post :) (Likely my last too, since it appears to
be going away.)  Anyway, first put this line in your .forward file:
|mail.reply.pl
This can also be followed with a coma and your username if you want
to keep copies of the mail that you are getting.  Then save this
into mail.reply.pl (untested and may need some modifications for your sys)

#!/usr/local/bin/perl
chroot 'your/home/directory/here'; # This is to prevent someone from
                                   # requesting ../../../../etc/passwd
                                   # or the like
while (<>) {
        chop;
        # Find the return address... give priority to "Reply-To:"
        ($replyaddr) = /^Reply-To:\s+([^\s]+)/;
        ($replyaddr) = /^From:\s+([^\s]+)/ unless $replyaddr;
        ($replyaddr) = /^Apparently-From:\s+([^\s]+)/ unluss $replyaddr;

        # Find the name of the file to send.
        ($filename) = /^Subject:\s+ request-file:\s*([^\s]+)/;

        # Ignore the body of the message:
        last if $_ eq "";

Quote:
}

die "No Return Address\n" unless $replyaddr;
open (MAIL, "|mail -s \"Auto-Reply File: $filename\" $replyaddr")
        || die "Can't open mail program: $!\n";

if (open (FILE, $filename)) {
        # Send Error message if file not available
        print MAIL "Auto-Reply ERROR: Can't find file $filename.  Sorry.\n";

Quote:
} else {

        # Send the File
        # You could uuencode the file or anything else here...
        while (<FILE>) {
                print MAIL $_;
        }
Quote:
}

close (FILE); close (MAIL);

-----------------------Cut Here------------------
Hope this helps; let me know if it works or there are changes to be made.

Ask if you have questions,
David Mankin



Mon, 19 Jan 1998 03:00:00 GMT  
 NEEDED: Auto Mail Reply program/script
: >NEEDED: Auto Mail Reply program/script
: >This is what I am looking to do:

: >SUBJ: request-file:mysalesdemo.exe

: be going away.)  Anyway, first put this line in your .forward file:
: |mail.reply.pl
: This can also be followed with a coma and your username if you want
: to keep copies of the mail that you are getting.  Then save this
: into mail.reply.pl (untested and may need some modifications for your sys)

Q: If the (autoreply) To: address also dumps into the same user account
as one or more mailnames, will implementing the .forward file as above
thrash all other mail?  I'm unclear as to the keeping of copies of the
mail...do you mean like a log?  Instead of the individual mail pieces,
what's the best way to simply maintain a log of the requestor's e-mail
Reply-To: (or) From: address?  Is some kind of "wrapper" required in
order for this whole thing to work?  Most other autoreply scripts I've
seen require one and my ISP won't install such a device.  Finally, if
this can work in conjunction with other mail coming into the same
user account, can the non-autoreply mail be fetched/read by a POP reader?  




Thu, 22 Jan 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. REQUEST: Mail auto-reply programs written in Perl

2. Auto Reply via E-mail

3. PERL script for auto-mailing a binary file

4. Need script to change mail "Reply To:" Header on mail messages

5. Setting the From or Reply when sending mail with Mailtools module

6. Mail::Send module and Reply-To header

7. Setting Reply-To mail field?

8. Automatically replying to mail

9. Parsing mailing list replies

10. Mail. Specifying Reply-To:

11. Mail::Internet->reply

12. Mail::Send module and Reply-To header

 

 
Powered by phpBB® Forum Software