Mail handling in egroupware

Hi,

I realise mail handling in egroupware is just all over the place:

  • some code uses the mail function, some code uses the smtp configuration
    provided during the setup
  • errors in sending emails are in most cases just ignored and the user is
    left to wonder why emails are not sent or not read by the tracker, mydms
    etc.

I think we need to clean that a little bit. Shouldn’t we just focus on ONE
way to send emails, and have a consistent behaviour to log errors (such as
the egroupware log and not the apache log).

I am happy to work on this once we can agree on what should be the
behaviour.

Raphael

Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc

Hi Raphael,

Raphael Alla schrieb:

Hi,

I realise mail handling in egroupware is just all over the place:

  • some code uses the mail function, some code uses the smtp
    configuration provided during the setup

The mail config in setup and a default mail profile in emailadmin are
kept in sync. If you have no default profile, you always have a problem,
as we not always have a user context to find the correct personal email
profile.

  • errors in sending emails are in most cases just ignored and the user
    is left to wonder why emails are not sent or not read by the tracker,
    mydms etc.

Not send mail should be logged via error_log().

I think we need to clean that a little bit. Shouldn’t we just focus on
ONE way to send emails, and have a consistent behaviour to log errors
(such as the egroupware log and not the apache log).

I think everything should be logged to Apache error_log, that’s the most
easy way and it even works if there’s no working database.

Ralf

I am happy to work on this once we can agree on what should be the
behaviour.

Raphael

Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc



Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Hi Raphael,

Raphael Alla schrieb:

Hi,

I realise mail handling in egroupware is just all over the place:

  • some code uses the mail function, some code uses the smtp
    configuration provided during the setup

The mail config in setup and a default mail profile in emailadmin are
kept in sync. If you have no default profile, you always have a problem,
as we not always have a user context to find the correct personal email
profile.

this is not true. Some code, such as the tracker or mydms code, does not
even attempt to know what is the mail config. It only uses the mail
function.

  • errors in sending emails are in most cases just ignored and the user
    is left to wonder why emails are not sent or not read by the tracker,
    mydms etc.

Not send mail should be logged via error_log().

I have seend that calls to error_log have been added to the code now.



Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!

http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!

http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc

To true about tracker and mydms.
Its on the agenda to be changed, but not tackled yet.

egroupware-developers@lists.sourceforge.net

Hi Raphael,

Raphael Alla schrieb:

Hi,

I realise mail handling in egroupware is just all over the place:

  • some code uses the mail function, some code uses the smtp
    configuration provided during the setup
    The mail config in setup and a default mail profile in emailadmin are
    kept in sync. If you have no default profile, you always have a problem,
    as we not always have a user context to find the correct personal email
    profile.
    this is not true. Some code, such as the tracker or mydms code, does not
    even attempt to know what is the mail config. It only uses the mail
    function.
  • errors in sending emails are in most cases just ignored and the user
    is left to wonder why emails are not sent or not read by the tracker,
    mydms etc.
    Not send mail should be logged via error_log().
    I have seend that calls to error_log have been added to the code now.


Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!

http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc -> mailto:rb@stylite.de]





eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Stylite GmbH
[ open style of IT ]
Morschheimer Strasse 15
67292 Kirchheimbolanden

fon 06352 . 70629-0
fax 06352 . 70629-30
www.stylite.de

Handelsregister Kaiserslautern HRB 30575
Geschäftsführer: Andre Keller, Gudrun Müller, Nigel Vickers, Ralf Becker



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

I think everything should be logged to Apache error_log, that’s the
most
easy way and it even works if there’s no working database.

Slightly O.T.

What is “the” (or the best) way to do logging in eGW?
I’ve been using $GLOBALS[‘egw’]->log->error() because it allows
different log levels (info, warning), but it has shortcomings.
Would it be better to use trigger_error() instead?

Nathan Gray
nathan at goarctic dot com



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Hi Nathan,

Nathan Gray schrieb:

I think everything should be logged to Apache error_log, that’s the
most
easy way and it even works if there’s no working database.

