Russell Coker: Maildrop, IMAP, and Postfixadmin
I have recently configured my mail server to use IMAP. I started doing this when I was attending Linux.conf.au so that I could read urgent mail using my EeePC while at the conference and then be able to deal with the more complex stuff using my laptop later on.
The next logical step is to have mail delivered to different folders in the IMAP account. While there are ways of doing this via the Subject and other header fields, my needs are not that great. All I need to do is to support user+extension@example.com going to a folder named extension in the user s mail store. While changing my mail server I decided to install Postfixadmin at the same time.
My first attempt to use Maildrop was to put the following in the /etc/postfix/main.cf file:
mailbox_command = /usr/bin/maildrop -d mail -f $SENDER $DOMAIN $USER $EXTENSION That seems to only work when you have local accounts, so I ended up setting fallback_transport = maildrop and then putting the following in /etc/postfix/master.cf: maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail $ nexthop $ user $ extension Where vmail is a Unix account I created for storing mail. Then I added the following to /etc/postfix/main.cf. Some of these are probably redundant (such as the virtual_mailbox_base). The recipient limit is set to 1 because there are no command-line parameters for maildrop to support two recipients for the same message.
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_gid_maps = static:2000
virtual_uid_maps = static:2000
virtual_mailbox_base = /mail
vmaildir_destination_recipient_limit = 1
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
The files /etc/postfix/mysql* all have fields user=, password=, hosts=, and dbname=. The queries in each of the files are as follows:
mysql_virtual_alias_maps.cf:query = SELECT goto FROM alias WHERE address='%s' AND active = 1
mysql_virtual_domains_maps.cf:query = SELECT domain FROM domain WHERE domain='%s'
mysql_virtual_mailbox_maps.cf:query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1 The /etc/courier/maildroprc file has the following contents: # log the maildrop actions
logfile "/var/log/maildrop.log" # parameters 1, 2, and 3 are the domain, user, and extension
DOMAIN=tolower("$1")
USER=tolower("$2")
EXTENSION=tolower("$3")
DEFAULT="/mail/$DOMAIN/$USER" # try making a backup (cc) copy of the mail but do not abort if it fails
exception
cc "$DEFAULT/.backup/"
# try delivering to the extension folder but do not abort if it fails
exception
if(length("$EXTENSION") != 0 && "$EXTENSION" ne "backup")
to "$DEFAULT/.$EXTENSION/"
# deliver to the main inbox if there is no folder matching the extension or if no extension is specified
to "$DEFAULT/"
Installing Postfixadmin [1] was another challenge entirely. One of the complications of this is that there is no Debian package for Lenny (it seems that there will be one in Squeeze - Lenny+1). I found David Goodwin s tutorial on installing Postfixadmin and lots of other things on Debian/Etch [2] to be a very useful resource. I look forward to seeing a Lenny version of that document. Please let me know if you can think of any way to improve this.
mailbox_command = /usr/bin/maildrop -d mail -f $SENDER $DOMAIN $USER $EXTENSION That seems to only work when you have local accounts, so I ended up setting fallback_transport = maildrop and then putting the following in /etc/postfix/master.cf: maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail $ nexthop $ user $ extension Where vmail is a Unix account I created for storing mail. Then I added the following to /etc/postfix/main.cf. Some of these are probably redundant (such as the virtual_mailbox_base). The recipient limit is set to 1 because there are no command-line parameters for maildrop to support two recipients for the same message.
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_gid_maps = static:2000
virtual_uid_maps = static:2000
virtual_mailbox_base = /mail
vmaildir_destination_recipient_limit = 1
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1
The files /etc/postfix/mysql* all have fields user=, password=, hosts=, and dbname=. The queries in each of the files are as follows:
mysql_virtual_alias_maps.cf:query = SELECT goto FROM alias WHERE address='%s' AND active = 1
mysql_virtual_domains_maps.cf:query = SELECT domain FROM domain WHERE domain='%s'
mysql_virtual_mailbox_maps.cf:query = SELECT maildir FROM mailbox WHERE username='%s' AND active = 1 The /etc/courier/maildroprc file has the following contents: # log the maildrop actions
logfile "/var/log/maildrop.log" # parameters 1, 2, and 3 are the domain, user, and extension
DOMAIN=tolower("$1")
USER=tolower("$2")
EXTENSION=tolower("$3")
DEFAULT="/mail/$DOMAIN/$USER" # try making a backup (cc) copy of the mail but do not abort if it fails
exception
cc "$DEFAULT/.backup/"
# try delivering to the extension folder but do not abort if it fails
exception
if(length("$EXTENSION") != 0 && "$EXTENSION" ne "backup")
to "$DEFAULT/.$EXTENSION/"
# deliver to the main inbox if there is no folder matching the extension or if no extension is specified
to "$DEFAULT/"
Installing Postfixadmin [1] was another challenge entirely. One of the complications of this is that there is no Debian package for Lenny (it seems that there will be one in Squeeze - Lenny+1). I found David Goodwin s tutorial on installing Postfixadmin and lots of other things on Debian/Etch [2] to be a very useful resource. I look forward to seeing a Lenny version of that document. Please let me know if you can think of any way to improve this.
A bit of an unusual situation with drivel - I'm taking over maintenance from Neil McGovern and I've updated various parts of the package during that process. However, to avoid swamping Neil in wishlist [l10n] bugs during the time taken for the BTS etc. to switch over, I'm not sending a call for updated translations at this time, even though most of the current translations are out of date.
When you order good into Switzerland, they will pass the customs
office, where VAT and possibly import duties are levied. The
customs office does
I finally took some days off. Those are most needed, since I spent carnival on call at the hospital (argh!)... So Brenda and I decided to spend those days at
A cautionary tale: Verizon's DSL salespeople are completely incompetent.
Several weeks ago, I ordered residential service. I was unable to get
the prequalification app on their web site to work for my address, so
I called in. I was told (1) I could get a modem for free, and (2) that
I didn't need to do anything for the install except plug it in --
they'd just be turning something on at the CO, perhaps even before the
date my service was scheduled to begin.
These were both, of course, pure fiction. On the install date, while at
work, I got a call from a tech who had shown up at my house to rewire
something. Luckily, I was able to rendezvous with him later in the day.
The service worked briefly and then went down. Over the next few days,
I called in, was told to wait at home for 8 hours, no one showed up, I
called in again, was told "oh, sorry, it's going to be tomorrow", waited
all day the next day, no one showed up again... a week and two actual
visits later, I finally had connectivity.
I can't really blame them for whatever the line problem was, but to
repeatedly treat my time as worthless by making me wait at home for an
entire day just in case a tech can get there, even though it's highly
unlikely they will, is just offensive.
Then, I received my first bill and... was charged for the modem. Calling
in again, I was told that the deal I was offered was for online orders
only, and even if I specifically confirmed with the sales person that he
could get me the same deal since the web site wouldn't let me complete
an order (and I already had an old, power-sucking modem anyway),
there was no way I could get a refund. So I got an RMA and planned to
go shopping for a replacement (people are selling the same model on
Craigslist for $10). The RMA came in an email which also told me that if I did
not return the equipment within X days I would be charged $100.
This is all utter bullshit. Do not use Verizon. If your only other
option is Comcast, as it is here, just steal your neighbor's wireless or
tether your 3G.
They could have left me reasonably happy with the whole botched
situation if they had provided a honest estimate of how long it
would really take to get someone out (even if it was "days"), or
given me access to the same information without having to go through
a call center of people only trained to read a script about how to
power-cycle your router or whatever. And if they actually apologized for
a saleperson convincing me to sign up by lying about what I would be
charged. But why would they? What are you going to do, switch to an ISP
that treats you like a human being and doesn't fuck with your traffic?
Ha. Ha ha ha. Good luck with that.
Yesterday, the choir of which I've been a member for these past few
years went to the provincial tournament for the first time in its
existence. For those of you unaware with what this is: the "provincial
tournament" isn't a tournament in the traditional sense (which would
have a winner etc); instead, you get to sing in front of an expert jury
which will classify you in one of six categories; the category you're in
then determines government subsidy your group gets. This is done for all
nonprofessional music groups, and makes for a pretty fair way of
deciding who gets what, IMO. Apart from that, it's of course also
fun.
Anyway, as said this was the first time our choir went to such a
"tournament", but of course we weren't alone; apart from us, there were
six other choirs, two of which were also part of the Ekerse
I'm eternally confused about the state of powermanagement in Debian (or in Linux generally? Not using any other distribution seriously, I have no idea.) There are just too many scripts who interact or merely run in parallel (see my short note in
It started as a joke at last DebConf, with my (naked or dressed
...) room mates spreading that rumor. Then the idea grows into me
... and now here I am. (IOW: I'm pretending I'm not entirely guilty
of inflicting another platform to be read.)
Apparently we are just two candidates: me and the "ticket"
As you
yesterday i went to a punk concert, drank some beers, danced some pogo, fell on the slippery floor and crashed my knee once again. still i dont regret it (yet?), it was great to feel alive and young again, though its the perfect proof i'm not young anymore. but it was definitly worth it, i saw them the first time in 1997 or 98 and yesterday was their goodbye concert. wunderbar.
The listeners of
So, fanatical readers of my blog (are there any?) may remember a long time back that I