Archive for the ‘Redhat’ Category

Removing a top level cyrus imap mailbox

Thursday, May 28th, 2009 by Gary Richards - Categories: Email, Linux, Operating Systems, Redhat

When using cyrus imap generally a new mailbox is added to the system using the following commands:

$ cyradm -u cyrus localhost
Password:
localhost> cm user.someusername

Generally, this would create the directory: /var/spool/imap/user/s/someuser, containing the various cyrus files.

It turns out that you can also do the following too:

localhost> cm someusername
localhost> cm someuser.name

When you list users you would see:

localhost> lm
someuser.name (\HasNoChildren)
someusername (\HasNoChildren)
user.someusername (\HasNoChildren)

I came across a (RHEL4) cyrus server like this today, it seems that someone had created some mailboxes like this accidentally and then not been able to remove them.

When I tried I received the following messages:

localhost> dm someusername
deletemailbox: Permission denied
localhost> sam someusername cyrus c
setaclmailbox: cyrus: c: System I/O error

Based on what I said above, I would have expected both /var/spool/imap/someusername and /var/spool/imap/someuser/n/name (or /var/spool/imap/someuser/name) to exist and to contain the various cyrus files, but they don’t. I can only assume that this is why I see the errors above.

Anyhow, the fix was fairly simple:

$ cd /var/spool/imap
$ mkdir someusername
$ reconstruct someusername
$ cyradm -u cyrus localhost
localhost> sam someusername cyrus c
localhost> dm someusername

The same applies forsomeuser.name, however rather than creating an extravagent directory structure, it appears that you can just create the directory someuser.name and then reconstruct someuser.name, if that fails then i’d suggest try creating someuser/name and resconstructing someuser.name or failing that, try creating someuser/n/name and reconstructing someuser.name.

This looks as though it may have been a bug in an older build of cyrus imapd. As I tried some similar steps on a test cyrus setup on a Gentoo system and I can create/delete these mailboxes fine without the above steps.

All very odd.

Pointopoint ethernet on Redhat/CentOS

Tuesday, December 2nd, 2008 by Gary Richards - Categories: Linux, Operating Systems, Redhat

After trawling through RedHat Documentation, it seems that there is no way to configure point to point (pointopoint) for Ethernet links in the configuration files.

Googling didn’t really help… everything seemed to suggest specifying REMIP or REMOTE_IPADDR in the config file, but REMIP only appears to affect ppp,plip and a few other interface types and REMOTE_IPADDR appears to be old.

Looking into the code that deals with Ethernet devices suggests that at some point in the past RedHat moved away from using ifconfig in this script to using ip from the iproute package.

To do pointopoint with iproute rather than ifconfig, it seems that you simple use the ‘peer ‘ option, rather than ‘pointopoint ‘.

Looking closer at the ifup-eth code, the interfaces are configured with this line:

if ! ip addr add ${IPADDR}/${PREFIX}
brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then

Now… it looks like they’ve built in the ability for you to specify SCOPE in your configuration file, but they’ve not explicitly done ’scope ${SCOPE}’ in the command. Obviously this means that anyone that does want to specify SCOPE has to set it to something like ’scope host’, rather than just ‘host’, probably because a lot of users will never use it. If you abuse this functionality slightly, you have an ideal way to work around this problem.

Configure ifcfg-ethX as usual but also specify the following (10.3.0.254 is the remote end of the point to point link):

SCOPE="peer 10.3.0.254"

Restart networking… and voila.

This worked on CentOS, so I guess it affects Fedora and Redhat too.