A note on automorphisms and derivations of Lie algebras