Re: [OT] fetchmail, procmail and mutt (oh my!)

2004-07-02 Thread Geert Hendrickx
 Problem:
 If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines, 
 procmail puts the emails in the correct mbox files; but mutt complains 
 that the files are not valid email files and refuses to read them.

Make it 'mda /usr/local/bin/procmail -d %T' and it'll work fine.
Without the -d paramater, procmail just appends the mail to your mbox,
without inserting a From-line ontop.  If your mail goes from fetchmail
via sendmail to procmail, then sendmail will take care of the From-line.
If your mail goes from fetchmail to procmail directly (as you instructed
with the mda command), procmail must do it.  It's told to do so with -d
%T.  

GH
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [OT] fetchmail, procmail and mutt (oh my!)

2004-07-01 Thread Toni Schmidbauer
On Wed, Jun 30, 2004 at 09:46:31PM -0500, Andrew L. Gould wrote:
 If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines, 
 procmail puts the emails in the correct mbox files; but mutt complains 
 that the files are not valid email files and refuses to read them.

i've this line in my .fetchmailrc:

poll mailserver with proto imap user username pass pass mda '/usr/bin/procmail 
-d %T' ssl

i believe it's important to invoke procmail with the -d option,
but read procmail(1).

works like a charm for me.

hth,
toni
-- 
Wer es einmal so weit gebracht hat, dass er nicht | toni at stderror dot at
mehr irrt, der hat auch zu arbeiten aufgehoert| Toni Schmidbauer
-- Max Planck |


pgp46OTsSKisx.pgp
Description: PGP signature


Re: [OT] fetchmail, procmail and mutt (oh my!)

2004-06-30 Thread Erik Trulsson
On Wed, Jun 30, 2004 at 09:46:31PM -0500, Andrew L. Gould wrote:
 Background:
 When I travel, I use access a home server via ssh and deal with my email 
 using console applications.  I obtain my email from several sources 
 using fetchmail.  I have a .procmailrc file that properly puts the 
 emails into specified mbox files -- so far so good.
 
 Problem:
 If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines, 
 procmail puts the emails in the correct mbox files; but mutt complains 
 that the files are not valid email files and refuses to read them.
 
 If I let fetchmail put the emails into my system mbox and use formail to 
 process the emails, copies of the emails get put into the correct mbox 
 files and mutt will open the files; but I have to go back and manually 
 delete the emails in my system mail box.
 
 How can I get both valid mbox files and without having to manually 
 delete emails in my system folder?

From the fetchmail(1) manpage:

As each message is retrieved fetchmail normally delivers it via SMTP to
port 25 on the machine it is running on (localhost), just as though  it
were  being passed in over a normal TCP/IP link.  The mail will then be
delivered locally via your system's MDA (Mail Delivery  Agent, usually
sendmail(8)  but  your  system  may  use a different one such as smail,
mmdf, exim, or qmail).  All the delivery-control  mechanisms (such  as
.forward  files)  normally  available through your system MDA and local
delivery agents will therefore work automatically.

From the procmail(1) manpage:

If procmail is not installed globally  as  the  default  mail delivery
agent  (ask your system administrator), you have to make sure it is in-
voked when your mail arrives.  In this case  your $HOME/.forward  file
should  contain the line below.  Be sure to include the single and dou-
ble quotes, and unless you know your site  to  be  running smrsh  (the
SendMail Restricted SHell), it must be an absolute path.

|exec /usr/local/bin/procmail || exit 75





-- 
Insert your favourite quote here.
Erik Trulsson
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [OT] fetchmail, procmail and mutt (oh my!)

2004-06-30 Thread Giorgos Keramidas
On 2004-06-30 21:46, Andrew L. Gould [EMAIL PROTECTED] wrote:
 Problem:
 If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines,
 procmail puts the emails in the correct mbox files; but mutt complains
 that the files are not valid email files and refuses to read them.
 [...]
 Here's the top of .procmailrc and the freebsd recipe:

 MAILDIR=/home/algould/pmail
 LOGFILE=$MAILDIR/procmail.log
 VERBOSE=1
 DEFAULT=/home/algould/pmail/inbox

 :0 :
 * .*freebsd
 /home/algould/pmail/freebsd

You're using a relatively strange way to specify the mailbox file name.
Setting $MAILDIR in .procmailrc means that you can simply use:

:0 H
* ^sender: [EMAIL PROTECTED]
freebsd-doc

