|
From: Joost v. B. <j.e...@uv...> - 2003-01-19 13:26:37
|
Hi Klaus,
Thanks for your reply.
On Sat, Jan 18, 2003 at 07:45:32PM +0100, Klaus Johannes Rusch wrote:
> In <200...@ba...>, Joost van Baal <j.e...@uv...> writes:
> > using /usr/sbin/sendmail (if it's
> > available) has benefits: you can rely on the local mail queueing, to
> > deal with stuff like network outages. Therefore, I feel it's a wise
> > thing to use this interface where available. (Unix MUA's generally do
> > this, too.)
>
> Agreed.
>
> Would you expect the MUA to handle a message in SMTP format, or would you want
> the ability to specify recipients, subject etc. when calling the MUA. The
> former approach obviously is a lot easier to implement and would be my
> preferred option, something like
>
> --mua="/usr/sbin/sendmail -t"
Yes, this sounds like a good way to implement it. Just build the
message, including the headers, and either feed it to smtplib.SMTP() or
to /usr/sbin/sendmail.
BTW, you might want to invoke sendmail as
--mta="/usr/sbin/sendmail -t -oi"
in order to cope sanely with lines containing single dots in the
message. Perhaps /usr/lib/sendmail is found on more systems than
/usr/sbin/sendmail; you might want to check for that too. See attached
patch.
[Just to get rid of any misunderstanding: I regard syncmail as a - be it
somewhat specialized - Mail User Agent, like mutt or pine or LaMail or
/bin/mail. These MUA programs get rid of their mail using a standard
interface. On Unix, this is the interface supplied by the Message
Transfer Agent, like Sendmail, Exim, qmail or Postfix. All these MTA's
supply a /usr/sbin/sendmail.]
FWIW, I've just taken a look at the Debian reportbug utility, another
Python script which sends out mail. It does:
pipe = os.popen(options.mta+' -t -oi -oem', 'w')
You might want to take a look at http://packages.debian.org/reportbug
and at
http://ftp.debian.org/debian/pool/main/r/reportbug/reportbug_2.10.tar.gz .
> > Hm, what was the reason to start reimplementing the same script in Perl?
> > (I couldn't find any rationale.) Would it be useful if I'd write a patch
> > for the Perl script?
>
> Mainly the need to run cvs-syncmail on a system that did not have Python
> installed, and once I had ported the code to Perl I thought others might
> possibly have an interest, too :-)
A, I see. Sounds reasonable :)
> A patch would certainly be appreciated, or at least a clarification of the
> requirement.
Patch for syncmail.pl attached; clarification, as given earlier: behave
as MUA's generally do on Unix systems: follow current best practice,
Beware: I've only done some minor testing of the patch.
Bye,
Joost
--
Joost van Baal http://banach.uvt.nl/
Tilburg University
j.e...@uv... The Netherlands
|