
run_queue quits with the following traceback whenever i run it with python1.5.1 on an old ret hat linux box :(
scott
Traceback (innermost last): File "/home/mailman/cron/run_queue", line 31, in ? OutgoingQueue.processQueue() File "/home/mailman/Mailman/OutgoingQueue.py", line 38, in processQueue Utils.TrySMTPDelivery(recip,sender,text,full_fname) File "/home/mailman/Mailman/Utils.py", line 199, in TrySMTPDelivery con = smtplib.SmtpConnection(mm_cfg.SMTPHOST) File "/home/mailman/Mailman/smtplib.py", line 49, in __init__ self.connect() File "/home/mailman/Mailman/smtplib.py", line 54, in connect self._file = self._sock.makefile('r') socket.error: (29, 'Illegal seek')

I don't know all the specifics of why this is happening (seems like some system librarires do a seek while coercing a socket struct to a FILE *?), but the following patch takes use of .makefile() out of smtplib.py and fixes the problem.
scott
*** /home/mailman/Mailman/smtplib.py Tue Aug 4 00:05:27 1998 --- /home/scott/smtplib.py Tue Aug 4 21:36:19 1998
*** 45,57 **** class SmtpConnection: def __init__(self, host=''): self.host = host
self._file = None self.connect()
def connect(self): self._sock = socket(AF_INET, SOCK_STREAM) self._sock.connect(self.host, SMTP_PORT)
self._file = self._sock.makefile('r') self.getresp()
def helo(self, host): --- 45,55 ----
*** 103,109 ****
# Private crap from here down. def getline(self): ! line = self._file.readline() if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] elif line[-1:] in CRLF: line = line[:-1] --- 101,114 ----
# Private crap from here down. def getline(self): ! line = "" ! while 1: ! c = self._sock.recv(1) ! if not c: ! break ! line = line + c ! if c == "\n": ! break if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] elif line[-1:] in CRLF: line = line[:-1]
On Tue, Aug 04, 1998 at 08:03:26PM -0400, Scott wrote: | | run_queue quits with the following traceback whenever i run it with | python1.5.1 on an old ret hat linux box :( | | scott | | Traceback (innermost last): | File "/home/mailman/cron/run_queue", line 31, in ? | OutgoingQueue.processQueue() | File "/home/mailman/Mailman/OutgoingQueue.py", line 38, in | processQueue | Utils.TrySMTPDelivery(recip,sender,text,full_fname) | File "/home/mailman/Mailman/Utils.py", line 199, in TrySMTPDelivery | con = smtplib.SmtpConnection(mm_cfg.SMTPHOST) | File "/home/mailman/Mailman/smtplib.py", line 49, in __init__ | self.connect() | File "/home/mailman/Mailman/smtplib.py", line 54, in connect | self._file = self._sock.makefile('r') | socket.error: (29, 'Illegal seek') | | _______________________________________________ | Mailman-Developers maillist - Mailman-Developers@python.org | http://www.python.org/mailman/listinfo/mailman-developers |

"S" == Scott <scott@chronis.pobox.com> writes:
S> I don't know all the specifics of why this is happening (seems
S> like some system librarires do a seek while coercing a socket
S> struct to a FILE *?), but the following patch takes use of
S> .makefile() out of smtplib.py and fixes the problem.
It would be interesting to know if Python 1.5.2's smtplib.py suffers the same fate in it's getreply() method? One of the things on my to-do list is to convert to using the standard smtplib.py module that Dragon's done a lot of work on, rather than our hacked up version. It also does a makefile(), but in a different place.
Could this be another Linux-ism that's biting us? Dragon?
-Barry

On Fri, Aug 07, 1998 at 05:42:35PM -0400, Barry A. Warsaw wrote: | | >>>>> "S" == Scott <scott@chronis.pobox.com> writes: | | S> I don't know all the specifics of why this is happening (seems | S> like some system librarires do a seek while coercing a socket | S> struct to a FILE *?), but the following patch takes use of | S> .makefile() out of smtplib.py and fixes the problem. | | It would be interesting to know if Python 1.5.2's smtplib.py suffers | the same fate in it's getreply() method? One of the things on my | to-do list is to convert to using the standard smtplib.py module that | Dragon's done a lot of work on, rather than our hacked up version. | It also does a makefile(), but in a different place. | | Could this be another Linux-ism that's biting us? Dragon?
i've got mailman running on 3 linux box's now, and only one of them had this problem, it's redhat somethign or other (i inherited this one and don't know off hand) with kernel version 2.0.22
scott

