Page MenuHomeDevCentral

Allow to get notifications for new mail on Ysul
Closed, WontfixPublic

Description

Grip, with a qmail server used the following notification script.

1#!/usr/bin/env tclsh8.5
2#Checks if there is a new mail in Maildir folders
3
4#
5# Helper methods
6#
7
8#Gets maildir directory
9proc get_maildir {} {
10 global env
11 if [info exists env(MAILDIR)] {
12 return $env(MAILDIR)
13 }
14 return $env(HOME)/Maildir
15}
16
17#Return "s" when amount needs a plural
18proc s {amount} { if {$amount >= 2} {return "s"} }
19
20#
21# Procedural code
22#
23
24#Checks if Maildir exists
25if [file exists [set maildir [get_maildir]]] {
26 #Yes, check new mails
27 set nb [llength [glob -nocomplain -directory $maildir/new *]]
28 if {$nb > 0} {
29 puts ""
30 puts "*** You have $nb new mail[s $nb]"
31 puts ""
32 }
33} {
34 #No, ask to create it
35 puts "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
36 puts " You don't have setup your mail delivery."
37 puts ""
38 puts " Please run the following command:"
39 puts " /var/qmail/bin/maildirmake $maildir"
40 puts "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
41}

We should offer something in .login to call a dummy newmail so we can get in a future tweak how mail notifications work.

Event Timeline

Actually, we have fewer users on Ysul than on Grip, and we can offer them support to upgrade if needed.