Revision c75f6985
Added by Marc Dequènes almost 16 years ago
- ID c75f6985722794212fe8020d9f31be9d1051860f
postman | ||
---|---|---|
logger.info "Bot terminating"
|
||
end
|
||
|
||
def ask_to_stop
|
||
@stop_asap = true
|
||
Thread.critical = true
|
||
@current_thread.raise if @waiting
|
||
Thread.critical = false
|
||
end
|
||
|
||
private
|
||
|
||
def check_mails(imap)
|
||
imap.check_mail do |msg|
|
||
if @stop_asap
|
||
... | ... | |
unless order.ok
|
||
if order.warn_sender
|
||
logger.info "Sending reply for rejected message"
|
||
mail_reply = mail.create_simple_reject_reply(sprintf(
|
||
mail_reply = mail.create_simple_reject_reply(_("Hello,") + "\n\n" + sprintf(
|
||
_("A message (ID: %s), apparently from you, was rejected for the following reason:"),
|
||
mail.message_id) + "\n " + _(order.message))
|
||
mail.message_id) + "\n " + _(order.message) + "\n" + mail_signature())
|
||
mail_reply.deliver
|
||
end
|
||
msg.delete
|
||
... | ... | |
reply_txt << "#{result.message}\n"
|
||
reply_attachments += result.refs unless result.refs.nil?
|
||
end
|
||
reply_txt << mail_signature()
|
||
|
||
# create mail
|
||
logger.debug "Preparing mail"
|
||
... | ... | |
end
|
||
end
|
||
|
||
def ask_to_stop
|
||
@stop_asap = true
|
||
Thread.critical = true
|
||
@current_thread.raise if @waiting
|
||
Thread.critical = false
|
||
def mail_signature
|
||
s = "\n" +
|
||
"-- \n" +
|
||
"#{CyborgHood::PRODUCT} v#{CyborgHood::VERSION}\n"
|
||
s += _("Contact eMail:") + " \"#{@config.contact.name}\" <#{@config.contact.email}>\n" if @config.contact.email
|
||
s += _("Contact URL:") + " #{@config.contact.url}\n" if @config.contact.url
|
||
s
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
[evol] added replay email signature (textual, not gpg one), and made a few Postman methods private btw