Added the possibility to provide the sendmail location in NOTIFICATION_SENDMAIL_MAILER.

Added NOTIFICATION_STORAGE_MAILER which allow to store the email in a storage (could be just output, file, database ...)
Added SMTP implementation, based on EiffelNet SMTP_PROTOCOL.
   note: it is possible to exclude this by setting ecf variable "smtp_notification_email_disabled" to "True"
   this way help to manage dependencies, since the Eiffel Net library would not be included neither.
Fixed Date header value computation.
This commit is contained in:
2015-07-03 10:02:56 +02:00
parent 33150e34d6
commit 148518984e
10 changed files with 625 additions and 28 deletions

View File

@@ -0,0 +1,74 @@
note
description: "Store email in specific file (could also be stderr, ...)."
date: "$Date: 2015-06-30 15:49:56 +0200 (mar., 30 juin 2015) $"
revision: "$Revision: 97588 $"
class
NOTIFICATION_EMAIL_FILE_STORAGE
inherit
NOTIFICATION_EMAIL_STORAGE
create
make
feature {NONE} -- Initialization
make (a_output_file: FILE)
require
a_output_file_valid: a_output_file.exists
do
output := a_output_file
end
output: FILE
feature -- Status report
is_available: BOOLEAN
-- Is associated storage available?
do
Result := output.exists and output.is_access_writable
end
has_error: BOOLEAN
-- Last operation reported an error?
feature -- Storage
put (a_email: NOTIFICATION_EMAIL)
-- Store `a_email'.
local
retried: BOOLEAN
l_close_needed: BOOLEAN
do
if not retried then
has_error := False
if not output.is_open_write then
output.open_write
l_close_needed := True
end
output.put_string ("%N----%N" + a_email.message)
if l_close_needed then
output.close
else
output.flush
end
end
rescue
retried := True
has_error := True
retry
end
;note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end

View File

@@ -0,0 +1,38 @@
note
description: "Abtract interface of email storage."
date: "$Date: 2015-06-30 15:49:56 +0200 (mar., 30 juin 2015) $"
revision: "$Revision: 97588 $"
deferred class
NOTIFICATION_EMAIL_STORAGE
feature -- Status report
is_available: BOOLEAN
-- Is associated storage available?
deferred
end
has_error: BOOLEAN
-- Last operation reported an error?
deferred
end
feature -- Storage
put (a_email: NOTIFICATION_EMAIL)
-- Store `a_email'.
deferred
end
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Olivier Ligot, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
5949 Hollister Ave., Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end