:thread_by_subject => false,
:edit_signature => false,
:ask_for_cc => true,
- :ask_for_bcc => false
+ :ask_for_bcc => false,
+ :confirm_no_attachments => true,
+ :confirm_top_posting => true,
}
begin
FileUtils.mkdir_p Redwood::BASE_DIR
def send_message
return unless edited? || BufferManager.ask_yes_or_no("Message unedited. Really send?")
+ return unless $config[:confirm_no_attachments] && mentions_attachments? && @attachments.size == 0 && BufferManager.ask_yes_or_no("You haven't added any attachments. Really send?")#" stupid ruby-mode
+ return unless $config[:confirm_top_posting] && top_posting? && BufferManager.ask_yes_or_no("You're top posting. That makes you a bad person. Really send?") #" stupid ruby-mode
date = Time.now
from_email =
private
+ def mentions_attachments?
+ @body.any? { |l| l =~ /^[^>]/ && l =~ /\battach(ment|ed|ing|)\b/i }
+ end
+
+ def top_posting?
+ @body.join =~ /(\S+)\s*Excerpts from /
+ end
+
def sig_lines
p = PersonManager.person_for @header["From"]
sigfn = (AccountManager.account_for(p.email) ||