Hi Crystal,

Thanks for your answer so far.

Because the local user it would be delivered to does not exist.
>

Hmm. If I send a mail to [email protected], I see the same behavior.
And the "sidney" user exists.

If what you suggest is correct, it raises the question: how does smtpd make
the determination if the mail is intended for a local user? And what
configuration directives influence that behavior?


> The fact that you are doing your own custom processing of the message
> using a
> script which doesn't actually deliver the mail anywhere doesn't alter the
> fact
> that smtpd wants to 'deliver' it to a valid user.
>

But as far as smtpd is concerned, my configured mda /does/ succeed in
delivering mail. It returns with exitcode 0, and I think that's all that
smtpd cares about.

My problem at this stage is that the mail coming in from port 2525 from
outside doesn't ever reach my mda.py script.

It's not explicitly mentioned in the smtpd manual pages, but in general
> 'mda'
> is a term for a program that does _local delivery_, so the name basically
> imples that you can't use it as a general mail handling mechanism.
>

I don't intend to do that. My mda.py script is mostly a debugging aid, to
see what is going on and to understand what kind of information is being
passed around.

Honestly, although I understand your thinking for wanting to learn how smtpd
> works, you are probably doing this the hard way.
>

> Just set up a simple, normal mail delivery configuration, and get that
> working first.  Then look inside it using logs, debug options, and then
> maybe
> some custom scripts to do non-standard things with received mail.
>

Well, different people learn in different ways. I want to build a
close-to-correct mental model of what happens to mails as they pass through
smtpd, and I've hit a stumbling block where an incoming mail is not entered
into the queue, with no obvious clue in the documentation as to why that
happens.

The man page of smtpd.comf has the following description of the behavior
when a message :

      When  mail  arrives, each “RCPT TO:” command generates a mail
envelope.  If an envelope matches any of a pre-designated set of criteria
(using the match di‐
       rective), the message is accepted for delivery.  A copy of the
message, as well as its associated envelopes, is saved in the mail queue
and later dispatched
       according to an associated set of actions (using the action
directive).

My smtpd.conf has:

    match from any action "my-test-mda"

The behavior I see can be explained in two ways:

* The match test is never done; the message is rejected even before that.
(However, this scenario seems to contradict the behavior described in the
man page).
* The match test is done, but it fails; and thus the message is rejected.
(This scenario begs the question how the "from any" test could fail)

Which of these two explanations is correct? Or is there another explanation
still?

Cheers, Sidney

Reply via email to