LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2010, 02:32 PM   #1
evaristegalois
Member
 
Registered: Sep 2006
Distribution: Ubuntu 14.04
Posts: 41

Rep: Reputation: 15
running procmail on rented server space


I am trying to set up mutt with fetchmail and procmail on server space that's not mine. I have access to /home/myusername but not to /var/spool/myusername. Everything seems to work well, but I
have no idea where fetchmail (or procmail) is dropping off my mail. If
I use this .fetchmailrc file:

Quote:
poll mysite.com
with protocol pop3
username myusername password mypassword
and smtpname me@mysite.com
;
then fetchmail doesn't complain at all but I can't find the mbox that
my mail's been downloaded to. If I use this .fetchmailrc file:

Quote:
poll mysite.com
with protocol pop3
username myusername password mypassword
and smtpname me@mysite.com and mda "/usr/bin/procmail -d %T"
;
fetchmail complains:

Quote:
.procmail: Couldn't create "/var/spool/mail/myusername"
having lines such as these in my .procmailrc file didn't help at all:

Quote:
ORGMAIL=$HOME/tempmaildir/spool
MAILDIR=$HOME/tempmaildir
DEFAULT=$HOME/tempmaildir/spool
:0:
~/tempmaildir/spool/mbox
 
Old 02-26-2010, 02:42 PM   #2
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
As far as the black-holing of mail, have a look at the output of the 'env' command and look for: MAIL=/
Caveat, look for any .forward files in the home directory that are forwarding your mail 'elsewhere'. You may not be able to change the path as you want, but you should be able to find where it's going with that.

I've had a similar issue today myself with 'vanishing' mail. For a moment it reminded me of Exchange...... chuckle...
 
Old 02-26-2010, 04:10 PM   #3
evaristegalois
Member
 
Registered: Sep 2006
Distribution: Ubuntu 14.04
Posts: 41

Original Poster
Rep: Reputation: 15
It doesn't help. I've tried to change MAIL to /home/myusername/mail, but procmail still tries to create /var/spool/mail/myusername, but it doesn't have permission to do so (I am not the superuser). env reads MAIL correctly as /home/myusername/mail, but the complaint

Quote:
.procmail: Couldn't create "/var/spool/mail/myusername"
persists, and my mail is nowhere to be found. No .forward files.
 
Old 02-27-2010, 04:04 AM   #4
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
When I had my issue this is how I debugged it and the notes I made to 'self' - they may help you.

First thing to note, if mail is trying to be delivered to the wrong place, either your .procmailrc file is missing (not in the right place - /home/user/.procmailrc), not named correctly (missing . at the start), has incorrect directives that stop it doing what you want or is not being read for some reason.

The first thing I would do is backup your current .procmailrc and create a fresh test version containing the correct directives for your system.

First make a note of your shell:
Code:
which sh
{OUTPUT SOMETHING LIKE}
/bin/sh
Next we want the system default mail directory. I've noticed myself that some systems have the mail directory listed in the environment variable '$MAILDIR', others don't have that variable but instead have '$MAIL'. Using the wrong one in .procmailrc will fail. You can find it like this:

Code:
printenv MAIL
{OUTPUT LIKE}
/var/mail/root
BUT THIS ONE - ON MY SYSTEM - DOES NOT EXISTS
printenv MAILDIR
{nothing}
Next, for ease and testing, say we want to redirect all mail to /home/user/newmailbox. We need to make sure that directory exists or it will fail:

Code:
mkdir /home/user/newmailbox
With this information and the directory in place to take our mail, create a fresh .procmailrc file with debbuging enabled:
Code:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAILDIR=/var/mail      #we got this from printenv MAIL (and could use $MAIL)
VERBOSE=ON #turn on debug info
#simple redirect all
:0
/home/user/newmailbox
Rather than wait for mail to come in, create a simple text file test message called 'message.test'....


Code:
Return-Path: <test@procmail.local>
X-Original-To: user1
Delivered-To: user1
Received: from random.local (random.local
 [123.123.123.123]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256
 bits)) by bogus.local.test; Fri, 26 Feb 2010
 22:09:33 +0000 (GMT)
Date: Fri, 26 Feb 2010 17:10:03 -0500
To: user1
Subject: Reply to thread 'running procmail on rented server space'
From: "testprocmail.local" <test@procmail.local>
Auto-Submitted: auto-generated
Message-ID: <12345@12345>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit


Dear user,

This is a test
The cat or less it through procmail for 'user' and see what happens:

Code:
less message.test | /usr/bin/procmail -d user
*assuming your procmail is in /usr/bin/procmail - find it with 'which procmail' if not.

The debug info should help if things go wrong, but you will hopefully see something like 'You have new mail...' pop up on the cli. Check the contents of /home/user/newmailbox looking for the test message:

Code:
-rw------- 1 user     user   6.1K 2010-02-27 09:27 msg.6AcE
I hope that helps, or gets you closer to a fix.

Last edited by spampig; 02-27-2010 at 04:06 AM.
 
  


Reply

Tags
procmail



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GNU server running low on disks space ruffnek217 Linux - Newbie 2 07-20-2009 09:21 PM
How to free up space on a Linux Red Hat Server running Kerio Mail Server ohioguy47 Linux - Newbie 6 08-04-2008 08:49 PM
Can you play rented dvds in mythtv? lagu2653 Linux - Software 5 03-20-2006 04:14 PM
AIX server running out of paging space ravikumarG AIX 8 05-16-2005 09:23 AM
spamassassin tags spam while procmail isn't running broxtor Linux - Software 1 10-13-2004 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration