Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mailstats usage?

22 views
Skip to first unread message

EML

unread,
Apr 21, 2022, 10:38:50 AM4/21/22
to
I've just enabled mailstats on a new server. To test it, I'm sending a mail from PHP (so it calls sendmail directly).

When I send a test mail, the MTA 'msgsfr' increases immediately and, a few seconds later, the MTA 'msgsto' *also* increases. Why is this?

If I check against /var/logs/mail.log, there are 4 entries corresponding to the outgoing message. The last one says 'message accepted for delivery', so this is presumably the local sendmail accepting message responsibility from the PHP mailer. A few seconds later there's another entry, also with 'message accepted for delivery', when sendmail hands off to the remote MTA. From the timings, I think this is when mailstats increments 'msgsto'. So what does 'msgsto' actually mean?

Claus Aßmann

unread,
Apr 21, 2022, 2:49:48 PM4/21/22
to
EML wrote:

> When I send a test mail, the MTA 'msgsfr' increases immediately and, a few
> seconds later, the MTA 'msgsto' *also* increases. Why is this?

Because mail which comes in usually also goes out.

> timings, I think this is when mailstats increments 'msgsto'. So what does
> 'msgsto' actually mean?

Just what it says:
msgsto Number of messages to the mailer.

It's a fairly simple statistic, but it is essential
to understand what "mailer" means wrt sendmail.

--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.

EML

unread,
Apr 22, 2022, 5:03:50 AM4/22/22
to
On Thursday, April 21, 2022 at 7:49:48 PM UTC+1, Claus Aßmann wrote:

> Because mail which comes in usually also goes out.
> > timings, I think this is when mailstats increments 'msgsto'. So what does
> > 'msgsto' actually mean?
> Just what it says:
> msgsto Number of messages to the mailer.

Thanks Claus. This is pretty confusing, though. When I run:

$ sendmail -d8.20 -vt < ./test-sendmail.txt

I expect mailstats to show one incoming message on the MSP, and one outgoing message on the MTA (the book doesn't show separate MSP/MTA stats - maybe this is a Deb/Ubuntu thing?)

What I actually get is one in *and* one out on the MTA, and nothing on the MSP.

Or maybe I've configured 'submit' incorrectly? I have a custom relay listening on port 25, which forwards filtered incoming mails on to port 7902, where sendmail is listening. So, basically sendmail only *sends* mails, unless the local system sends out administration mails by directly running the sendmail executable (like the example above). My submit.mc contains:

define(`RELAY_MAILER_ARGS', `TCP $h 7902')dnl
FEATURE(`msp', `[127.0.0.1]', `25')dnl

Maybe that '25' is wrong? Thanks. Nice book, BTW :)

Claus Aßmann

unread,
Apr 22, 2022, 6:21:13 AM4/22/22
to
EML wrote:

> $ sendmail -d8.20 -vt < ./test-sendmail.txt

> I expect mailstats to show one incoming message on the MSP, and one outgoing

Do you have separate statistics for the MSP?
Do you invoke mailstats with the proper cf file when you want
the info for the MSP?

> What I actually get is one in *and* one out on the MTA, and nothing on the MSP.

As I wrote (for the MTA):
! Because mail which comes in usually also goes out.

> where sendmail is listening. So, basically sendmail only *sends* mails,

Again:
sendmail does NOT "only *sends* mails" it has to receive them first.
0 new messages