What happens to incoming email if apache/mysql is down?

Incoming email to support@blah, which is routed via procmail to check for spam. If it passes that, procmail does /opt/rt3/bin/rt-mailgate --queue support --action comment --url http://localhost/

At that time, if the httpd or the mysqld is down, is the email lost? I’m guessing it is, as I don’t see an obvious return value to pass back to sendmail that says delivery failed and to queue it up to try again.

Is there a way to lessen the impact of httpd being down, or if httpd is up but mysqld is down?

PH

Paul Hirose : pthirose@ucdavis.edu : Sysadm Motto: rm -fr /MyLife
1034 Academic Surge : Programmer/Analyst : Backup Motto : rm -fr /
One Shields Avenue : Voice (530) 752-7181 : Robot, n.: Univ. Admin
Davis, CA 95616-8770 : Fax (530) 752-4465 : rec.pets.cat.anecdotes

Incoming email to support@blah, which is routed via procmail to check for spam. If it passes that, procmail does /opt/rt3/bin/rt-mailgate --queue support --action comment --url http://localhost/

At that time, if the httpd or the mysqld is down, is the email lost? I’m guessing it is, as I don’t see an obvious return value to pass back to sendmail that says delivery failed and to queue it up to try again.
Depends on your set-up. Generally it will bounce.

If you’re running postfix, and this is a concern,
you can turn errors into soft-bounces for later recovery.

Cambridge Energy Alliance: Save money. Save the planet.

Jerrad Pierce jpierce@cambridgeenergyalliance.org writes:

If you’re running postfix, and this is a concern,
you can turn errors into soft-bounces for later recovery.

No, because in this case Postfix hasn’t got a clue that anything went
wrong.

Paul is correct - if you do the straightforward thing and use something
like

:0

  • ^X-Spam-Status: YES
    ! spam@nsc.liu.se
    :0
    | /opt/rt/3.4.4/bin/rt-mailgate --queue nsc-support --action correspond

to let procmail filter out spam, your mail will indeed be silently
dropped on the floor if rt-mailgate fails - procmail doesn’t propagate
rt-mailgate’s exit code to the MTA by default. This has bitten me.

You have to handle this yourself. I don’t have the details available
right now, but something like

:0

  • ^X-Spam-Status: YES
    ! spam@nsc.liu.se
    :0w
    | /opt/rt/3.4.4/bin/rt-mailgate --queue nsc-support --action correspond

if procmail has reached here, delivery has failed. return with a

temporary failure code from <sysexits.h>.

75 = EX_TEMPFAIL

EXITCODE=75
:0
/dev/null

should do the trick. (Please note that the above snippet is untested,
though.)

Leif Nixon - Systems expert
National Supercomputer Centre - Linkoping University

Incoming email to support@blah, which is routed via procmail to check for spam. If it passes that, procmail does /opt/rt3/bin/rt-mailgate --queue support --action comment --url http://localhost/

At that time, if the httpd or the mysqld is down, is the email lost? I’m guessing it is, as I don’t see an obvious return value to pass back to sendmail that says delivery failed and to queue it up to try again.
Depends on your set-up. Generally it will bounce.

No, it will not. rt-mailgate treats anything short of “Server says
permission denied for that user” as “Temporary failure” causing your MTA
to back off and try again.