Hopefully this mail will not be empty as well...
It seems MTA do not like me these days ;)
My experience with quotas is quite limited, but...
Björn Puttmann wrote:
1) most importantly this could end up in emails bouncing back and
forth
from one mail account to another if both accounts create a bounce
message.
If your recipe is generating these mails, it should add a header which
it can check for, eg. "X-Loop-Prevention" or something. In the worst
case scenario, you send an "over quota" message, the other side
returns
one to you, then you stop when you see your own header.
Ah yes, after writing the first post and getting meself a coffee I
thought about
something similar ;) It's always a good idea to explain ones problem to
someone else - might end up with a new idea...
Searching the web for your suggestion came up with some good starters
e.g.: http://www.it.ca/software/procmail-bounce
for the interested here my procmailrc
LOGFILE="/var/log/procmail"
VERBOSE=on
CHECKSUM=/usr/bin/md5sum
DQ='"'
DELIVERMAIL="/usr/lib/cyrus-imapd/deliver"
MAILDOMAIN="your-domain.tld"
DAEMON="[EMAIL PROTECTED]"
SENDMAIL="/usr/sbin/sendmail -i -f \
$DAEMON -t $SENDER"
# Mailbox-Delivery
INBOX="$DELIVERMAIL -f $SENDER -a $USER $USER"
# enable / disable spam && virus checks
CHECK = 0
### Spamassassin && ClamAV
# Check
:0
* $CHECK ?? 1
{
:0fw
* < 110000
| /usr/bin/spamc -u filter
# virus scan only if the mail is not classified as spam
:0
* ^X-Spam-Status: No
{
:0fw
| /usr/local/bin/clamassassin
}
}
# move infected mails to /dev/null
:0 w
* ^X-Virus-Status: Yes
/dev/null
# deliver to INBOX
:0 w
| $INBOX
# if this went wrong
:0 e
{
EXITCODE=$?
# temporary failure?
:0 w
* EXITCODE ?? [75]
{
EXITCODE=0
# prevent mail loops
:0
* ^X-Loop: $DAEMON
/dev/null
:0
{
BOUNCEPID=`echo $$`
LOCALRECIPIENT=`formail -t -xTo:`
ORIGINALSENDER=`formail -rt -xTo:`
LOCALDOMAINMX=`dig MX +short ${MAILDOMAIN}|sed -e
's/. / /g' -e 's/.$//g' |awk '{print $1}'`
DATE=`date`
MIMEBREAK="`cat bouncetemp.${BOUNCEPID} | ${CHECKSUM}
| sed -e 's/ -//'`.`date '+%s'`/${HOST}.${MAILDOMAIN}"
}
:0 c:
bouncetemp.${BOUNCEPID}
:0
| ( formail -rt \
-I"From: $DAEMON (Mail Delivery Subsystem)" \
-I"Subject: Returned mail: see transcript for details" \
-I"Auto-Submitted: auto-generated (failure)" \
-I"MIME-Version: 1.0" \
-I"Content-Type: multipart/report; report-type=delivery-status;
boundary=${DQ}${MIMEBREAK}${DQ}" \
-A"X-Loop: ${DAEMON}";\
printf "\nThis is a MIME-encapsulated message\n";\
printf "\n--%s\n\n" "${MIMEBREAK}";\
printf "The original message was received at %s" "${DATE}";\
printf " from %s\n" "${ORIGINALSENDER}";\
printf "\n----- The original mail could not be deliverd to the
following addresses due to a temporary error -----";\
printf "\n\n451 Temporary local deliveriy problem for %s - please
try again later... \n" "${LOCALRECIPIENT}";\
printf "\n--%s\nContent-Type: message/delivery-status\n\n" "$
{MIMEBREAK}";\
printf "Reporting-MTA: dns; %s\n" "[EMAIL PROTECTED]";\
printf "Arrival-Date: %s\n\n" "${DATE}";\
printf "Final-Recipient: RFC822; %s\n" "${LOCALRECIPIENT}";\
printf "Last-Attempt-Date: %s\n" "`date`";\
printf "\n--%s\nContent-Type: message/rfc822\n\n"
"${MIMEBREAK}";\
cat bouncetemp.${BOUNCEPID};\
printf "\n--%s--\n\n" "${MIMEBREAK}";\
rm -f bouncetemp.${BOUNCEPID} \
) | ${SENDMAIL} -od -t
}
}
An nice to have would be a reverse lookup of the original sender. Thus
implementing a basic
filter for not sending bounces to spam addresses.
2) the return code of 75 is (as far as i know) not really specific.
It
only refers
to a temporary failure while trying to deliver the mail locally.
Consider instead that is *is* a temporary failure. The user can't
accept
mail right now, but they will later when/if they clean out their
inbox.
I know this isn't a solution, but it's worth considering why this is a
temporary failure instead of a permanent one. Returning an message to
the sender like this is like a bounce, is there a way to tell
`deliver`
to treat it like one and give a better return code?
Yes, I think you are right. The original sender really only needs to
know
that his mail did not reach the recipient. Everything else is not really
neccessary...
Thanks for your reply and all the best,
Bjoern
--
dbap GmbH - one-stop e-business
phone +49 251 609979-0 / fax +49 251 609979-99
Martin-Luther-King Weg 20 - 48155 Muenster, Germany
http://www.dbap.de
Die dbap GmbH ist Full-Service Dienstleister für mittelständische
Unternehmen. Wir betreuen die Einbindung modernster E-Business-
Technologien in die bestehenden Geschäftsprozesse auf Basis der
hauseigenen Softwareplattform dStore SmartSuite.
dbap GmbH, Sitz: Münster HRB 5891, Amtsgericht Münster
Geschäftsführer: Björn Dolkemeier, Stefan Goebel