Note the lack of path name in the mailbox file.  IMHO, it's simpler this
way.  You can even match all teh FreeBSD lists and save the messages in
`properly' named mailboxes like this:

:0 H
* ^Sender: [EMAIL PROTECTED]@freebsd.org
{
:0 H
* ^Sender: owner-cvs-\/[EMAIL PROTECTED]
freebsd-cvs-$MATCH

:0 H
* ^Sender: owner-freebsd-\/[EMAIL PROTECTED]
freebsd-$MATCH
}

Anyway, putting this aside for a while, you can see what procmail does
to your messages with:

VERBOSE=yes
LOGABSTRACT=yes
LOGFILE=$HOME/procmail.log

Touch ~/procmail.log and start a tail -f on it.  Then fire up fetchmail
and watch the tail output.  This should at least give you a hint about
the actions of procmail.

Once a few messages get delivered to a mailbox, say `freebsd-questions',
stop fetchmail and look with a text editor at the mailbox file.  If it's
not corrupt, you should see something like this:

[EMAIL PROTECTED]:~$ head mail/freebsd-questions | cat -vte
From [EMAIL PROTECTED] Thu Jul  1 05:49:31 2004$
Received: from igloo.linux.gr (gothmog [127.0.0.1])$
^Iby gothmog.gr (8.12.11/8.12.11) with ESMTP id i612nNiG018351$
^Ifor [EMAIL PROTECTED]; Thu, 1 Jul 2004 05:49:31 +0300 (EEST)$
^I(envelope-from [EMAIL PROTECTED])$
Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119])$
^Iby igloo.linux.gr (8.12.10/8.12.10/Debian-2) with ESMTP id i612m2Oa002558$
^Ifor [EMAIL PROTECTED]; Thu, 1 Jul 2004 05:48:06 +0300$
Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18])$
^Iby mx2.freebsd.org (Postfix) with ESMTP$
[EMAIL PROTECTED]:~$

Look carefully at the first line.  It shouldn't contain any special
characters (like the ^I characters shown further down) and the format
should be similar to the one above (starting with From, followed
immediately by the sender address and then by a timestamp/date).
Otherwise, mailers will assume that this mailbox is either:

a) broken

b) not a mailbox file

Then you'll have to investigate why your procmail thinks that it should
use a mailbox format other than UNIX mbox.

- Giorgos

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [OT] fetchmail, procmail and mutt (oh my!)

2004-06-30 Thread Andrew L. Gould
On Wednesday 30 June 2004 10:37 pm, Erik Trulsson wrote:
 On Wed, Jun 30, 2004 at 09:46:31PM -0500, Andrew L. Gould wrote:
  Background:
  When I travel, I use access a home server via ssh and deal with my
  email using console applications.  I obtain my email from several
  sources using fetchmail.  I have a .procmailrc file that properly
  puts the emails into specified mbox files -- so far so good.
 
  Problem:
  If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines,
  procmail puts the emails in the correct mbox files; but mutt
  complains that the files are not valid email files and refuses to
  read them.
 
  If I let fetchmail put the emails into my system mbox and use
  formail to process the emails, copies of the emails get put into
  the correct mbox files and mutt will open the files; but I have to
  go back and manually delete the emails in my system mail box.
 
  How can I get both valid mbox files and without having to manually
  delete emails in my system folder?

 From the fetchmail(1) manpage:

 As each message is retrieved fetchmail normally delivers it via
 SMTP to port 25 on the machine it is running on (localhost), just as
 though  it were  being passed in over a normal TCP/IP link.  The mail
 will then be delivered locally via your system's MDA (Mail Delivery 
 Agent, usually sendmail(8)  but  your  system  may  use a different
 one such as smail, mmdf, exim, or qmail).  All the delivery-control 
 mechanisms (such  as .forward  files)  normally  available through
 your system MDA and local delivery agents will therefore work
 automatically.

 From the procmail(1) manpage:

 If procmail is not installed globally  as  the  default  mail
 delivery agent  (ask your system administrator), you have to make
 sure it is in- voked when your mail arrives.  In this case  your
 $HOME/.forward  file should  contain the line below.  Be sure to
 include the single and dou- ble quotes, and unless you know your site
  to  be  running smrsh  (the SendMail Restricted SHell), it must be
 an absolute path.

 |exec /usr/local/bin/procmail || exit 75

I tried using the .forward file a couple of months ago -- it was a huge 
disaster.  But then, the line above is much less complicated than the 
advice I received from one of my peers here.  The line above worked 
wonderfully.

Thanks,

Andrew Gould
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]