Slightly O.T.

What is “the” (or the best) way to do logging in eGW?
I’ve been using $GLOBALS[‘egw’]->log->error() because it allows
different log levels (info, warning), but it has shortcomings.

I see a few major shortcomings:

  • the UI seems to be broken currently
  • it (obviously) only works, if we have a database connection
  • it’s on a per instance basis

–> That’s why I always use error_log(…)

Would it be better to use trigger_error() instead?

Question is for what? trigger_error() is in my opinion something a lot
better implemented now (PHP5) with exceptions.

Ralf

Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Would it be better to use trigger_error() instead?

Question is for what? trigger_error() is in my opinion something a lot
better implemented now (PHP5) with exceptions.

Good point.
I have a few levels of logging I’m concerned about: info, warning and
error.

Exceptions are awesome in that you can throw something that says
exactly what the problem is, and you can catch and handle them exactly
how you want. They all have the same severity though, so are really
only useful for exceptions to normal flow.

A quick review of what I actually log to the egw log reveals I mostly
use it for things that happen asynchronously, but not always “errors”,
per se. It seems strange to me that PHP has >10 different error
levels, but error_log() doesn’t take a level parameter.

Nathan Gray
nathan at goarctic dot com



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

Another issue for asynchroneous services is that by default, when php is run
from the command line, the error log is redirected to stdout. That means it
is not stored anywhere and no error message can be found by the admin

To true about tracker and mydms.
Its on the agenda to be changed, but not tackled yet.

Von: “Raphael Alla” raphael.alla@gmail.com
An: "development of eGroupWare,for active developers"
egroupware-developers@lists.sourceforge.net
Datum: Thu, 25 Jun 2009 10:24:24 +1100

Hi Raphael,

Raphael Alla schrieb:

Hi,

I realise mail handling in egroupware is just all over the place:

  • some code uses the mail function, some code uses the smtp
    configuration provided during the setup
    The mail config in setup and a default mail profile in emailadmin are
    kept in sync. If you have no default profile, you always have a problem,
    as we not always have a user context to find the correct personal email
    profile.
    this is not true. Some code, such as the tracker or mydms code, does not
    even attempt to know what is the mail config. It only uses the mail
    function.
  • errors in sending emails are in most cases just ignored and the user
    is left to wonder why emails are not sent or not read by the tracker,
    mydms etc.
    Not send mail should be logged via error_log().
    I have seend that calls to error_log have been added to the code now.


Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!

http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org



eGroupWare-developers mailing list

eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Are you an open source citizen? Join us for the Open Source Bridge
conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference:
$250.
Need another reason to go? 24-hour hacker lounge. Register today!

http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org


eGroupWare-developers mailing list

eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc -> mailto:rb@stylite.de]





eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Stylite GmbH
[ open style of IT ]
Morschheimer Strasse 15
67292 Kirchheimbolanden

fon 06352 . 70629-0
fax 06352 . 70629-30
www.stylite.de

Handelsregister Kaiserslautern HRB 30575
Geschäftsführer: Andre Keller, Gudrun Müller, Nigel Vickers, Ralf Becker



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc

One could remove the output redirection to /dev/null from the cron
script. That should work everywhere, but Debian Etch (which still has
the stupid empty haystack error).

Ralf

Raphael Alla schrieb:

Another issue for asynchroneous services is that by default, when php is
run from the command line, the error log is redirected to stdout. That
means it is not stored anywhere and no error message can be found by the
admin

2009/6/25 Klaus Leithoff <kl@stylite.de mailto:kl@stylite.de>

To true about tracker and mydms.
Its on the agenda to be changed, but not tackled yet.

Von: "Raphael Alla" raphael.alla@gmail.com
<mailto:raphael.alla@gmail.com>
An: "development of eGroupWare,for active developers"
egroupware-developers@lists.sourceforge.net
<mailto:egroupware-developers@lists.sourceforge.net>
Datum: Thu, 25 Jun 2009 10:24:24 +1100
----------------------------------------------------------



