Solved

Changing mail queue directory in qpopper

Posted on 2006-06-25
9
450 Views
Last Modified: 2013-12-16
Users on my RHES3 use pop and IMAP, and lately I've had trouble with an IMAP user who can't see images in his mailbox -a 404 type error appears in place of the images.  I've played with the squirrelmail settings and the problem occasionally goes away, then reappears.  Although the user's mail folders appear in /home/user/mail as he configured them under his squirrelmail profile, all of his (and other users) new mail is queued in /var/spool/mail, the qpopper default.   I would like to change the mail queue to /home/user/mail, which may solve this problem, and which may make it easier to handle procmail recipes as well as spamassassin, which I plan to install soon.  
First I tried running qpopper's ./configure --enable-home-dir-mail=mail as addressed in the qpopper FAQ, but got this error:
configure: WARNING: you should use --build, --host, --target, and
./configure: line 1: =: command not found
qpopper's FAQ also say that you can set home-dir-mail = Mailbox (in my case, mail)  to a qpopper configuration file, so I copied qpopper.config to /usr/local/sbin/qpopper from its samples directory, enabling this option:
set home-dir-mail = "mail/.mail"
This is different from the FAQ, however the comments in the config file say to give it a file name, so I gave both a directory name and a file name.
I also enabled set config-file = /etc/mail/pop/qpopper.config and copied the file to /etc/mail/pop and restarted xinetd, however there's no change - mail is still delivered to /var/spool/mail/user.  So I tried to recompile qpopper again, and got the same error.  The mail log in the user's .procmail folder and /var/log/maillog give me no clue. I have the latest version of qpopper, so the error is mine.  What is it?


0
Comment
Question by:klukac
  • 5
  • 4
9 Comments
 

Author Comment

by:klukac
ID: 16980759
It's probably obvious but for the record, I didn't actually recompile qpopper - I ran the .configure script again, with the same option and the same result :(
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16983211
qpopper is for collecting the mail and maps requests from the user (via pop), and translates those requests to the appropriate folder. Yo need to be looking at your mail transport agent (MTA) to make sure that mail is put in the correct queue. (This will be sendmail/procmail/qmail or others.

For sendmail, have a look at the /etc/aliases file (man aliases)

In particular the form:


joe        /var/spool/mail/joe

form. If you have a differend MTA being used , then you need to configure that accordingly.

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 16983220
Thought that I'd try and clarrify this a little further:

set home-dir-mail

is the 'home' directory that qpopper reads the mail from (it doesn't put it there.)

(   (()
(`-' _\
 ''  ''
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:klukac
ID: 16988505
wow, and all this time I thought it was qpopper...I checked the sendmail config file for /var/spool/mail, and could only find /var/spool/mqueue listed as the queue directory.  Tried editing /etc/aliases like so:
user1 :  /home/user1/mail
and ran newaliases and sent a test message, but sendmail couldn't deliver it, so I'm back to the defaults.

Before this, I had .procmailrc in user1's home directory, and noticed, belatedly, that user1 was actually getting mail in /home/user1/mail, however the only way to read user1's mail was from the command line...all messages belonged to root!  (user1 is one of my three mail accounts)  This experiment has demonstrated that I need to read up on procmail - the documentation that I found was either too easy or not to the point :(
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16990843
We all have to start learning somewhere - Have fun:). If you need any other pointers, then just post a Q.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:klukac
ID: 17027751
ok I finally have a question :)  I enabled .procmailrc in a user home directory, so this user's mail is now delivered to /home/user/mail instead of /var/spool/mail, and the ownership on incoming mail messages is now user:user.   I re-enabled qpopper.config with the home directory options as described above in the qpopper and /etc/mail/pop directories, ran make -C /etc/mail, restarted sendmail and looked for test emails sent to user.  Again, I can read new messages only in a terminal window - IMAP connects to /var/spool/mail/user.  Also, new mail is delivered as separate files (msg.x10, msg.sA4 etc), not appended to a .mail file in $HOME/mail as qpopper config comments say should happen.
So I checked sendmail.mc to see how procmail is invoked.  Here are the options that are enabled:
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
MAILER(procmail)dnl
Other than the -t option, I have no idea what the other FEATURE options mean, so I need to know if these features are a source of the problem, or at least what they mean ($h may mean host, $u may mean user, but if so I'm not sure why they would need to be defined).  Since my log files do not indicate an error, it's clearly a configuration problem or two...the first problem being delivery (appending emails to a .mail file vice writing separate msg files) and the second problem being retrieval (from $HOME/mail instead of /var/spool/mail).   Let me know where to look, thanks :)


 
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17027777
You need to learn about and use the 'man' command!

man procmail

at the command prompt shoulf give you all the info you need. Virtually every command in a linux distribution can be looked up using the man command....which means that you'll never need to ask another Q?  ;)

Incidentally, broadly speaking anything with a $ sign at the beginning is a variable that has been assigned a value somewhere else.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:klukac
ID: 17048487
Call me retarded, but the man pages so rarely answer my questions that I forget to check them (I agree that this doesn't excuse me from asking questions that are answered in the man pages).   It took lots and lots of trial and error to figure out that changing the mail queue doesn't actually solve the problem, since the permissions issue I described is with IMAP,  not POP3, and
- Squirrelmail can't read the mail queue if it's in $HOME (unless I've missed something)
- the permissions on images in email retrieved via IMAP remain unchanged from the user's mail queue in /var/spool/mail to when they are saved in the user's $HOME directory anyway.  
I'm now able to switch the mail queue in qpopper from /var/spool/mail to $HOME and back, and I'm learning what Squirrelmail does and doesn't do - would be nice if squirrelmail.org had a search engine that actually works, but google seems to be able to find answers in squirrelmail docs, so ok.    
0
 

Author Comment

by:klukac
ID: 17052289
For the record (because it wasn't clear to me at first), $HOME/.procmailrc can't redirect mail queues without the correct lines in the recipe file in $HOME/.procmail/some_recipe.rc, something like this:
:0:
* ^From: .*
.mail
after any filters you may want (.mail is the name of the queue which qpopper uses by default if you change the path to $HOME/mail)


0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question