Pedja
Pedja

Reputation: 81

DDEV - how to access Mailpit POP3 server

Need to access builtin POP3 server inside of Mailpit.

Mailpit is mentioning adding auth to enable POP3 feature.

I'm developing code for "unsubscribe" feature available in email clients (not with link inside of message). Massage have title "unsubscribe" and "from" is email of user who wants to unsubscribe from mail list sent by their provider. Most of public mail services (gmail, yahoo, apple, office365) requires OAuth and complicating testing.

Tried to figure out where to insert file with plaintext username and password, and to open 1110 port for access, without success.

Upvotes: 1

Views: 215

Answers (1)

Pedja
Pedja

Reputation: 81

In .ddev/config.yml add

web_environment:
  - "MP_POP3_AUTH=user:pass"

and you can open the mailbox with the following code:

$imap = imap_open('{localhost:1110/pop3/novalidate-cert}INBOX', 'user', 'pass');

"user" and "pass" must match if you want to enter something else

Upvotes: 2

Related Questions