Skip to content

Instantly share code, notes, and snippets.

@fenrir-naru
Last active May 8, 2019 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fenrir-naru/63f71c5f9b1b7cb1fce4 to your computer and use it in GitHub Desktop.
Save fenrir-naru/63f71c5f9b1b7cb1fce4 to your computer and use it in GitHub Desktop.
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