metalx1000

Convert Google Contacts to Abook and Mutt Aliases

Jan 14th, 2018
849
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #after download vcard file convert it to abook
  2. abook --convert --informat vcard --infile contacts.vcf --outformat abook --outfile addressbook
  3. #upload it to server
  4. scp addressbook <server>:.abook/
  5.  
  6. #convert it from abook to mutt
  7. abook --convert --informat abook --infile ~/.abook/addressbook --outformat mutt --outfile /tmp/muttbook
  8.  
  9. #remove lines that don't have email addresses
  10. sed -i -n 's/@/@/p' /tmp/muttbook
  11.  
  12. #fix aliases and replace aliases file
  13. awk '{print $1 " " $3 "_" $4 " " $3 " " $4 " " $5 " " $6 " " $7}' /tmp/muttbook > ~/.mutt/aliases
  14.  
  15. #remove tmp file
  16. rm /tmp/muttbook
Add Comment
Please, Sign In to add comment