工作中~
分类:
2008-07-22 12:25:37
$Revision$,$Author$
# pkg_add maildrop
maildrop-2.0.2p2: complete
--- maildrop-2.0.2p2 -------------------
The documentation for maildrop has been installed in
/usr/local/share/doc/maildrop.
You should also read /usr/local/share/doc/maildrop/SECURITY
file now, as it has
some important information regarding the setuid/setgid
bits that some of the binaries that have been installed
may need for correct operation.
There are currently NO setuid/gid bits enabled, but if you
use maildrop in certain capacities, these will need to be
set to allow maildrop to function correctly.
#
# File: /etc/courier/maildroprc
#
#
# logfile should be owned by user/group: vmail, mode: 0640.
# A newsyslog configuration was created for logrotate.
#
logfile "/var/log/maildrop.log"
SHELL="/bin/sh"
HOME="/home/vmail/domains"
MAILDIR="Maildir/"
LOGNAME=tolower("$LOGNAME") # 'username@domain.com'
EXTENSION="$1" # default is 'spam'
RECIPIENT=tolower("$2")
USER="$3" # 'username'
HOST="$4" # 'domain.com'
SENDER="$5"
USERHOME="$HOME/$HOST/$USER"
MAILBOX="$HOME/$HOST/$USER/$MAILDIR"
#
# Only allow users listed in file '/etc/postfix/www_at_openbsdonly.org' send
# mail to user 'www@openbsdonly.org'.
# File '/etc/postfix/www_at_openbsdonly': one email address per line.
#
#if ( /^To:.*www@openbsdonly.org.*/ )
#{
# if ( /^From:\s*(.*)/ && lookup( $MATCH1, '/etc/postfix/www_at_openbsdonly.org'))
# {
# MAILBOX="${MAILBOX}"
# }
# else
# {
# to /dev/null
# }
#}
if ( $EXTENSION = 'spam' )
{
EXTENSION = 'Spam'
}
#
# $HOME/.mailfilter
# Owner: 2000:2000
# Mode: 0600
#
`test -r $HOME/.mailfilter`
if ( $RETURNCODE == 0 )
{
include $HOME/.mailfilter
}
`test -e $MAILBOX`
if ( $RETURNCODE != 0 )
{
# Create user home directory.
`mkdir -p $USERHOME`
# Create Maildir.
`maildirmake $MAILBOX && maildirmake -f $EXTENSION $MAILBOX `
# Auto-subscribe the subdirectory to imap server.
`print INBOX.Sent > $MAILBOX/courierimapsubscribed`
`print INBOX.Trash >> $MAILBOX/courierimapsubscribed`
`print INBOX.Drafts >> $MAILBOX/courierimapsubscribed`
`print INBOX.Spam >> $MAILBOX/courierimapsubscribed`
# Set permission.
`chown 2000:2000 -R $MAILBOX `
`chmod 0700 $USERHOME`
}
if (/^X-Spam-Flag:.*YES/)
{
log "Spam detected. Move to the SPAM Folder: $MAILBOX/.$EXTENSION"
MAILBOX="$MAILBOX/.$EXTENSION/"
}
to $MAILBOX