mail-checker-script question (Solved)

Hi,
I have one question;
I`m using this mail-checker-script (found in this forum):

#!/usr/bin/perl -w
# checkmail_lin.pl
# Copyright (C) 2002 Damien FAURITE
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

use strict;
use Net::POP3;

#use AppConfig qw(:expand :argcount);

my $prog_name   = "Checkmail";
my $checkmailrc = "checkmailrc";
my $message     = "";
my $image;
my $image_name;

#my $config = AppConfig->new(
#    'user' => { ARGCOUNT => 1 },
#    'pass' => { ARGCOUNT => 1 },
#    'host' => { ARGCOUNT => 1 }
#);

#$config->file($checkmailrc);

#my $user = $config->user();
#my $pass = $config->pass();
#my $host = $config->host();

my $user = "*****";
my $pass = "*****";
my $host = "******";

my $pop = Net::POP3->new( $host, Timeout => 120 );

if ( defined($pop) ) {

    my $num = $pop->login( $user, $pass );

    if ( !defined($num) ) {
        $message = "Error";
    }
    elsif ( $num == 0) {
    	$message = "0 mail";
    }
    else {
        $message = "$num mail";
    }

    $pop->quit();

}
else {
    $message = "Erreur";
}

print $message . "\n";

Now my question is if it`s possible to insert a command to get a sound-message? Maybe something like "if new mail is there then mplayer /path/to/file.ogg >/dev/null 2>&1 or anything elese?
I do not know anything about scripting and it would be great if anyone could tell me how it could be realized.

Thank you very much & Greetings

Edit:

Now I have changed my config and now Im using Brices Scripts from this Posting:
How to display email subjects in an fvwm menu

In Brices MailPopup function Ive added a line like this:

+ I Exec exec  mplayer /home/slackman/mail.wav >/dev/null 2>&1 &

Now the Popup ist starting with playing this file :slight_smile:

Greetings

what about rplay? is it not a sound player used by fvwm?
anyway… i’m building my own script using fetchmail and i’ll try to play with sound

Hi,
yes, rplay should be an option. I never had played around with rplay and mplayer is installed, so why not using an app which is installed on the system :slight_smile:
But try out rplay and let us know how it works.
Fvwm-own-apps are interesting anytime!
Grettings to Milano!

:slight_smile: where are you from?