Find the answer to your Linux question:
Results 1 to 2 of 2
Hi people, I'm newbie with sendmail and I'm having a problem, probably it's easy to do it but I've got a user that I want to configure a message "Out ...
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    36

    Talking Send Mail with auto reply

    Hi people,

    I'm newbie with sendmail and I'm having a problem, probably it's easy to do it but I've got a user that I want to configure a message "Out of Office".
    I've tried to search on the internet I found a site something like this
    Linux security: mail, sendmail, fetchmail, procmail...

    Sending automatic reply-mails

    You can do this by checking e-mails automatically. I decided:

    1. to get my e-mails
    2. to let them check additionally

    Create a file .forward in your homedirectory like this for a user wwwrun which shall get mails from persons with a special headline:

    \wwwrun,"| /home/wwwrun/forward.pl"

    This means that the mail gets delivered to the user himself AND to the programm mentioned. The program forward.pl is not too sophisticated:

    #!/usr/bin/perl
    # file ~/forward.pl
    # called by ~/.forward which looks like this for user wwwrun:
    # wwwrun,"| /home/wwwrun/forward.pl"
    #
    # mission: generate automatic mails as answers
    #
    BEGIN {
    use lib "/usr/local/bin/hor.module";
    }
    use mailhor;
    # This is valid for all mails generated here:
    my $smtpserver = "gatekeeper.rosi13.de";
    my $from = 'wwwrun@gatekeeper.rosi13.de';
    # my $cc = 'horshack@gatekeeper.rosi13.de';
    my $cc = '';

    # Parse this mail:
    my ($org_subject,$org_from,$org_replyto) = (undef,undef,undef);
    my @mail = <STDIN>;
    foreach (@mail) {
    $org_subject = $1 if (/^Subject: (.*)$/i);
    $org_from = $1 if (/^From: (.*)$/i);
    $org_replyto = $1 if (/^Reply-To: (.*)$/i);
    }
    # Analyze
    if ($org_subject =~ /please give me password for msdos-bootdisk/) {
    &send_disk_password(to=>$org_from,cc=>$cc);
    system "logger \'sending dos-password-mail to $org_from\'";
    }
    exit;

    sub send_disk_password {
    my (%args) = @_;
    my $to = $args{to};
    my $cc = $args{cc};
    my $subject = "Re: please give me password for msdos-bootdisk";
    my $body =<<'EODISKPASSWORD';
    Hi,
    thanks for your interest... blablabla.
    From Nuernberg, Bavaria
    yours
    Richard Lippmann
    EODISKPASSWORD
    &mailhor::sendamail(smtpserver=>$smtpserver,from=> $from,
    to=>$to,cc=>$cc,subject=>$subject,body=>$body);
    }
    I don't know if it's better or the worst but indicates me that could be done with a little script, although the script won't work because when we sent an e-mail for the specific user the mail must return a message with out of office and that dosen't happend.

    Help !!!!

    Best Regards

  2. #2
    Just Joined!
    Join Date
    Nov 2007
    Posts
    36

    Smile Does anyone could help ?

    Hi people !!!

    Could anyone help with this subject !!!

    Thnaks

    Best Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...