From mboxrd@z Thu Jan 1 00:00:00 1970 From: dato@net.com.org.es (=?utf-8?q?Adeodato=20Sim=C3=B3?=) Date: Thu, 9 Jul 2009 21:55:17 +0200 Subject: [sup-talk] [PATCH] Use /etc/mailname if present to determine the hostname for Message-Id Message-ID: Signed-off-by: Adeodato Sim? --- 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 10000}@#{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 10000}@#{hostname}>" @edited = false @selectors = [] @selector_label_width = 0 -- 1.6.3.3