[MUD-Dev] Mail from mud Zoran's final Imp

coder at ibm.net coder at ibm.net
Thu Jan 1 16:41:42 CET 1998


On 01/01/98 at 01:55 PM, Stephen Zepp <zoran at enid.com> said:
>  sprintf( mailbuf, "mail -s \"%s\" %s <%s%s",
>     m_subject, m_address, MAIL_DIR, mfilename );
...
>  system( mailbuf );
>  sprintf( delbuf, "rm %s%s", MAIL_DIR, mfilename );
>  system( delbuf );

A lurking and insidious problem here is that you don't detect when mail
delivery fails.  This can be a bitch to a) notice when it happens, and b)
determine the cause when it does

I'd suggest putting in a signal handler which triggers on the child
dieing, and then reports an appropriate response to the user if the
delivery failed.  It's fairly trivial to do: you can use any of your
standard IPC calls to handle reporting the failure/success code (I do it
with threads instead of full processes via, so I do the report back via
the thread object for the mailer thread).

--
J C Lawrence                               Internet: claw at null.net
----------(*)                              Internet: coder at ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...




More information about the mud-dev-archive mailing list