Maildroprc Automatically Delete quotawarn File in Maildir

This is the Ugly workaround


Postfix master.cf setting

maildrop  unix  -       n       n       -       -       pipe
  flags=ODRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${recipient} ${user} ${domain}

With this setting maildrop wil warn user if their Maildir reach 90% of quota and send warning to user

The problem is, even if user emptying their maildir, users wil always get warning because quotawarn is still in Maildir

[vchkpw] quotawarn question

#
MAILHOME="/var/data/postfix"
DOMAIN="$2"
USER="$1"

QUOTA=`echo "$MAILDIRQUOTA" | cut -f 1 -d S`
USAGE=`du -sb "$MAILHOME/$DOMAIN/$USER/" | awk '{print $1}'`
PERCENT=`echo "$QUOTA * 90/100" | bc`

if ( "$USAGE" < "$PERCENT" )
{
        `/bin/rm -f "$MAILHOME/$DOMAIN/$USER/quotawarn"`
}

→ continue reading

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark


backup gmail account ke format maildir

pertama enable pop di account gmailt :


- settings
- Forwarding and POP/IMAP
- Enable POP for all mail (even mail that’s already been downloaded)

kemudian, konfigur ftechmail dan procmail:

kita butuh procmail supaya bisa menyimpan emails ke dalam format maildir(1 file untuk satu email, mbox 1file besar yg berisi seluruh email)

/home/USER/.fetchmailrc :

poll pop.gmail.com
protocol pop3
username "ACCOUNT@gmail.com" password "PASSWORD"
keep ssl
mda "/usr/bin/procmail -m /home/USER/.procmailrc"

Kita menggunakan protokol pop3,email2 tetap di tinggal di server dan SSL di gunakan untuk me retrieve email2 kita.

/home/USER/.procmailrc :

MAILDIR=/home/USER/ VERBOSE=on

:0Mail/

Pengambilan awal :

Pertama kali, kita jalankan fetchmail secara manual di login shell kita. setelah beberapa saat ftechmail akan berhenti mengambil email.kita jalankan lagi beberapa kali sampai benar2 selesai.mungkin gmail membatasi session pengambilan.untuk mengambil email secaa berkala kita gunakan cronjob/crontab secara otomatis.

Setting crontab  session  USER untuk membackup setiap malam:

crontab -e

0 1 * * * /usr/bin/fetchmail > /dev/null 2> /home/USER/Mail/fetchmail.log

kita bisa menggunakan mutt untuk membaca email dari  CLI(command line interface) :

/home/USER/.muttrc :

set mbox_type=Maildir
set folder="~/Mail"
set mask="!^\\.[^.]"
set mbox="~/Mail"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Mail"

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark


Page 1 of 212