Ignore:
Timestamp:
Dec 20, 2014, 2:58:12 PM (10 years ago)
Author:
quentin
Message:
prune-mailq usage improvements and postcat
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/fedora/config/etc/scripts/prune-mailq

    r2657 r2658  
    77    $0 list-from
    88    $0 list-to
    9     $0 show-rand [from|to] [regex]
     9    $0 show-rand [from regex|to regex]
    1010    $0 email lockers...
    1111    $0 purge-from lockers...
     
    1616    exit 1
    1717}
     18
    1819clean_locker() {
    1920    echo "${1%%@scripts.mit.edu}"
     
    3334    if [[ $# -eq 0 ]]; then
    3435        files=$(ls /var/spool/postfix/deferred/?/* | shuf | head -n 3)
    35     else
     36    elif [[ $# -eq 2 ]]; then
    3637        match=$2
    3738        case "$1" in
     
    4243        msgids=$(mailq | tail -n +2 | grep -v '^ *(' | awk "BEGIN { RS = \"\" } (\$$dir ~ /$match/) { print \$1 }" | shuf | head -n 3)
    4344        files=$(for msgid in $msgids; do echo /var/spool/postfix/deferred/${msgid:0:1}/$msgid; done)
     45    else
     46        usage
    4447    fi
    4548    for file in $files; do
    4649        echo ">>>> $file";
    47         strings "$file"
     50        postcat "$file"
    4851        echo;
    4952    done
Note: See TracChangeset for help on using the changeset viewer.