>> Alexei Batyr' writes:
>>> So questions arised:
>>> 1 (most important). Why local sendmail silently discards "bad" messages
>>> without writing any errors to syslog?

>Sam Varshavchik writes:
>> Because no historical version of any mail handler with an externally-invoked
>> "sendmail" command ever logged errors to syslog. Errors that resulted in
>> submitted mail getting refused, no different than any other error
>> encountered by any other executed command, they get reported to standard
>> error, and the command terminates with a non-zero exit status.
>>
>> And that's what occurs here. sendmail terminates with a non-zero exit code,
>> after emitting an error message. It is the responsibility of whatever forks
>> and executes a child process, and waits for the child process to terminate,
>> to check its exit code, and report any failures.

On 26.01.12 20:26, Alexei Batyr' wrote:
>I agree, but "advanced PHP programmers" don't even think about checking
>return value of mail() function that invokes sendmail.

well, if I may say something about this:
1. they of just have to check if the mail sending failed.

2. the mail() function does not catch sendmail's output, so they often 
   do not know why did it fail (you must find in php logs).

The 2. is mostly caused by PHP calling sendmail using popen() call, 
that only allows you to send output to a file, or receive from it, not 
both.  Reading sendmail's (error) output and providing the result to 
client would be of course the best fix, but I haven't got to this yet.

>> The "sendmail" command in Courier is not a daemon that logs to syslog. It's
>> an interactive command. In the original Sendmail sendmail, its sendmail"
>> was both, an executed command, and a daemon. The externally-executed
>> sendmail command, if it rejected a message for its own reasons, would also
>> print a message on standard error and terminate with a non-zero exit status.
>> Same thing here.

>OK, probably I need some logging wrapper for sendmail.
>
>Another question (or maybe feature request):
>I need to refuse sending mail to some addresses (domains). In Sendmail I
>could just specify "local:dev-null" in mailertable file for these domains.
>It would be helpful to have similar feature in esmtproutes. Another
>possibility - "badto" parameter in bofh by analogy to "badfrom".

I second this, the only similar is "spamtrap" which is often not 
exactly what we want (although it's perfect for catching phishing 
replies).

I would like to implement more complementary options to some that are 
already in courier (checking for valid destination domain - only source 
is checked now, checking for valid sender adresses for local domains - 
only recipient is checked now), however Sam already told he does not 
like to run that many checks at SMTP time...
-- 
Matus UHLAR - fantomas, [email protected] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
We are but packets in the Internet of life (userfriendly.org)

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to