Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Address verifier for emailrelay
#!/usr/bin/ruby
# coding: utf-8
require 'win32ole'
wsh = WIN32OLE.new('WScript.Shell')
address = ARGV[0]
res = 0
if address !~ /\@example\.com$/ then
case wsh.popup("アドレスを確認、送信する?\r\n" + address , 0, '', 1);
when 2
puts "invalid address."
exit(2)
end
end
puts ""
puts address
exit 1
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment