473,685 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

twisted mail server - SMTP AUTH extension not supported

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

I either get
SMTPSenderRefus ed
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.interne t import reactor

from twisted import mail
import twisted.mail.ma il
import twisted.mail.ma ildir

service = mail.mail.MailS ervice('Example Mail')
smtp = service.getSMTP Factory()
pop3 = service.getPOP3 Factory()

domain = mail.maildir.Ma ildirDirdbmDoma in(service, '/temp')
domain.addUser( 'salvador', 'gala')
service.addDoma in('dali', domain)

reactor.listenT CP(25, smtp , interface='dali ')
reactor.listenT CP(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('d ali')
server.login('s alvador', 'gala') # see note 1
server.sendmail (addr, addr ,msg.as_string( ))
server.quit()

--- Notes:

1. If I keep in the line:
server.login('s alvador', 'gala') # see note 1
the client complains:
server.login('s alvador', 'gala')
File "C:\Python23\li b\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:
SMTPSenderRefus ed: (451, 'Requested action aborted: error in
processing', 'salvador@dali' )
and the server prints the message:
Failure: twisted.cred.er ror.UnhandledCr edentials: No checker for
twisted.cred.cr edentials.IAnon ymous,
twisted.cred.cr edentials.ICred entials
.... smtp.py:553: DeprecationWarn ing:
Returning None from validateFrom is deprecated. Raise
smtp.SMTPBadSen der
instead
"Raise smtp.SMTPBadSen der instead", DeprecationWarn ing"
Jul 18 '05 #1
2 7940
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**********@uk mail.com (Mark Carter)
wrote:
I'm trying to create a mail server in Twisted.

I either get
SMTPSenderRefu sed
or
SMTPExceptio n: SMTP AUTH extension not supported by server.

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

from twisted.interne t import reactor

from twisted import mail
import twisted.mail.ma il
import twisted.mail.ma ildir

service = mail.mail.MailS ervice('Example Mail')
smtp = service.getSMTP Factory()
pop3 = service.getPOP3 Factory()

domain = mail.maildir.Ma ildirDirdbmDoma in(service, '/temp')
domain.addUser ('salvador', 'gala')
service.addDom ain('dali', domain)

reactor.listen TCP(25, smtp , interface='dali ')
reactor.listen TCP(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('d ali')
server.login(' salvador', 'gala') # see note 1
server.sendmai l(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('s alvador', 'gala')
File "C:\Python23\li b\smtplib.py", line 546, in login
raise SMTPException(" SMTP AUTH extension not supported by
server.")
SMTPExceptio n: SMTP AUTH extension not supported by server.

If I comment it out, the client complains:
SMTPSenderRefu sed: (451, 'Requested action aborted: error in
processing', 'salvador@dali' )
and the server prints the message:
Failure: twisted.cred.er ror.UnhandledCr edentials: No checker for
twisted.cred.c redentials.IAno nymous,
twisted.cred.c redentials.ICre dentials
... smtp.py:553: DeprecationWarn ing:
Returning None from validateFrom is deprecated. Raise
smtp.SMTPBadSe nder
instead
"Raise smtp.SMTPBadSen der instead", DeprecationWarn ing"


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
SMTPSenderRefus ed
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.interne t import reactor

from twisted import mail
import twisted.mail.ma il
import twisted.mail.ma ildir

service = mail.mail.MailS ervice('Example Mail')
If you want unauthenticated users to be able to send mail, you need to
explicitly allow it.

from twisted.cred import checkers
service.smtpPor tal.registerChe cker(checkers.A llowAnonymousAc cess())
smtp = service.getSMTP Factory()
SMTP AUTH is really part of ESMTP. Try service.getESMT PFactory() instead
of service.getSMTP Factory().
pop3 = service.getPOP3 Factory()

domain = mail.maildir.Ma ildirDirdbmDoma in(service, '/temp')
domain.addUser( 'salvador', 'gala')
service.addDoma in('dali', domain)

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

reactor.run()


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

mktap mail --maildirdbmdomai n 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+4Y RAozlAJwKtrK2Xk U7x7bwsoF3wzJCY VtpdwCfQItW
Kc9boapuEm+VlO3 y+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
2218
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. The server says the user is not authorized, if I switch to Outlook it works. Code to send authorizion. this.SendData("AUTH LOGIN" + CRLF);
8
5471
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
4
2592
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 email is also configurable and since the sender email is not from the SMTP server same host, it is not allows to send. i need to ba able to configure the SMTP Auth to be authenticated to different user from the sender email, but i didn't find...
1
2903
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: useEhlo true, useAuth true DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: trying to connect to host "smtp.hotpop.com", port 25, isSSL false 220 smtp-1.hotpop.com ESMTP Postfix
8
1671
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
2872
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 the command line are for From address, To addresses, Subject and Body. For the body, I thought it would be better to read the input from a file so I could allow someone to nicely format the body with newlines in a text editor and just read it...
1
14354
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 AUTH command has been given. How do I provide the Client Authentication with the code below. private void SendEmail2()
7
2769
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 (currently about 1000 messages are sent daily) are sent by SMTP through postfix. I'm contemplating moving this particular site's email to Gmail. Is it possible to send mail through Gmail's servers with authentication and everything?
1
6992
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 below .... "DEBUG: setDebug: JavaMail version 1.4.1 DEBUG: getProvider() returning javax.mail.Provider DEBUG SMTP: useEhlo true, useAuth false
0
8577
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8774
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6436
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2199
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.