[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Postfix + Quota (+ procmail?)



Hello,

I've been researching what would be our best option for converting our
old Redhat mailserver with Sendmail to something better. I'm not exactly
a Linux guru, though I'm no newbie either. Finally, I've decided to use
Debian Woody, with the following setup:

/dev/hda1 -> /boot
/dev/hda2 -> /
/dev/hda3 -> /home

- Postfix delivering to Maildir (from stable)
- Courier POP3(S) / IMAP(S) (from stable)
- Spamassassin (from unstable)
- Amavisd / Clamav-daemon (from unstable)

A user's Maildir is ~/Maildir and I've setup quota on /home (soft: 5MB,
hard: 10MB). I've written the scripts to convert the old mboxes to the
new Maildir format etc. Everything seems to work fine, except for this
little problem I found today.

When a user is over his soft quotum and I try to send a mail with an
attachment which will bring the user over his hard quotum on /home,
Postfix accepts the email. Then, a part of the email is written to the
user's Maildir until the hard quotum is reached, and things stop. So,
now I'm left with a user who has a partial email/attachment and no more
disk space. Additionally, the mail is stored/kept in the user's mbox
(/var/mail/user, where there is no quotum). When the user cleans up his
account, the mail never gets delivered properly, and the sender gets no
notification that something went wrong. The daily warnquota email is
received as a 0-byte email by the user, because the hard limit is
reached. I don't know what could be causing this (postfix or procmail?).
Another thing I don't understand, is that whenever I send an email to a
user who is below his soft limit, and which will bring the user over his
hard limit at once, Ximian Evolution nicely reports to me that the
sending failed, because the storage limit is exceeded. In that case,
nothing gets delivered, which probably is what I want.

So I'm wondering: what could be wrong with my setup?

I get the idea that i should maybe get out the procmail part of the
configuration. But I could only get Spamassassin to work via procmail..
I believe it should be possble to get it to work via Amavis, but I don't
know how..

I'll include some of my config files. If more information is required,
just let me know.. Any help would be greatly appreciated!


** /etc/postfix/main.cf **

command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix
smtpd_banner = $myhostname ESMTP
setgid_group = postdrop
biff = no
append_dot_mydomain = no
myhostname = mail2.hbh-it.net
alias_maps = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mail.hbh-it.net, localhost.hbh-it.net, , localhost
relayhost = 
mynetworks = 127.0.0.0/8 hash:/var/lib/pop-before-smtp/hosts
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
home_mailbox = Maildir/
virtual_maps = hash:/etc/postfix/virtual
smtpd_tls_key_file = /etc/postfix/mail-postfix.key
smtpd_tls_cert_file = /etc/postfix/mail-postfix.crt
smtpd_use_tls = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
maps_rbl_domains =
  relays.ordb.org,
  opm.blitzed.org,
  list.dsbl.org,
  sbl.spamhaus.org,
  blackholes.easynet.nl,
  cbl.abuseat.org
smtpd_recipient_restrictions =
  reject_invalid_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient,
  reject_unknown_sender_domain,
  reject_unknown_recipient_domain,
  reject_unauth_pipelining,
  permit_sasl_authenticated,
  permit_mynetworks,
  reject_unauth_destination,
  reject_maps_rbl,
  permit
content_filter = smtp-amavis:[127.0.0.1]:10024


** /etc/postfix/master.cf **

# i've added the following 2 lines:
smtp-amavis unix -      -       n       -       2       smtp  -o
smtp_data_done_timeout=1200 -o disable_dns_lookups=yes

127.0.0.1:10025 inet n  -       n       -       -       smtpd -o
content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o
smtpd_restriction_classes= -o smtpd_client_restrictions= -o
smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o
smtpd_recipient_restrictions=permit_mynetworks,reject -o
mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes


** /etc/procmailrc **

DROPPRIVS=yes
SHELL=/bin/bash
MAILDIR=$HOME/Maildir
DEFAULT=$MAILDIR/new
:0fw
* < 50000
| /usr/bin/spamc


-- 
R.M. Evers <debian@hbh-it.nl>



Reply to: