Tim Legant wrote:
Nils Vogels <[EMAIL PROTECTED]> writes:

  
My FQDN of the box is box1.example.org, and the
%(confirm_accept_address)s just keeps on being in the form of
[EMAIL PROTECTED], while the RCPT TO states
[EMAIL PROTECTED]

On thing that might be related, is that Postfix is doing
virtual-domains, and the user that the email is being delivered to is
locally known as [EMAIL PROTECTED]..
    

This is probably the problem.  The recipient_address variable is
exactly what Postfix places in the RECIPIENT environment variable,
with no manipulation of any sort.  If this is a problem that can't be
solved through Postfix, you can massage it in your config file like
this.

rcptaddr = os.environ['RECIPIENT']
try:
    i = rcptaddr.rindex('@')
    rcpt, host = rcptaddr[:i], rcptaddr[i+1:]
    domain = '.'.join(host.split('.')[-2:])
    os.environ['RECIPIENT'] = rcpt + '@' + domain
except ValueError:
    pass
  
Thanks Tim, that solves one problem, but unfortunately introduces another :-(

For some reason my tmda-cgi now crashes nicely with the following message:


 
KeyError
Python 2.3.2: /usr/local/bin/python
Thu Oct 23 23:13:58 2003

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /usr/home/nivo/tmda-cgi-20031015/tmda-cgi.py
  101   PVars["InProcess"]   = {}
  102   PVars["LocalConfig"] = "Form"
  103   PVars.Save()
  104 
  105 # Share "globals"
PVars undefined

 /usr/home/nivo/tmda-cgi-20031015/Session.py in __init__(self=<Session.Session instance>, Form=FieldStorage(None, None, [MiniFieldStorage('cmd', 'theme'), MiniFieldStorage('SID', 'TW5xe2AS')]))
  356       # Failed to resurrect session, fall through to make new SID
  357       except (IOError, OSError):
  358         pass
  359 
  360     # New session

 /usr/home/nivo/tmda-cgi-20031015/Session.py in BecomeUser(self=<Session.Session instance>)
  277       T["ErrMsg"] = ErrStr
  278       print T
  279       sys.exit()
  280 
  281     # Read in our PVars
global sys = <module 'sys' (built-in)>, sys.exit = <built-in function exit>

 /usr/local/lib/python2.3/site-packages/TMDA/Defaults.py
   87 if os.path.exists(TMDARC):
   88     if CONFIG_EXEC:
   89         execfile(TMDARC)
   90     else:
   91         import ConfigParser
builtin execfile = <built-in function execfile>, TMDARC = '/home/nivo/.tmda/config'

 /home/nivo/.tmda/config
   51 # [EMAIL PROTECTED] -> [EMAIL PROTECTED] rewrite
   52 #
   53 rcptaddr = os.environ['RECIPIENT']
   54 try:
   55     i = rcptaddr.rindex('@')
rcptaddr undefined, os = <module 'os' from '/usr/local/lib/python2.3/os.pyc'>, os.environ = {'TMDA_SESSION_PREFIX': '/tmp/TMDASession.', 'HT...ip, deflate', 'UNIQUE_ID': 'P5hElH8AAAEAAFZuWKg'}

 /usr/local/lib/python2.3/UserDict.py in __getitem__(self={'TMDA_SESSION_PREFIX': '/tmp/TMDASession.', 'HT...ip, deflate', 'UNIQUE_ID': 'P5hElH8AAAEAAFZuWKg'}, key='RECIPIENT')
   17             return cmp(self.data, dict)
   18     def __len__(self): return len(self.data)
   19     def __getitem__(self, key): return self.data[key]
   20     def __setitem__(self, key, item): self.data[key] = item
   21     def __delitem__(self, key): del self.data[key]
__getitem__ undefined, self = {'TMDA_SESSION_PREFIX': '/tmp/TMDASession.', 'HT...ip, deflate', 'UNIQUE_ID': 'P5hElH8AAAEAAFZuWKg'}, key = 'RECIPIENT', self.data = {'DOCUMENT_ROOT': '/usr/local/www/data', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HOME': '/home/nivo', 'HTTP_ACCEPT': 'image/gif, image/x-xbitmap, image/jpeg, image/pj...cation/vnd.ms-powerpoint, application/msword, */*', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'en,nl;q=0.5', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_HOST': 'www.is-root.com', 'HTTP_REFERER': 'http://www.is-root.com/cgi-bin/tmda.cgi?cmd=localconfig&SID=TW5xe2AS', 'HTTP_USER_AGENT': 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)', ...}

KeyError: 'RECIPIENT'
      args = ('RECIPIENT',)


Help ;-)
_____________________________________________
tmda-users mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-users

Reply via email to