On Fri, 7 Aug 1998, Barry A. Warsaw wrote:
"S" == Scott <scott@chronis.pobox.com> writes:
S> I don't know all the specifics of why this is happening (seems S> like some system librarires do a seek while coercing a socket S> struct to a FILE *?), but the following patch takes use of S> .makefile() out of smtplib.py and fixes the problem.
It would be interesting to know if Python 1.5.2's smtplib.py suffers the same fate in it's getreply() method? One of the things on my to-do list is to convert to using the standard smtplib.py module that Dragon's done a lot of work on, rather than our hacked up version. It also does a makefile(), but in a different place.
Could this be another Linux-ism that's biting us? Dragon?
Hm.... Not from what I've seen. The Python smtplib was
developed on a linux box, and I've been using it with an earlier version of mailman on the same linux box for 8 months now & I haven't seen this one. It seems fine both on the rather mongrel linux system I use for development, and on my Debian box.
-The Dragon De Monsyne

On Fri, 7 Aug 1998, Barry A. Warsaw wrote:
"S" == Scott <scott@chronis.pobox.com> writes:
S> I don't know all the specifics of why this is happening (seems S> like some system librarires do a seek while coercing a socket S> struct to a FILE *?), but the following patch takes use of S> .makefile() out of smtplib.py and fixes the problem.
Oh, one thing I just thought of... If you want to try tracking
this down, It might help to know that the socket object's 'makefile ' method is equivilent to this function:
def makefile(sock,mode='r',bufsize=-1): fd_sock=sock.fileno() fd=os.dup(fd_sock) sockfile=os.fdopen(fd,mode,bufsize) return sockfile
This might tell you something more..
-The Dragon De Monsyne

Now that i got this working, there's a permissions bug in the mail queue system:
my mailqueue looks like this: -rw------- 1 root mailman 1515 Aug 4 19:25 mm_q.2 -rw------- 1 nobody mailman 230 Aug 4 19:59 mm_q.3 -rw------- 1 www mailman 1360 Aug 4 20:12 mm_q.4
so when run_queue runs as user mailman, it can't open the files. I think it got those ownerships from root running newlist, from subscribing someone from the web, and from vmailer doing the delivery to a mailcmd as user nobody. Shouldn't they be made g+rw?
scott
On Tue, Aug 04, 1998 at 08:03:26PM -0400, Scott wrote: | | run_queue quits with the following traceback whenever i run it with | python1.5.1 on an old ret hat linux box :( | | scott | | Traceback (innermost last): | File "/home/mailman/cron/run_queue", line 31, in ? | OutgoingQueue.processQueue() | File "/home/mailman/Mailman/OutgoingQueue.py", line 38, in | processQueue | Utils.TrySMTPDelivery(recip,sender,text,full_fname) | File "/home/mailman/Mailman/Utils.py", line 199, in TrySMTPDelivery | con = smtplib.SmtpConnection(mm_cfg.SMTPHOST) | File "/home/mailman/Mailman/smtplib.py", line 49, in __init__ | self.connect() | File "/home/mailman/Mailman/smtplib.py", line 54, in connect | self._file = self._sock.makefile('r') | socket.error: (29, 'Illegal seek') | | _______________________________________________ | Mailman-Developers maillist - Mailman-Developers@python.org | http://www.python.org/mailman/listinfo/mailman-developers |

"S" == Scott <scott@chronis.pobox.com> writes:
S> so when run_queue runs as user mailman, it can't open the
S> files. I think it got those ownerships from root running
S> newlist, from subscribing someone from the web, and from
S> vmailer doing the delivery to a mailcmd as user nobody.
S> Shouldn't they be made g+rw?
I'm sure they should (in general Mailman should do all permissions based on group membership). I think all the scripts are going to have to ensure that the umask is at least 002.
-Barry
participants (3)
-
Barry A. Warsaw
-
Scott
-
The Dragon De Monsyne