[Mimedefang] md_check_against_smtp_server and md_graphdefang_log

Tilman Schmidt t.schmidt at phoenixsoftware.de
Tue Mar 26 07:58:49 EDT 2013

Am 26.03.2013 11:23, schrieb James Curtis:
> Now just one more thing.  I want to md_graphdefang_log if it is an unknown user.  Here is what I have put together
> based on the other entries in this post.  I'm sure I'm missing something because it doesn't work.  Please advise for this 
> last piece of the puzzle.  Obviously I wouldn't log all valid, its for testing purposes, what am I missing?
> ------------------code ------------------------
> sub filter_recipient
> {
> my ($retval, $code, $dsn, $text) = md_check_against_smtp_server($sender, $recip, "localhost", "");
> #     my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;

This line is needed and should be the very first line of the
subroutine. Don't comment it out, and don't insert anything
before it. Just change the "return" in the line below into
"my ($retval, $code, $dsn, $text) = ".

> #     return md_check_against_smtp_server($sender, $recip, "mail.hml.com", "");
>       if ($retval eq "Reject") {

According to the manpage $retval will be "REJECT", not "Reject"
in the reject case, so you should compare against the string
in all capitals.

>         md_graphdefang_log('notauser', $recip, $sender);
> }else{
>         md_graphdefang_log('valid', $retval, $code);
>         }

Here you are missing a return statement to pass the result of
md_check_against_smtp_server to the caller of filter_recipient.
Ie. insert

    return ($retval, $code);

before the closing brace.

> }
> ------------------code---------------------------


Tilman Schmidt
Phoenix Software GmbH
Bonn, Germany

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20130326/07dc0c64/attachment.sig>

More information about the MIMEDefang mailing list