chucken
asked on
Check for mail
I have the xbiff and al other mailchecker I have found (eating to much memmory)
I wounder If I can make a script that chek for new mail my self,´? Mabe check if /var/spool/mail/$user has changed or something?
I always have some mail in /var/spool/mail so I just want to check if I have new mail.
I wounder If I can make a script that chek for new mail my self,´? Mabe check if /var/spool/mail/$user has changed or something?
I always have some mail in /var/spool/mail so I just want to check if I have new mail.
Have you tried biff? ("biff y")
ASKER
Hmmmm no.... where can I find it??
I've tried xbiff asmail and xmailbox....
I've tried xbiff asmail and xmailbox....
I *think* it's a standard part of Unix. Are you sure you don't have it? What is your OS?
ASKER
RedHat 5.0 and mabe I have it. I'm not at home now...
It is in the package called biff-0.10-1.
For it to work, you need to add this line to /etc/inetd.conf:
biff dgram udp wait root /usr/sbin/tcpd in.comsat
(and kill -1 `cat /var/run/inetd.pid` for immediate effect)
Then, type "biff y" in a window where you'd like to be notified.
Biff's advantages: you are notified of mail *immediately* as it arrives, since it is event-driven, not polling; no process runs constantly (occupying your precious memory :), a daemon named comsat is started on demand when mail arrives, and exits after a while.
Disadvantages: you need a terminal window; it messes up your screen (so you need to remember refresh keys :)). Of course, you can use a separate small window for it, but that would use even more memory than xbiff.
For it to work, you need to add this line to /etc/inetd.conf:
biff dgram udp wait root /usr/sbin/tcpd in.comsat
(and kill -1 `cat /var/run/inetd.pid` for immediate effect)
Then, type "biff y" in a window where you'd like to be notified.
Biff's advantages: you are notified of mail *immediately* as it arrives, since it is event-driven, not polling; no process runs constantly (occupying your precious memory :), a daemon named comsat is started on demand when mail arrives, and exits after a while.
Disadvantages: you need a terminal window; it messes up your screen (so you need to remember refresh keys :)). Of course, you can use a separate small window for it, but that would use even more memory than xbiff.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks like a good idea...
So I just put
\username , |"pine" for exampel?????
I'll try!
So I just put
\username , |"pine" for exampel?????
I'll try!
ASKER
I get this when I use a .forward that looks like this
\peter, "|/usr/X11R6/bin/xbiff"
----- The following addresses had permanent fatal errors -----
"|/usr/X11R6/bin/xbiff"
(expanded from: <peter@a201.ryd.student.li u.se>)
----- Transcript of session follows -----
Error: Can't open display:
554 "|/usr/X11R6/bin/xbiff"... unknown mailer error 1
[ Part 2: "Included Message" ]
Reporting-MTA: dns; a201.ryd.student.liu.se
Received-From-MTA: DNS; samantha.lysator.liu.se
Arrival-Date: Thu, 22 Jan 1998 11:14:46 +0100
Final-Recipient: RFC822; peter@a201.ryd.student.liu .se
Action: expanded (to multi-recipient alias)
Status: 2.0.0
Last-Attempt-Date: Thu, 22 Jan 1998 11:14:46 +0100
Final-Recipient: RFC822; peter@a201.ryd.student.liu .se
X-Actual-Recipient: RFC822; |/usr/X11R6/bin/xbiff@a201 .ryd.stude nt.liu.se
Action: failed
Status: 5.0.0
Last-Attempt-Date: Thu, 22 Jan 1998 11:14:46 +0100
\peter, "|/usr/X11R6/bin/xbiff"
----- The following addresses had permanent fatal errors -----
"|/usr/X11R6/bin/xbiff"
(expanded from: <peter@a201.ryd.student.li
----- Transcript of session follows -----
Error: Can't open display:
554 "|/usr/X11R6/bin/xbiff"...
[ Part 2: "Included Message" ]
Reporting-MTA: dns; a201.ryd.student.liu.se
Received-From-MTA: DNS; samantha.lysator.liu.se
Arrival-Date: Thu, 22 Jan 1998 11:14:46 +0100
Final-Recipient: RFC822; peter@a201.ryd.student.liu
Action: expanded (to multi-recipient alias)
Status: 2.0.0
Last-Attempt-Date: Thu, 22 Jan 1998 11:14:46 +0100
Final-Recipient: RFC822; peter@a201.ryd.student.liu
X-Actual-Recipient: RFC822; |/usr/X11R6/bin/xbiff@a201
Action: failed
Status: 5.0.0
Last-Attempt-Date: Thu, 22 Jan 1998 11:14:46 +0100
Well, pine is a mailing program, is'n it ? I did not mean it so.
\YOU .... you will get the mail by normal way, it will be in you mail box
AND
|"pipe command" ... ANY action with new mail. Depends
on your choice. BUT it should be program, which does not wait
for your input. I supposed some program, which let you know
about arrival of new mail (write ?).
I do not know (I doubt) if |"pine" will work. Try it.
PS: summary: YOU will get the mail AND TOGETHER WITH IT (paralelly) you can run anything you want.
.forward (sendmail use it) works all time, no matter if you are logged in, of course
\YOU .... you will get the mail by normal way, it will be in you mail box
AND
|"pipe command" ... ANY action with new mail. Depends
on your choice. BUT it should be program, which does not wait
for your input. I supposed some program, which let you know
about arrival of new mail (write ?).
I do not know (I doubt) if |"pine" will work. Try it.
PS: summary: YOU will get the mail AND TOGETHER WITH IT (paralelly) you can run anything you want.
.forward (sendmail use it) works all time, no matter if you are logged in, of course
sorry. "|pipe" is WRONG syntax. It should be |"pipe" .
This works me.
Michal
This works me.
Michal
ASKER
I have a alias for pine (xterm -e pine) so it should work...
But I tried to execute xbiff when mail arrives, and I get this:
Why do I get Can't open display ???
----- Transcript of session follows -----
Error: Can't open display:
554 |"/usr/X11R6/bin/xbiff"...
The same problem as if you try to run it (xbiff) via cron.
The program does not know you settings, eg. $HOME, $USER,
$TERMCAP, $TERM and so on (set command). You may write script,
which will set all these things and then execute xbiff.
If you do not log from one place, you will have to detect, where
you are logged and run "xbiff -display xxx...."
I do not have further experince with XWIN things (my command
sends text to my pager :-).
If you are interested, write me: mailto:hajek@nspuh.cz
The program does not know you settings, eg. $HOME, $USER,
$TERMCAP, $TERM and so on (set command). You may write script,
which will set all these things and then execute xbiff.
If you do not log from one place, you will have to detect, where
you are logged and run "xbiff -display xxx...."
I do not have further experince with XWIN things (my command
sends text to my pager :-).
If you are interested, write me: mailto:hajek@nspuh.cz
ASKER
Thanks,..
I'm a bit tierd. It's not so strange that sendmail doesn't have DISPLAY set....
I'm a bit tierd. It's not so strange that sendmail doesn't have DISPLAY set....