I went a bit crazy the other day dealing with pyramid_mailer
after going through all the code for pyramid_mailer and
repoze_sendmail , I realized that the send_to_queue function occurs
within the transaction.
this isn't mentioned anywhere within the docs and it is described in a
section /after/ the send_immediately functionality is discussed...
which would lead one to believe that it is not transaction safe.
that being said , i'd like to request a docs change to note that.
it would also be nice if there was a send_immediately_to_queue
function ( ie, not transaction safe ) -- but that code is too much for
me to jump around in. i should also note that messages are tossed
into a /tmp folder within the maildir until the transaction is done
for delivery. if the transaction is not commited, they just seem to
pile up. ( note: i run pyramid without transactions so this might be
the cause of that. if so, perhaps only a note is needed. )
i created a quick package called pyramid_sendmail (
https://github.com/jvanasco/pyramid_sendmail and on pypi )
it extends the repoze.sendmail and pyramid_mailer functionalities with
an actual sendmail delivery mechanism. i formatted the package into
files that are named to indicate which packages they are extending.
[ staring with p_ pyramid_mailer and r_ repoze.sendmail ; and the
'suffixes' are a 1:1 naming with the files that the content would
appear in ]
i didn't build tests or anything onto this, because I only need it for
a single use-case. piping message to sendmail is really useful though
-- and supported by most frameworks and platforms -- so i figured I
could implement it in a way that would give a head-start to upstream
support.