[Mimedefang] action_notify

alan premselaar alien at 12inch.com
Fri May 23 05:01:01 EDT 2003


On 5/23/03 5:41 PM, "Chris Masters" <rotis23 at yahoo.com> wrote:

> OK, I know this is a bit of a hack. But still...
> 
> sub action_notify_user($$$)
> {
>       my ($addr,$mess,$sub) = @_;
>       system("echo \"$mess\" | mail $addr -s
> "$sub\"");
> }
> 
> Where $addr is the email address, $mess is the message
> body and $sub is the subject. This is NOT fully
> tested. Any comments, amendments?
> 
> Chris Masters

I, personally, would be a little leary of making a system() call from within
the filter, for security's sake.

but, if you insisted on doing so, you'd definitely want to have a qualified
absolute path to your mail app and not rely on any inherent path.

you might also want to do something like this:

sub action_notify_users
{
    my ($addr,$mess,$sub) = @_;

    open (MAILPIPE, "| /path/to/mail $addr -s $sub") or return <an
appropriate return indicator here>;

    print(MAILPIPE "$mess");

    close(MAILPIPE);
}


this ALSO is untested, but should work if i'm not mistaken.

you may also need to make sure that your mail app is executable by the
defang user (although it should be)

hope this helps

alan




More information about the MIMEDefang mailing list