473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

twisted mail server - SMTP AUTH extension not supported

I'm trying to create a mail server in Twisted.

I either get
SMTPSenderRefused
or
SMTPException: SMTP AUTH extension not supported by server.

What do I need to do to get it to work?
--- Here is the server:

from twisted.internet import reactor

from twisted import mail
import twisted.mail.mail
import twisted.mail.maildir

service = mail.mail.MailService('ExampleMail')
smtp = service.getSMTPFactory()
pop3 = service.getPOP3Factory()

domain = mail.maildir.MaildirDirdbmDomain(service, '/temp')
domain.addUser('salvador', 'gala')
service.addDomain('dali', domain)

reactor.listenTCP(25, smtp , interface='dali')
reactor.listenTCP(110, pop3 , interface='dali')

reactor.run()

--- Here is the client that tries to send an email:

import smtplib
from email.MIMEText import MIMEText
addr = 'salvador@dali'

msg = MIMEText('Body of message')
msg['From'] = addr
msg['Subject'] = 'Note to myself'
msg['To'] = addr

server = smtplib.SMTP('dali')
server.login('salvador', 'gala') # see note 1
server.sendmail(addr, addr ,msg.as_string())
server.quit()

--- Notes:

1. If I keep in the line:
server.login('salvador', 'gala') # see note 1
the client complains:
server.login('salvador', 'gala')
File "C:\Python23\lib\smtplib.py", line 546, in login
raise SMTPException("SMTP AUTH extension not supported by
server.")
SMTPException: SMTP AUTH extension not supported by server.

If I comment it out, the client complains:
SMTPSenderRefused: (451, 'Requested action aborted: error in
processing', 'salvador@dali')
and the server prints the message:
Failure: twisted.cred.error.UnhandledCredentials: No checker for
twisted.cred.credentials.IAnonymous,
twisted.cred.credentials.ICredentials
.... smtp.py:553: DeprecationWarning:
Returning None from validateFrom is deprecated. Raise
smtp.SMTPBadSender
instead
"Raise smtp.SMTPBadSender instead", DeprecationWarning"
Jul 18 '05 #1
2 7908
Hello, I have no experience in Twisted. However I'm looking for a
sendmail replacement after my exim died for no apparent reason. I bet
a python based MTA would be more easy to configure and manage. Do you
have any recommendation? Is there a lot of work to setup twisted as a
MTA?

tung

On 30 Dec 2003 11:05:53 -0800, ca**********@ukmail.com (Mark Carter)
wrote:
I'm trying to create a mail server in Twisted.

I either get
SMTPSenderRefused
or
SMTPException: SMTP AUTH extension not supported by server.

What do I need to do to get it to work?
--- Here is the server:

from twisted.internet import reactor

from twisted import mail
import twisted.mail.mail
import twisted.mail.maildir

service = mail.mail.MailService('ExampleMail')
smtp = service.getSMTPFactory()
pop3 = service.getPOP3Factory()

domain = mail.maildir.MaildirDirdbmDomain(service, '/temp')
domain.addUser('salvador', 'gala')
service.addDomain('dali', domain)

reactor.listenTCP(25, smtp , interface='dali')
reactor.listenTCP(110, pop3 , interface='dali')

reactor.run()

--- Here is the client that tries to send an email:

import smtplib
from email.MIMEText import MIMEText
addr = 'salvador@dali'

msg = MIMEText('Body of message')
msg['From'] = addr
msg['Subject'] = 'Note to myself'
msg['To'] = addr

server = smtplib.SMTP('dali')
server.login('salvador', 'gala') # see note 1
server.sendmail(addr, addr ,msg.as_string())
server.quit()

--- Notes:

1. If I keep in the line:
server.login('salvador', 'gala') # see note 1
the client complains:
server.login('salvador', 'gala')
File "C:\Python23\lib\smtplib.py", line 546, in login
raise SMTPException("SMTP AUTH extension not supported by
server.")
SMTPException: SMTP AUTH extension not supported by server.

If I comment it out, the client complains:
SMTPSenderRefused: (451, 'Requested action aborted: error in
processing', 'salvador@dali')
and the server prints the message:
Failure: twisted.cred.error.UnhandledCredentials: No checker for
twisted.cred.credentials.IAnonymous,
twisted.cred.credentials.ICredentials
... smtp.py:553: DeprecationWarning:
Returning None from validateFrom is deprecated. Raise
smtp.SMTPBadSender
instead
"Raise smtp.SMTPBadSender instead", DeprecationWarning"


Jul 18 '05 #2
On Tue, Dec 30, 2003 at 11:05:53AM -0800, Mark Carter wrote:
I'm trying to create a mail server in Twisted.

I either get
SMTPSenderRefused
or
SMTPException: SMTP AUTH extension not supported by server.

What do I need to do to get it to work?


--- Here is the server:

from twisted.internet import reactor

from twisted import mail
import twisted.mail.mail
import twisted.mail.maildir

service = mail.mail.MailService('ExampleMail')
If you want unauthenticated users to be able to send mail, you need to
explicitly allow it.

from twisted.cred import checkers
service.smtpPortal.registerChecker(checkers.AllowA nonymousAccess())
smtp = service.getSMTPFactory()
SMTP AUTH is really part of ESMTP. Try service.getESMTPFactory() instead
of service.getSMTPFactory().
pop3 = service.getPOP3Factory()

domain = mail.maildir.MaildirDirdbmDomain(service, '/temp')
domain.addUser('salvador', 'gala')
service.addDomain('dali', domain)

reactor.listenTCP(25, smtp , interface='dali')
reactor.listenTCP(110, pop3 , interface='dali')

reactor.run()


Also, note that the above code accomplishes roughly the same thing as the
following command line:

mktap mail --maildirdbmdomain dali=/temp --default \
--user salvador=gala \
--pop3 110 --smtp 25
If you just want a mail server, using the command line is probably better.
If you need more flexibility than it can offer, sticking with code is the
right choice.

Jp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/8flAedcO2BJA+4YRAozlAJwKtrK2XkU7x7bwsoF3wzJCYVtpdw CfQItW
Kc9boapuEm+VlO3y+pRE9X4=
=9YQC
-----END PGP SIGNATURE-----

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John J. Hughes II | last post by:
I have an application that sends simple e-mails using SMTP, it no longer works with a lot of e-mail servers. Basically the problem seems to be that I am no longer sending a valid logon sequence....
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
4
by: z f | last post by:
Hi, i'm sending mail from the aspx page on the server. it is running on hosting, so i configure the System.Web.Mail.SmtpMail.SmtpServer property to my mail server. but problem is that sender...
1
rsrinivasan
by: rsrinivasan | last post by:
Hi, I am Sending mail from java. When I run the program I hava Following error.. DEBUG: setDebug: JavaMail version 1.4ea DEBUG: getProvider() returning javax.mail.Provider DEBUG SMTP:...
8
by: _spitFIRE | last post by:
Is it possible to run a SMTP server that sends mail to recipients using standard libraries, without using twisted framework, and also without using any relay server?
1
by: the_ricka | last post by:
Hi all, I'm fairly new to python, but very excited about it's potential. I'm trying to write a simple program that will accept input from a command line and send email. The parameters I used on...
1
by: Jeff | last post by:
I am receiving the following error: // error: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 No...
7
by: John Drako | last post by:
Currently, I run postfix on my own server to send message from my site (password requests, account activation notices and other messages). I have phpMailer on the server and all the messages...
1
dmjpro
by: dmjpro | last post by:
I am using SMTP mail server. I am sending a mail from SMTP client using Java Mail. But now i am getting this exception... Relaying denied. IP name possibly forged The debug informations given...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.