Signed-off-by: Adeodato Simó <[email protected]>
---
Hello,
on many systems (notably Debian-based systems), the /etc/mailname file
can be created to specify the public mail name for a host. If that file
exists, it'd be good to use its contents for generating the Message-Id
header.
I'd be grateful if you'd consider applying this patch.
lib/sup/modes/edit-message-mode.rb | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb
b/lib/sup/modes/edit-message-mode.rb
index f956d65..a48930a 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -73,7 +73,14 @@ EOS
@attachment_names = []
end
- @message_id = "<#{Time.now.to_i}-sup-#{rand 100...@#{socket.gethostname}>"
+ begin
+ hostname = File.open("/etc/mailname", "r").gets.chomp
+ rescue
+ nil
+ end
+ hostname = Socket.gethostname if hostname.nil? or hostname.empty?
+
+ @message_id = "<#{Time.now.to_i}-sup-#{rand 100...@#{hostname}>"
@edited = false
@selectors = []
@selector_label_width = 0
--
1.6.3.3
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk