3 messages in net.sourceforge.lists.courier-usersRE: [courier-users] Take a Step Back
FromSent OnAttachments
Mason, RobertoJun 18, 2002 9:08 am 
Mogens ValentinJun 18, 2002 4:02 pm 
Mason, RobertoJun 20, 2002 1:03 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: [courier-users] Take a Step BackActions...
From:Mason, Roberto (mas@swlauriersb.qc.ca)
Date:Jun 20, 2002 1:03:40 pm
List:net.sourceforge.lists.courier-users

Hello Mr Haisley,

I had to install python-mysql-0.9.0. I have both python 1.52 and 2.2-16 installed. I ran addvmail.py and this is what i get.

----------------------------------------------------------- [root@server root]# python addvmail.py --passwd ficticious --name roberto --alias robe@robertomason.pointclark.net --novert roberto Traceback (innermost last): File "addvmail.py", line 76, in ? opts, namel = getopt.getopt(sys.argv[1:], "", ["passwd=", "name=", "alias=", File "/usr/lib/python1.5/getopt.py", line 58, in getopt opts, args = do_longs(opts, args[0][2:], longopts, args[1:]) File "/usr/lib/python1.5/getopt.py", line 71, in do_longs has_arg, opt = long_has_args(opt, longopts) File "/usr/lib/python1.5/getopt.py", line 97, in long_has_args raise error, 'option --' + opt + ' not recognized' getopt.error: option --novert not recognized

-------------------------------------------------------------------

BTW, I'm having trouble emailing you. Your server keeps asking me to confirm, and I get this error in the replying

Your message did not reach some or all of the intended recipients.

Subject: RE: Please confirm your message Sent: 6/20/2002 3:58 PM

The following recipient(s) could not be reached:

fmou@localhost.fmp.com on 6/20/2002 3:59 PM

-----Original Message----- From: Lindsay Haisley [mailto:fmo@fmp.com] Sent: Wednesday, June 19, 2002 4:15 PM To: Mason, Roberto Subject: Re: [courier-users] Take a Step Back

Thus spake Mason, Roberto on Wed, Jun 19, 2002 at 12:50:20PM CDT

Hello Mr. Haisley, I don't know if you received this message, but I received notification from your server that the message was being delay, If you have received it, please excuse this inconvenience

Not a problem. You apparently replied to the confirmation request and are now on my 'whitelist'. It's a spam-control mechanism that tries to make it as easy as possible for real people to reach me.

I modified the authmysql, add server root and root password MYSQL-SERVER, USERNAME and PASSWORD I create the passwd table in the mysql database, with all fields defined

I'm using a somewhat customized password table and taking advantage of Sam's MYSQL_SELECT_CLAUSE and MYSQL_CHPASS_CLAUSE (for changing passwords). Here's my config:

MYSQL_SELECT_CLAUSE select CONCAT(id,"@",domain_name) as idd,crypt,clear,uid,gid,home,maildir,quota,name from courier.passwd where (id=lower("$(local_part)") and domain_name=lower("$(domain)")) or CONCAT(lower(id),".",lower(domain_name))="$(local_part)"

This allows people to log in for POP access with something like name.domain.com as their login ID and enforces case-crushing to lower case.

The structure of the database I use for passwd records is:

mysql> explain passwd; +-------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------------+------+-----+---------+-------+ | id | char(128) | | PRI | | | | crypt | char(128) | | | | | | clear | char(128) | | | | | | name | char(128) | | | | | | uid | int(10) unsigned | | | 65534 | | | gid | int(10) unsigned | | | 65534 | | | home | char(255) | | | | | | maildir | char(255) | | | | | | quota | char(255) | | | | | | domain_name | char(60) | | PRI | fmp.com | | +-------------+------------------+------+-----+---------+-------+

One of my questions, is not have an interface, how do I create records, especially the encrypted passwords

Can you hack python? Get <http://www.fmp.com/downloads/vmail.tar.gz>. It contains two scripts, addvmail and delvmail, which you can tweak to work with your system. You'll need proper python modules, as listed in the import statements in the code, but these scripts work very nicely for me. You can use MySQL's encrypt() function in a query to set the encrypted passwords, as you'll note in addvmail. You can also do this at a mysql prompt using an "insert" SQL query, but the scripts eliminate most of the possibility of errors. You'll need to edit them and change the settings near the top of each file to correspond to your system.

The way I have things set up here I have most of my email accounts set up as virtual mail accounts under the user vmail, which has a system entry in /etc/passwd. In this account space there's a 'domains' directory under which I have separate trees for each domains. The mail account for my daughter, li@fmp.com, would be set up under ~vmail/domains/fmp.com/lia. The python script not only creates the proper database entries, but also generates the appropriate directories in the ~vmail account and puts the basic stuff in them such as .mailfilters (with basic rcptfilter and smtpfilter) and a Maildir structure.

If you don't have virtual mail set up, you can use the --novirt switch to reference system accounts rather than virtual mail accounts, and you can tweak the python code to make this the default.