summaryrefslogtreecommitdiff
path: root/bin/postfix-generate-virtual-map
blob: f323d6bf68afe6d2ce15b81f171aa526d8c0d3f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env ruby
# Usage: postfix-show-virtual-map > ${file} && postmap hash:${file}

load "#{File.dirname(__FILE__)}/common.rb"

users = load_all_users.find_all{|u|u["groups"].include?("email")}

users.each do |user|
	if user["email"] and user["email"].length > 0
		if user["email"][0] =~ /.*@parabola.nu$/
			if user["email"].length > 1
				puts "#{user["username"]}@parabola.nu  #{user["email"][1]}"
			end
		else
			puts "#{user["username"]}@parabola.nu  #{user["email"][0]}"
		end
	end
end