2009/6/23 Ralf Becker <[rb@stylite.de <mailto:rb@stylite.de>>
 Hi Raphael,

 Raphael Alla schrieb:

> Hi,
 >
 > I realise mail handling in egroupware is just all over the place:
 > - some code uses the mail function, some code uses the smtp
 > configuration provided during the setup
 The mail config in setup and a default mail profile in emailadmin are
 kept in sync. If you have no default profile, you always have a
problem,
 as we not always have a user context to find the correct personal email
 profile.
this is not true. Some code, such as the tracker or mydms code, does not
even attempt to know what is the mail config. It only uses the mail
function.


 > - errors in sending emails are in most cases just ignored and the
user
 > is left to wonder why emails are not sent or not read by the tracker,
 > mydms etc.
 Not send mail should be logged via error_log().
I have seend that calls to error_log have been added to the code now.


 >>
------------------------------------------------------------------------
 >
 >
------------------------------------------------------------------------------
 > Are you an open source citizen? Join us for the Open Source Bridge
conference!
 > Portland, OR, June 17-19. Two days of sessions, one day of
unconference:
$250.
 > Need another reason to go? 24-hour hacker lounge. Register today!
 >
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
 >
 >
 >
------------------------------------------------------------------------
 >
 > _______________________________________________
 > eGroupWare-developers mailing list
 > <a
href="mailto:eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>">eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
 > https://lists.sourceforge.net/lists/listinfo/egroupware-developers

 --
 Ralf Becker
 Director Software Development

 Stylite GmbH
 [open style of IT]

 Morschheimer Strasse 15
 67292 Kirchheimbolanden

 fon +49 (0) 6352 70629-0
 fax +49 (0) 6352 70629-30
 mailto: <a href="mailto:rb@stylite.de
<mailto:rb@stylite.de>">rb@stylite.de <mailto:rb@stylite.de>

 www.stylite.de <http://www.stylite.de>
 www.egroupware.org <http://www.egroupware.org>
 ________________________________________________

 Geschäftsführer Andre Keller, Gudrun Müller,
 Nigel Vickers und Ralf Becker
 Registergericht Kaiserslautern HRB 30575
 Umsatzsteuer-Id / VAT-Id: DE214280951

 ------------------------------------------------------------------------------
 Are you an open source citizen? Join us for the Open Source Bridge
conference!
 Portland, OR, June 17-19. Two days of sessions, one day of
unconference:
$250.
 Need another reason to go? 24-hour hacker lounge. Register today!
 http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
 _______________________________________________
 eGroupWare-developers mailing list
 <a
href="mailto:eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>">eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
 https://lists.sourceforge.net/lists/listinfo/egroupware-developers



--
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc -> mailto:rb@stylite.de <mailto:rb@stylite.de>]

__________________________________________________

------------------------------------------------------------------------------

__________________________________________________

_______________________________________________
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/egroupware-developers


--
Stylite GmbH
[ open style of IT ]
Morschheimer Strasse 15
67292 Kirchheimbolanden

fon 06352 . 70629-0
fax 06352 . 70629-30
www.stylite.de <http://www.stylite.de>

Handelsregister Kaiserslautern HRB 30575
Geschäftsführer: Andre Keller, Gudrun Müller, Nigel Vickers, Ralf Becker



------------------------------------------------------------------------------
_______________________________________________
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Raphael Alla
Alphalog Calédonie
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
http://www.alphalog.nc



Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge



eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers

–
Ralf Becker
Director Software Development

Stylite GmbH
[open style of IT]

Morschheimer Strasse 15
67292 Kirchheimbolanden

fon +49 (0) 6352 70629-0
fax +49 (0) 6352 70629-30
mailto: rb@stylite.de

www.stylite.de
www.egroupware.org


Geschäftsführer Andre Keller, Gudrun Müller,
Nigel Vickers und Ralf Becker
Registergericht Kaiserslautern HRB 30575
Umsatzsteuer-Id / VAT-Id: DE214280951


Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World™ will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge


eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers