Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S

smfi_setreply(3N)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

smfi_setreply() — sets the default SMTP error reply code

SYNOPSIS

#include <libmilter/mfapi.h> int smfi_setreply( SMFICTX *ctx, char *rcode, char *xcode, char *message );

PARAMETERS

ctx

Specifies the opaque context structure.

rcode

Specifies the 3-digit (RFC 821/2821) SMTP reply code as a null-terminated string. rcode cannot be set to NULL value. rcode must be a valid 4XX or 5XX reply code.

xcode

Specifies the extended (RFC 1893/2034) reply code. An xcode must conform to RFC 1893/2034. If xcode is set to NULL, an extended code is not used.

message

Specifies the text part of the SMTP reply. If message is set to NULL, an empty message is used.

DESCRIPTION

The smfi_setreply() routine directly sets the SMTP error reply code for a connection. Only 4XX and 5XX replies are accepted. smfi_setreply() uses this code on subsequent error replies from the Milter function.

smfi_setreply() can be called from any xxfi_callback() function except the xxfi_connect() function.

Notes

  • Values passed to smfi_setreply() are not checked for standards compliance.

  • The message parameter must contain only printable characters; other characters may lead to undefined behavior. For example, CR or LF causes the call to fail, a single % (percentage) character can cause the text to be ignored. If a % (percentage) character must be used in a string, it must be used as %%.

  • For more information on reply codes and their meanings, see RFC 821, 2821, 1893, or 2034.

  • If the reply code (rcode) given is a 4XX code but SMFI_REJECT is used for the message, the normal reply is not used.

    If the reply code (rcode) given is a 5XX code but SMFI_TEMPFAIL is used for the message, the custom reply is not used.

    In neither of these two cases, an error is returned to the Milter and libmilter silently ignores the reply code.

  • If the Milter returns SMFI_TEMPFAIL and sets the reply code to 421, the SMTP server terminates the SMTP session with a 421 error code.

RETURN VALUE

smfi_setreply() fails and returns MI_FAILURE if the rcode or xcode argument is invalid or a memory allocation failure occurs; otherwise; smfi_setreply() returns MI_SUCCESS.

AUTHOR

The smfi_setreply() routine was developed by the Sendmail Inc.

SEE ALSO

smfi_getsymval(3N), smfi_getpriv(3N), smfi_setreply(3N), smfi_setpriv(3N).

Sendmail 8.13.3 Programmer's Guide on docs.hp.com.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.