lefcha/imapfilter

cannot pipe password

thjbdvlt opened this issue · 3 comments

hello :)
first i thank you for sharing this very cool software!
(second, i apologize for my poor english -- and coding -- skills: don't be afraid to tell me if some sentence doesn't mean anything.)

i'm using two accounts with imapfilter; following the example, i have tried to pipe my passwords (from pass-gpg): but it only works for one of my accounts. the other one, i can connect if i write the password as strings, or if i enter myself when i run the program, but i can't manage to pipe it:
i have error 1001 and 1003.

i have tried with only this account, but it still doesn't work.

thank you very much for reading :)

this is what my config file looks like:

status, here_it_doesnt_works = pipe_from('pass show the_firt_account_password')
first_account = IMAP {
  server = "the_server_of_first_account",
  port = 993,
  username = "my_username",
  password = here_it_doesnt_works,
  -- password = "but_here_it_works",
  ssl = "tls1.2"
  }

status, here_it_works_too = pipe_from('pass show the_second_account_password')
second_account = IMAP {
  server = "second_accound_server",
  port = 143,
  username = "second_account_user_name",
  password = here_it_works_too,
  ssl = auto
  }

results = first_account.INBOX:contain_subject('[the_subject_of_mailing_list]')
results:move_messages(first_account['mailing_lists'])

Have you tried printing the password it gets from pipe_from(), in order to verify it really gets the password string you expect?

i am very sorry that i have not replied!! i was using correct command, but, anyway, i found (last week) a (kind of builtin?) lua function: io.popen() that does the same job (it can store output a shell command in a variable) :)

There was a similar problem. I set it up like this:

status, imap_pass = pipe_from('pass Email/email')
imap_pass= string.gsub(imap_pass, "\n", "")
account1 = IMAP {
    server = 'imapserver',
    username = 'email',
    password = imap_pass
}

It works