Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. mongoose.connect(env.mongo.host, {useMongoClient: true});
  2.  
  3. User.find((err, users) => {
  4. if (err) return console.error(err);
  5. if (users) {
  6. const connections = [];
  7. users.forEach((user) => {
  8. connections.push(
  9. imapConnectionFactory(user.username, user.password)
  10. )
  11. });
  12. connections.map((connection) => {
  13. connection.once('ready', () => console.log('connected'))
  14. connection.connect();
  15. })
  16. }
  17. });
  18.  
  19. const users = [{username: 'correct_username', password: 'correct_password'}];
  20. const connections = [];
  21. users.forEach((user) => {
  22. connections.push(
  23. imapConnectionFactory(user.username, user.password)
  24. )
  25. });
  26. connections.map((connection) => {
  27. connection.once('ready', () => console.log('connected'))
  28. connection.connect();
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement