The reason I ask is that I would like to write a script that
examines the queue finding messages that sit there for some time,
e.g. an hour, and tries to identify certain common errors that
make the delivery fail but are not resolved by sendmail until
the timer runs out completely.
In our organization, people often make spelling errors in mail
domain names, and often domain squatters have registered those
domains but do not run a mailserver on them. It takes a long time
before the sender of the message gets informed about this, and
to improve service I would like to return the mail quicker in
that case.
(without decreasing the retry time too much in cases where the
receiving system is unreachable for another reason)
Rob <nom...@example.com> wrote:
> Is there a command in sendmail that requests a certain item in
> the queue to be returned to the sender before the QUEUERETURN
> timer runs out?
> Preferably with an error message specified to that command.
> The reason I ask is that I would like to write a script that
> examines the queue finding messages that sit there for some time,
> e.g. an hour, and tries to identify certain common errors that
> make the delivery fail but are not resolved by sendmail until
> the timer runs out completely.
> In our organization, people often make spelling errors in mail
> domain names, and often domain squatters have registered those
> domains but do not run a mailserver on them. It takes a long time
> before the sender of the message gets informed about this, and
> to improve service I would like to return the mail quicker in
> that case.
> (without decreasing the retry time too much in cases where the
> receiving system is unreachable for another reason)
I hoped to still find some sendmail experts here, but it looks
like the group is filled with newbies crossposting from linux
groups.
Is there anyone who knows how the above can be done?
Maybe with a sendmail invocation with a special-purpose sendmail.cf?
> Rob <nom...@example.com> wrote:
>> Is there a command in sendmail that requests a certain item in
>> the queue to be returned to the sender before the QUEUERETURN
>> timer runs out?
>> Preferably with an error message specified to that command.
>> The reason I ask is that I would like to write a script that
>> examines the queue finding messages that sit there for some time,
>> e.g. an hour, and tries to identify certain common errors that
>> make the delivery fail but are not resolved by sendmail until
>> the timer runs out completely.
>> In our organization, people often make spelling errors in mail
>> domain names, and often domain squatters have registered those
>> domains but do not run a mailserver on them. It takes a long time
>> before the sender of the message gets informed about this, and
>> to improve service I would like to return the mail quicker in
>> that case.
>> (without decreasing the retry time too much in cases where the
>> receiving system is unreachable for another reason)
> I hoped to still find some sendmail experts here, but it looks
> like the group is filled with newbies crossposting from linux
> groups.
I suspect some would find that sort of comment unhelpful.
> Is there anyone who knows how the above can be done?
> Maybe with a sendmail invocation with a special-purpose sendmail.cf?
AFAIAA sendmail won't do this (but I speak as a decided inexpert, so IMBW)
However, if you don't mind a 'dirty' solution, how about your periodic checking script sticks the message id's (or some other good identifier) of the "bad" messages into a file somewhere, while a milter picks up on those and forces an immediate failure on the next q run. I suspect it would be easy enough to code a hook for mimedefang to do this, or roll your own milter. Or, come to think of it, possibly just build the whole lot into mimedefang.
-- Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex England
Mike Scott <usenet...@scottsonline.org.uk.invalid> wrote:
>> I hoped to still find some sendmail experts here, but it looks
>> like the group is filled with newbies crossposting from linux
>> groups.
> I suspect some would find that sort of comment unhelpful.
It looks like I'm not the only one with this opinion...
I don't mind people asking questions but it can go too far.
>> Is there anyone who knows how the above can be done?
>> Maybe with a sendmail invocation with a special-purpose sendmail.cf?
> AFAIAA sendmail won't do this (but I speak as a decided inexpert, so IMBW)
> However, if you don't mind a 'dirty' solution, how about your periodic > checking script sticks the message id's (or some other good identifier) > of the "bad" messages into a file somewhere, while a milter picks up on > those and forces an immediate failure on the next q run. I suspect it > would be easy enough to code a hook for mimedefang to do this, or roll > your own milter. Or, come to think of it, possibly just build the whole > lot into mimedefang.
Ok is it possible to invoke a milter on a queue run?
That could be a way...
What I was thinking about when mentioning "a special-purpose sendmail.cf"
is to create a sendmail.cf with a very short maximum queue lifetime and
then invoke sendmail -q with that cf file. However, I probably need
to move the messages to another mqueue dir and specify that in the .cf
to be sure it won't return the wrong messages.
Life would be so much easier when those domain harversters/parkers would
run an SMTP server that refuses all messages.... that should not be
much effort compared to the websites that they already implement.
Rob <nom...@example.com> wrote:
>Mike Scott <usenet...@scottsonline.org.uk.invalid> wrote:
>>> I hoped to still find some sendmail experts here, but it looks
>>> like the group is filled with newbies crossposting from linux
>>> groups.
>> I suspect some would find that sort of comment unhelpful.
>It looks like I'm not the only one with this opinion...
>I don't mind people asking questions but it can go too far.
>>> Is there anyone who knows how the above can be done?
>>> Maybe with a sendmail invocation with a special-purpose sendmail.cf?
>> AFAIAA sendmail won't do this (but I speak as a decided inexpert, so IMBW)
>> However, if you don't mind a 'dirty' solution, how about your periodic >> checking script sticks the message id's (or some other good identifier) >> of the "bad" messages into a file somewhere, while a milter picks up on >> those and forces an immediate failure on the next q run. I suspect it >> would be easy enough to code a hook for mimedefang to do this, or roll >> your own milter. Or, come to think of it, possibly just build the whole >> lot into mimedefang.
>Ok is it possible to invoke a milter on a queue run?
>That could be a way...
>What I was thinking about when mentioning "a special-purpose sendmail.cf"
>is to create a sendmail.cf with a very short maximum queue lifetime and
>then invoke sendmail -q with that cf file.
if it's only about the final error-mail and not about the error-text:
feel free to read the manual-page, especially how to set options like:
'-O Timeout.queuereturn='
and how to call queue-runner based on sender/queue-id/recipient, e.g.:
-qS.......
>However, I probably need
>to move the messages to another mqueue dir and specify that in the .cf
>to be sure it won't return the wrong messages.
If you're able to get the queue-ID for the specific mail something like
this from a shell-script:
/usr/sbin/sendmail -qI<queue-id> -O Timeout.queuereturn=<time>
>Life would be so much easier when those domain harversters/parkers would
>run an SMTP server that refuses all messages.... that should not be
>much effort compared to the websites that they already implement.
Maybe some general queue-runner for error-mails only (started from cron):
/usr/sbin/sendmail -qS<> -O Timeout.queuereturn=12h
regards
winfried
-- Winfried Magerl - Internet Administration
AtoS IT Solutions and Services, 81739 Munich, Germany
Internet-Mail: winfried.mag...@atos.net
Phone: +49 211 39922784
Winfried Magerl <winfried.mag...@siemens.com> wrote:
> In article <slrnk8cs24.e8q.nom...@xs8.xs4all.nl>,
> Rob <nom...@example.com> wrote:
>>Mike Scott <usenet...@scottsonline.org.uk.invalid> wrote:
>>>> I hoped to still find some sendmail experts here, but it looks
>>>> like the group is filled with newbies crossposting from linux
>>>> groups.
>>> I suspect some would find that sort of comment unhelpful.
>>It looks like I'm not the only one with this opinion...
>>I don't mind people asking questions but it can go too far.
>>>> Is there anyone who knows how the above can be done?
>>>> Maybe with a sendmail invocation with a special-purpose sendmail.cf?
>>> AFAIAA sendmail won't do this (but I speak as a decided inexpert, so IMBW)
>>> However, if you don't mind a 'dirty' solution, how about your periodic >>> checking script sticks the message id's (or some other good identifier) >>> of the "bad" messages into a file somewhere, while a milter picks up on >>> those and forces an immediate failure on the next q run. I suspect it >>> would be easy enough to code a hook for mimedefang to do this, or roll >>> your own milter. Or, come to think of it, possibly just build the whole >>> lot into mimedefang.
>>Ok is it possible to invoke a milter on a queue run?
>>That could be a way...
>>What I was thinking about when mentioning "a special-purpose sendmail.cf"
>>is to create a sendmail.cf with a very short maximum queue lifetime and
>>then invoke sendmail -q with that cf file.
> if it's only about the final error-mail and not about the error-text:
> feel free to read the manual-page, especially how to set options like:
> '-O Timeout.queuereturn='
> and how to call queue-runner based on sender/queue-id/recipient, e.g.:
> -qS.......
Ok, that is a good hint! Thank you.
I was not aware that I could pass those options via the commandline,
and envisioned having a second config file and passing that.
I use "O ErrorHeader=/filename" in the sendmail.cf to provide some more
help in local language for the users, and I probably can pass a
-O ErrorHeader=/otherfilename to provide information for this special
case.
>>However, I probably need
>>to move the messages to another mqueue dir and specify that in the .cf
>>to be sure it won't return the wrong messages.
> If you're able to get the queue-ID for the specific mail something like
> this from a shell-script:
> /usr/sbin/sendmail -qI<queue-id> -O Timeout.queuereturn=<time>
Yes, the idea is to write a script that identifies the mails in the queue
that have been there for maybe half an hour, and try to retrieve some
information like "host -t NS", "host -t MX" and maybe "whois", to identify
the wellknown domain harversters and parkers.
Then I can quicky return the mails sent to domains like gmail.nl
(instead of .com) and hotmial.com or similar.
>>Life would be so much easier when those domain harversters/parkers would
>>run an SMTP server that refuses all messages.... that should not be
>>much effort compared to the websites that they already implement.
> Maybe some general queue-runner for error-mails only (started from cron):
> /usr/sbin/sendmail -qS<> -O Timeout.queuereturn=12h
I already have set a 4h queuewarn and 36h queuereturn in sendmail.cf,
well below the "recommended values", to have better information for the
users, but it would still be nice to be able to inform them quicker.
But at the same time, I hesitate to directly mess with the files in the
mqueue directory, so I prefer to do things via sendmail commands.
> Winfried Magerl <winfried.mag...@siemens.com> wrote:
>> In article <slrnk8cs24.e8q.nom...@xs8.xs4all.nl>,
>> Rob <nom...@example.com> wrote:
>>>Mike Scott <usenet...@scottsonline.org.uk.invalid> wrote:
>>>>> I hoped to still find some sendmail experts here, but it looks
>>>>> like the group is filled with newbies crossposting from linux
>>>>> groups.
>>>> I suspect some would find that sort of comment unhelpful.
>>>It looks like I'm not the only one with this opinion...
>>>I don't mind people asking questions but it can go too far.
>>>>> Is there anyone who knows how the above can be done?
>>>>> Maybe with a sendmail invocation with a special-purpose sendmail.cf?
>>>> AFAIAA sendmail won't do this (but I speak as a decided inexpert, so IMBW)
>>>> However, if you don't mind a 'dirty' solution, how about your periodic >>>> checking script sticks the message id's (or some other good identifier) >>>> of the "bad" messages into a file somewhere, while a milter picks up on >>>> those and forces an immediate failure on the next q run. I suspect it >>>> would be easy enough to code a hook for mimedefang to do this, or roll >>>> your own milter. Or, come to think of it, possibly just build the whole >>>> lot into mimedefang.
>>>Ok is it possible to invoke a milter on a queue run?
>>>That could be a way...
>>>What I was thinking about when mentioning "a special-purpose sendmail.cf"
>>>is to create a sendmail.cf with a very short maximum queue lifetime and
>>>then invoke sendmail -q with that cf file.
>> if it's only about the final error-mail and not about the error-text:
>> feel free to read the manual-page, especially how to set options like:
>> '-O Timeout.queuereturn='
>> and how to call queue-runner based on sender/queue-id/recipient, e.g.:
>> -qS.......
> Ok, that is a good hint! Thank you.
> I was not aware that I could pass those options via the commandline,
> and envisioned having a second config file and passing that.
> I use "O ErrorHeader=/filename" in the sendmail.cf to provide some more
> help in local language for the users, and I probably can pass a
> -O ErrorHeader=/otherfilename to provide information for this special
> case.
>>>However, I probably need
>>>to move the messages to another mqueue dir and specify that in the .cf
>>>to be sure it won't return the wrong messages.
>> If you're able to get the queue-ID for the specific mail something like
>> this from a shell-script:
>> /usr/sbin/sendmail -qI<queue-id> -O Timeout.queuereturn=<time>
> Yes, the idea is to write a script that identifies the mails in the queue
> that have been there for maybe half an hour, and try to retrieve some
> information like "host -t NS", "host -t MX" and maybe "whois", to identify
> the wellknown domain harversters and parkers.
> Then I can quicky return the mails sent to domains like gmail.nl
> (instead of .com) and hotmial.com or similar.
>>>Life would be so much easier when those domain harversters/parkers would
>>>run an SMTP server that refuses all messages.... that should not be
>>>much effort compared to the websites that they already implement.
>> Maybe some general queue-runner for error-mails only (started from cron):
>> /usr/sbin/sendmail -qS<> -O Timeout.queuereturn=12h
> I already have set a 4h queuewarn and 36h queuereturn in sendmail.cf,
> well below the "recommended values", to have better information for the
> users, but it would still be nice to be able to inform them quicker.
> But at the same time, I hesitate to directly mess with the files in the
> mqueue directory, so I prefer to do things via sendmail commands.
you may like to simplify the pre-sorting in using some queuegroup
dedicated to "every typo you already know", another queuegroup dedicated to
"not yet seen but probable finger crosses" and setup these groups with
specific timers/mailers/RTFM.
You'll then have it easier to spot the "not yet seen nor imagined" typos
in the main queue :-) (you'll be surprised, after years and years
on the queue I'm still amazed by users abilities to warp9 anything ;-)
for the queuegroups if you don't already manage that point see the
manual the README and the "bat boot".
Loki Harfagr <l...@thedarkdesign.free.fr.INVALID> wrote:
> you may like to simplify the pre-sorting in using some queuegroup
> dedicated to "every typo you already know", another queuegroup dedicated to
> "not yet seen but probable finger crosses" and setup these groups with
> specific timers/mailers/RTFM.
> You'll then have it easier to spot the "not yet seen nor imagined" typos
> in the main queue :-) (you'll be surprised, after years and years
> on the queue I'm still amazed by users abilities to warp9 anything ;-)
Yes, unfortunately the number of errors in domain typing is huge, and
at the same time I don't want to blacklist a domain completely.
Right now, gmail.nl is an invalid domain for mail, but it has been registered
by a parking service on behalf of Google and it could happen any time
that Google start to offer addresses on that domain.
I don't want to have to keep an eye on those "bad domains" all the time to
see if they might have become valid.
That is why I don't want to handle mails as the first pass through.
(e.g. in an access rule)
My plan is to watch mails only after they have been sitting in the queue
for say half an hour, so it is unlikely that they sit there only because
of greylisting or temporary overload of destination server, and then try
to investigate the situation.
That is difficult enough by itself. For a human it is very easy to
identify those parked domains when looking at the DNS and WHOIS, but
I'm not sure if it will be easy for a script.
Rob wrote:
> Is there a command in sendmail that requests a certain item in
> the queue to be returned to the sender before the QUEUERETURN
> timer runs out?
Simply set the timeout to "now".
The fine documentation (op.*) says:
The value "now" can be used for -O Timeout.queuereturn to
return entries immediately during a queue run, e.g., to
bounce messages independent of their time in the queue.
Claus Aßmann <ca+sendm...@mine.informatik.uni-kiel.de> wrote:
> Rob wrote:
>> Is there a command in sendmail that requests a certain item in
>> the queue to be returned to the sender before the QUEUERETURN
>> timer runs out?
> Simply set the timeout to "now".
> The fine documentation (op.*) says:
> The value "now" can be used for -O Timeout.queuereturn to
> return entries immediately during a queue run, e.g., to
> bounce messages independent of their time in the queue.
Rob <nom...@example.com> wrote:
> Claus Aßmann <ca+sendm...@mine.informatik.uni-kiel.de> wrote:
>> Rob wrote:
>>> Is there a command in sendmail that requests a certain item in
>>> the queue to be returned to the sender before the QUEUERETURN
>>> timer runs out?
>> Simply set the timeout to "now".
>> The fine documentation (op.*) says:
>> The value "now" can be used for -O Timeout.queuereturn to
>> return entries immediately during a queue run, e.g., to
>> bounce messages independent of their time in the queue.