procmail
[Top] [All Lists]

Re: Nicer Error Message

2001-03-02 23:32:48
Chen Shiyuan <csy(_at_)hjc(_dot_)edu(_dot_)sg> writes:
...
Whenever sendmail/procmail has a problem with delivering the email to a
recipent, the following error message will be sent back to the sender of
the email :-
...
   ----- The following addresses had permanent fatal errors -----
<a(_at_)b(_dot_)com>
    (reason: 1)

   ----- Transcript of session follows -----
/home/users/a/.vacation.yes:
/home/users/a/.vacation.yes: No such file or directory
/usr/bin/maildir:
maildir_deliver(0,"/home/users/a/Maildir") failed
procmail: Error while writing to " /usr/bin/maildir create
$HOME/Maildir;
/usr/bin/maildir deliver $HOME/Maildir"
554 5.3.0 <a(_at_)b(_dot_)com>... unknown mailer error 1

The above actions and commands are what I have in my /etc/procmailrc
file.

I am wondering if it is possible to make sendmail/procmail return back a
customised and more friendly message instead of just the above? Like for
example is it possible to return a simple message saying that 
"a(_at_)b(_dot_)com
has exceeded his disk quota and will not be able to receive any more
emails until he has cleared his mailbox. Please try again later" .

How is procmail to know that the maildir_deliver program failed because
the user was over quota?  I don't see anything in the maildir_deliver
output that procmail could key off of.

To turn it around: you can have procmail redirect or capture most of
that output, but you need to figure out what to do with what you've got.
What you can't change without changing the source to sendmail and procmail
is eveything above the "Transcript of session follows" line, and the
exact text at the bottom (sendmail generates that based on procmail's
exitcode, so there's only a limited set and they have fairly precise
and standard meaning that you don't want to mess with).


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>