Page 1 of 1

CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Posted: Tue Apr 07, 2009 8:15 am
by arena
Hello,

first of all, thanks for this wonderful class.

I am currently converting my code using SM3.3 to SM4.

How can i convert the following code :

Code: Select all

case 'CRAMMD5' :
    $conn->attachAuthenticator(new Swift_Authenticator_CRAMMD5());
break;
case 'LOGIN' :
    $conn->attachAuthenticator(new Swift_Authenticator_LOGIN());
break;
case 'PLAIN' :
    $conn->attachAuthenticator(new Swift_Authenticator_PLAIN());
break;
case '@PopB4Smtp' :
    $conn->attachAuthenticator(new Swift_Authenticator_PopB4Smtp($pophost));
break;
Samples welcomed.
Thanks for your replies.

Re: CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Posted: Tue Apr 07, 2009 11:00 pm
by Chris Corbyn
For Pop before SMTP there's a plugin (since it's not a real authenticator). For managing CRAMMD5 vs LOGIN vs PLAIN, currently it's done automatically and you have no control over it. I'll re-implement this since I guess it can be useful to drill right down to such a low level of control.

POP Before SMTP:

Code: Select all

$mailer->registerPlugin(new Swift_Plugins_PopBeforeSmtpPlugin('pop.host.tld', 110));
I'll add something like this for specifying an authentication method:

Code: Select all

$smtpTransport->setAuthMethod('CRAMMD5');
The transport already knows about all possible types and uses the ones that the SMTP server supports (so really you don't *need* to have the code you currently have).

Re: CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Posted: Wed Apr 08, 2009 3:30 am
by arena
Thank you for your quick answer,

the simpler the better, so i will let swiftmailer doing it automatically.