Mercurial > hgrepos > hgweb.cgi > xsotter
annotate xsotter_mail.rb @ 6:6c763cb4ea40
change path on xsotter_mail.rb
author | KAMURA Sota <c109047@e.koeki-u.ac.jp> |
---|---|
date | Tue, 07 Feb 2012 20:08:20 +0900 |
parents | f1a06832e7de |
children | ef8cc6249d53 |
rev | line source |
---|---|
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
1 #!/home/irhome/c109/c109047/sun4v/ruby/bin/ruby |
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
2 # #! /usr/bin/env ruby |
0 | 3 # -*- coding: euc-jp -*- |
4 | |
5 require '/home/irhome/c109/c109047/xsotter/xsotter_class' | |
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
6 |
0 | 7 sender = ENV['SENDER'] |
8 rcpt = ENV['RECIPIENT'] | |
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
9 body = "" #Array.new |
0 | 10 if sender == nil || rcpt === nil |
11 exit 0 | |
12 elsif/.*@.*/ !~ sender | |
13 exit 0 | |
14 end | |
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
15 |
0 | 16 while line = gets |
17 f=1 if /^$/=~line | |
18 if f ==1 | |
19 body += line | |
20 end | |
21 end | |
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
22 body = NKF.nkf('-e', body) |
5 | 23 com=["-T", body] |
6
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
24 |
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
25 #com=["-T", "test"] |
6c763cb4ea40
change path on xsotter_mail.rb
KAMURA Sota <c109047@e.koeki-u.ac.jp>
parents:
5
diff
changeset
|
26 xsotter=Xsotter.new("/home/irhome/c109/c109047/xsotter/c109047_token") |
5 | 27 xsotter.comand(com) |