Problem/Motivation
Currently you configure a fetcher and have no idea if it works.
All mail MTA have a "test connection" button that confirms credentials are fine.
Followup from #2379889: Fetch email by IMAP
Proposed resolution
Add a test connection button.
Remaining tasks
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | imap_test_connection-2405045-9-interdiff.txt | 618 bytes | mbovan |
| #9 | imap_test_connection-2405045-9.patch | 6.68 KB | mbovan |
| #7 | imap_test_connection-2405045-7-interdiff.txt | 6.73 KB | mbovan |
| #7 | imap_test_connection-2405045-7.patch | 6.63 KB | mbovan |
| #7 | account_imap.png | 16.57 KB | mbovan |
Comments
Comment #1
miro_dietikerComment #2
miro_dietikerHint: There's an imap_ping() method to test a connection.
Comment #3
mbovan commentedAdded a "Connect" button.

imap_ping()requires opening an IMAP connection, so it seemsdoImap()call is enough. It fails in case connection cannot be open.Also, about the tests, I'm only asserting there is a "Connect" button. PHP IMAP extension is needed to test it properly which doesn't seem to be available in tests...
Comment #4
miro_dietikerWe should move all connection credential specific elements into a fieldset and put the Connect button there as last element.
For instance, the Batch size is NOT related to the connection credentials. :-)
Yeah, the IMAP php module isn't that common on server environments... Likely it's missing on testbot.
Testing this would need abstracting it / with mocking capability. Seems to be way too much overhead.
Comment #5
mbovan commentedMakes sense. :)
Added a fieldset:
Comment #6
miro_dietikerIf i click on "Connect" with wrong credentials, i see no error message. We need one.
The fieldset "IMAP" is repetitive. Let's name it "Account".
I think the button should be labeled "Test connection", because it does not save...
Comment #7
mbovan commentedImplemented suggestions above.
Comment #8
berdirmaybe throw an exception here, so implementations see what they need to do if they forget?
Comment #9
mbovan commentedAddressed #8.
Comment #11
miro_dietikerCommitted! Thx for adding. :-)