Skip to content

Google Script to login to google apps and create mail aliases

Notifications You must be signed in to change notification settings

jollyjinx/googlescripts

Repository files navigation

Readme for googlescripts
========================

When you move from one provider to another (like I did) you sometimes need to create a hell of a lot mail aliases. I had the problem in needing spam generic aliases which were created with the dash instead of google using the minus.

old:
myspam-facebook.com@example.com

new on google:
myspam+facebook.com@example.com

I needed to filter out the minus alias names I used in the past and add them as full aliases to an account.

You need to install Config::IniFiles via perl -MCPAN -e shell
You can create  a config inifile to store your settings instead of the commandlineoptions.




creategooglealias.perl
----------------------
Creates mail aliases on a google hosted domain. 

usage:
perl creategooglealias.perl --adminname=myadmin --aliasuser=john --domainname=example.com <aliases.txt

This will create the aliases named in the aliases text file to be added to user john. The credentials for the myadmin account will be taken from your keychain.




creategoogleusertablefromvirtual.perl
-------------------------------------
creates a bulk csv user table for google. It takes in a postfix virtual table. The Postfix table looks like this:

john@example.com	john@example.com
james@example.com	james@example.com

john.doe@example.com	john@example.com
james.cook@example.com	james@example.com
postmaster@example.com	james@example.com

perl creategoogleusertablefromvirtual.perl --domainname=example.com <virtual.txt

It correctly correlates the first and last name and spits out this:

Usertable:
james	James	Cook	3df71baa43012913
john	John	Doe	b1f948351e45ee84

Aliases used:
james
james.cook
postmaster

john
john.doe



keychaincredentials.pm 
----------------------
Module to get the credentials for an account out of the keychain.




JNX::Configuration.pm
---------------------
Module I use to parse either the commandline for options or use the ini file.

About

Google Script to login to google apps and create mail aliases

none yet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages