• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4412: Authenticating to an SMTP server with a username that includes '@' does not appear to be working

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal No Action Required   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

-- TWiki:Main/DanPisarski - 25 Jul 2007

Authenticating to an SMTP server with a username that includes '@' does not appear to be working

I am new to twiki and generally new to OSS, just as a warning upfront.

I setup Twiki 4.1.2 on Kubuntu 7.04 (Fiesty Fawn) with no problem.

I am using an external email host who requires authentication to use the SMTP server, my username is my full email address with the service, including the '@' sign.

So in trying to get email working from Twiki (for instance, from registration), I entered the URL of the SMTP server, my username, and password, and several variants of the email domain, including the domain of the local install, the domain my external email address is to, and blank.

In all cases, I would always get the "error when sending email" when trying to submit the registration.

I then switched to an SMTP server that does not require authentication, changing nothing else about my install or configuration, and immediately can send email. Unfortunately, I don't have access to an SMTP server that requires authentication but one which uses usernames without an @ symbol to test that last scenario. I imagine there is a way to set that up in Kubuntu but I am not quite there yet.

I turned on the SMTP debug mode in the configuration and here is the SMTP messages, with the apache log data stripped (sorry about that, if you want the full log that is no problem I could re-create it):

<<< 220 relay5.relay.iad.emailsrvr.com ESMTP - VA Code Section 18.2-152.3:1 forbids use of this system for unsolicited bulk electronic mail (Spam) 
>>> EHLO localhost.localdomain\r
<<< 250-relay5.relay.iad.emailsrvr.com 
<<< 250-PIPELINING 
<<< 250-SIZE 75000000 
<<< 250-ETRN 
<<< 250-STARTTLS 
<<< 250-AUTH PLAIN LOGIN 
<<< 250-AUTH=PLAIN LOGIN 
<<< 250-ENHANCEDSTATUSCODES 
<<< 250 8BITMIME 
>>> MAIL FROM:<me@danpisarski.com>\r
<<< 250 2.1.0 Ok 
>>> RCPT TO:<danp@libraryvideo.com>\r
<<< 554 5.7.1 <me@danpisarski.com>: Sender address rejected: Access denied 
>>> RCPT TO:<me@danpisarski.com>\r
<<< 554 5.7.1 <me@danpisarski.com>: Sender address rejected: Access denied

I next connected to the SMTP server via just telnet, and passed it my login (encoded to Base64 from the command line using Perl), in an AUTH PLAIN command, and logged in fine, and was able to execute teh SMTP command of RCPT TO which is throwing the access denied error above.

In researching how to authenticate against the server that way (from telnet), I did read that you need to escape the '@' on the Perl line or else perl will try to substitute another value for the @ in the string. Thus, in the Perl command line I wrote the email address as \@ rather than just @.

Thinking this might be it I escaped the @ on the configuration page, but I see, looking into the .cfg file, that it just escapes the slash, thus it ends up in the configuration file as \\@. I then tried editing the .cfg directly to have it be just \@, but email still did not work with the same log results above.

-- DanPisarski - 25 Jul 2007

How did you configure TWiki to pass authentication information to the SMTP server? TWiki uses $TWiki::cfg{SMTP}{Username} and $TWiki::cfg{SMTP}{Password} for SMTP access information, and passes the content of those settings verbatim to the SMTP server for auth. It's possible, though unlikely, that the @ is getting munged. Look at LocalSite.cfg; is the value assigned to $TWiki::cfg{SMTP}{Username} in single ' quotes or double " quotes? If it is in double quotes, there may be a problem; edit LocalSite.cfg, change to single quotes and try again.

On the other hand, one possibility suggested by the SMTP debug is that your mail server blocks attempts to send email from an address other than the one that was used to log in.

CC

I also wonder if the SMTP server really expects the email address. Maybe it just expects the part before the @.

-- TWiki:Main.KennethLavrsen - 27 Jul 2007

Some mailservers accept a dot instead of the @. Another pitfall may be the auth type. Net::SMTP (the lib TWiki uses) does not support all of them by default.

-- TWiki:Main.OliverKrueger - 27 Jul 2007

Sorry it has taken me a bit to reply to everyone. Here are some answers.

CC - I configured twiki with /bin/configure. Checking LocalSite.cfg, the smtp username and password I entered in the configuration page is entered in single quotes ('), so I guess it is not the @ sign.

-- TWiki:Main.DanPisarski - 29 Jul 2007

To answer you Kenneth, I followed the instructions here http://qmail.jms1.net/test-auth.shtml to test logging into the remote smtp server from a telnet session, and was able to and send email. The session looked like this:

Trying 207.97.245.100...
Connected to smtp.emailsrvr.com.
Escape character is '^]'.
220 relay1.r1.iad.emailsrvr.com ESMTP - VA Code Section 18.2-152.3:1 forbids use of this system for unsolicited bulk electronic mail (Spam)
EHLO localhost.localdomain
250-relay1.r1.iad.emailsrvr.com
250-PIPELINING
250-SIZE 75000000
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250 8BITMIME
AUTH PLAIN AG1l...=
235 2.0.0 Authentication successful
MAIL FROM:<me@danpisarski.com>
250 2.1.0 Ok
RCPT TO:<danp@libraryvideo.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
testing direct send


.
250 2.0.0 Ok: queued as 3235F458843
quit

I omitted my full username/password string in base64 (replacing it with ... above) for the obvious reason here. but that email sent fine. If you look above at my log from twiki/apache, you see it is trying to send the email using the same email address (me@danpisarskiNOSPAM.com) as in the direct-telnet example above - I configured that email address as the administrator of the twiki install. That email address is also my login to the smtp server.

So, as Oliver suggests, does Net::SMTP not use the AUTH PLAIN command? I do not see it in the SMTP session in the debug output in the apache log.

-- TWiki:Main.DanPisarski - 29 Jul 2007

Is this really a TWiki bug? Or a SMTP debug? It sounds like the latter to me. if so, please close this report and move the discussion to a more appropriate forum e.g. TWiki:Support web

Thanks

CC

Fine. Thanks for the help.

-- TWiki:Main.DanPisarski - 31 Jul 2007

ItemTemplate
Summary Authenticating to an SMTP server with a username that includes '@' does not appear to be working
ReportedBy TWiki:Main.DanPisarski
Codebase 4.1.2
SVN Range TWiki-4.1.2, Thu, 19 Jul 2007, build 14438
AppliesTo Engine
Component

Priority Normal
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2007-07-31 - TWikiUserMapping_DanPisarski
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback