Dave Rocks | 19 Oct 2002 14:28

Mailbox openbsd question

Hello,
 I'm using the popa3d that comes with OpenBSD 3.1 and I'm having a bit of trouble. I use qmail-smtpd that stores mails in /home/$USER/Mailbox & popa3d is looking to /var/mail/$USER. How do I point pop3ad to $USER/Mailbox? I know everything works as when I copy my Mailbox to /var/spool I pick up messages fine, I've tried symlinking but it doesn't  like it.
The only documentation I have is 'man pop3ad' is there anywhere else I can look?
And one last question! what's the best way to start it? I currently run 'pop3ad -D' out of rc.local. I don't run inetd but I could start it out of there with or without tcp wrappers.
Any suggestions?
Cheers!
Dave
Solar Designer | 19 Oct 2002 15:10
Favicon

Re: Mailbox openbsd question

On Sat, Oct 19, 2002 at 01:28:53PM +0100, Dave Rocks wrote:

Hi,

>  I'm using the popa3d that comes with OpenBSD 3.1 and I'm having a bit of trouble. I use qmail-smtpd that
stores mails in /home/$USER/Mailbox & popa3d is looking to /var/mail/$USER. How do I point pop3ad to $USER/Mailbox?

In params.h:

| /*
|  * Your mail spool directory. Note: only local (non-NFS) mode 775 mail
|  * spools are currently supported.
|  *
|  * #undef this for qmail-style $HOME/Mailbox mailboxes.
|  */
| #define MAIL_SPOOL_PATH                 "/var/mail"
| 
| #ifndef MAIL_SPOOL_PATH
| /*
|  * The mailbox file name relative to the user's home directory.
|  */
| #define HOME_MAILBOX_NAME               "Mailbox"
| #endif

you'll need to "#undef MAIL_SPOOL_PATH" and re-compile popa3d.

> The only documentation I have is 'man pop3ad' is there anywhere else I can look?

DESIGN, INSTALL, and params.h in popa3d sources.

> And one last question! what's the best way to start it? I currently run 'pop3ad -D' out of rc.local. I don't
run inetd but I could start it out of there with or without tcp wrappers. 
> Any suggestions?

Standalone mode is a little more efficient in terms of performance,
but takes up a little more memory for the master process if you also
run inetd anyway.  Also, popa3d tries to avoid some DoS attacks when
in standalone mode that OpenBSD's inetd doesn't.

Possible reasons to prefer running via inetd include:

1. Rare POP3 connections, no or little concern for DoS attacks on the
POP3 service itself, and the need to run inetd anyway.

2. The need for protocols other than IPv4.

3. Unusual application-level address-based access control.

--

-- 
/sd

Dave Rocks | 20 Oct 2002 00:51

Re: Mailbox openbsd question

cheers!
works a treat now, I changed that line, it complied but didn't work at
first.
Then I just copied the params.h from /usr/src/usr.sbin/popa3d/params.h,
changed the line & used that now everything is hunky dory!
Thanks
Dave
----- Original Message -----
From: "Solar Designer" <solar@...>
To: <popa3d-users@...>
Sent: Saturday, October 19, 2002 2:10 PM
Subject: Re: Mailbox openbsd question

> On Sat, Oct 19, 2002 at 01:28:53PM +0100, Dave Rocks wrote:
>
> Hi,
>
> >  I'm using the popa3d that comes with OpenBSD 3.1 and I'm having a
bit of trouble. I use qmail-smtpd that stores mails in
/home/$USER/Mailbox & popa3d is looking to /var/mail/$USER. How do I
point pop3ad to $USER/Mailbox?
>
> In params.h:
>
> | /*
> |  * Your mail spool directory. Note: only local (non-NFS) mode 775
mail
> |  * spools are currently supported.
> |  *
> |  * #undef this for qmail-style $HOME/Mailbox mailboxes.
> |  */
> | #define MAIL_SPOOL_PATH                 "/var/mail"
> |
> | #ifndef MAIL_SPOOL_PATH
> | /*
> |  * The mailbox file name relative to the user's home directory.
> |  */
> | #define HOME_MAILBOX_NAME               "Mailbox"
> | #endif
>
> you'll need to "#undef MAIL_SPOOL_PATH" and re-compile popa3d.
>
> > The only documentation I have is 'man pop3ad' is there anywhere else
I can look?
>
> DESIGN, INSTALL, and params.h in popa3d sources.
>
> > And one last question! what's the best way to start it? I currently
run 'pop3ad -D' out of rc.local. I don't run inetd but I could start it
out of there with or without tcp wrappers.
> > Any suggestions?
>
> Standalone mode is a little more efficient in terms of performance,
> but takes up a little more memory for the master process if you also
> run inetd anyway.  Also, popa3d tries to avoid some DoS attacks when
> in standalone mode that OpenBSD's inetd doesn't.
>
> Possible reasons to prefer running via inetd include:
>
> 1. Rare POP3 connections, no or little concern for DoS attacks on the
> POP3 service itself, and the need to run inetd anyway.
>
> 2. The need for protocols other than IPv4.
>
> 3. Unusual application-level address-based access control.
>
> --
> /sd

Camiel Dobbelaar | 20 Oct 2002 16:48
Picon
Gravatar

[PATCH] popa3d syslog facility (fwd)


Simon,

I hope you don't mind, but I'm forwarding this to the popa3d mailinglist.
Note that I'm not the author of popa3d, that's Solar Designer.

--
Cam

---------- Forwarded message ----------
Date: Sat, 19 Oct 2002 22:45:42 +0100
From: Simon Williams <simon@...>
To: Patrick Volkerding <volkerdi@...>,
     Camiel Dobbelaar <cd@...>
Subject: [PATCH] popa3d syslog facility

Hi,

It was pointed out by AthlonRob in alt.os.linux.slackware that popa3d
wasn't logging as LOG_MAIL to syslog.  I dug through the source &
found it was logging as LOG_DAEMON.  While it's true that popa3d is a
daemon, the syslog.conf man page has this to say:

 ----------------------------------------------------------
                                     The facility specifies
 the subsystem that produced the  message,  i.e.  all  mail
 programs log with the mail facility (LOG_MAIL) if they log
 using syslog.
 ----------------------------------------------------------

I noticed the INSTALL file mentions editing params.h to suit your
needs, but my opinion is that LOG_MAIL is a better default option.
I have attached a patch to popa3d to make it log as LOG_MAIL instead
of LOG_DAEMON for easier log filtering, in case Camiel wants to
include it in popa3d or Pat wants to include it in Slackware.

Cheers,
--

-- 
 Simon Williams <simon@...> **** GPG: F4A23C69
 "We demand rigidly defined areas of doubt and uncertainty."
                       - Douglas Adams

Attachment (popa3d.logmail.gz): application/x-gunzip, 223 bytes
Attachment (SlackBuild.gz): application/x-gunzip, 326 bytes
Solar Designer | 20 Oct 2002 17:24
Favicon

Re: [PATCH] popa3d syslog facility (fwd)

Camiel, Patrick, Simon, all:

I am not sure if my opinion is wanted (this is really a distribution
thing), but it is that having POP3 servers log as LOG_MAIL is wrong.
It may match a man page, but it's impractical.  Maybe it's the man
page that needs to be corrected (I'll probably do so for Owl).

The reason popa3d defaults to LOG_DAEMON is because there's no
facility assigned to POP3 and using a local facility in a generic
(non-distribution-specific) package would be wrong.  Distributions may
feel free to allocate a facility for POP3 and configure popa3d to use
that.

Thanks,

--

-- 
/sd

Simon Williams | 20 Oct 2002 18:26
Picon

Re: [PATCH] popa3d syslog facility (fwd)

* On Sun, Oct 20, 2002 at 04:24:39PM BST, Solar Designer
<solar@...> wrote:
> Camiel, Patrick, Simon, all:
> 
> I am not sure if my opinion is wanted

I certainly want to hear/see it.

> (this is really a distribution thing),

I gathered as much, which was why I sent it to Pat, but wondered if
LOG_MAIL was a better default.

> but it is that having POP3 servers log as LOG_MAIL is wrong.
> It may match a man page, but it's impractical.  Maybe it's the man
> page that needs to be corrected (I'll probably do so for Owl).
> 
> The reason popa3d defaults to LOG_DAEMON is because there's no
> facility assigned to POP3 and using a local facility in a generic
> (non-distribution-specific) package would be wrong.  Distributions may
> feel free to allocate a facility for POP3 and configure popa3d to use
> that.
> 
> Thanks,

Thanks for clearing that up.

--

-- 
 Simon Williams <simon@...> **** GPG: F4A23C69
 "We demand rigidly defined areas of doubt and uncertainty."
                       - Douglas Adams

Hatto von Hatzfeld | 29 Oct 2002 19:03
Picon
Favicon

"failed or refused to load"

Hello!

For some reason (a problem of procmail or formail, or of popa3 itself?)
in my mailboxes there is sometimes (hard to verify under which
conditions) an initial empty line (ASCII 10), either before the first
"From " or as only contents of a mailbox. When a pop3 client tries to
fetch mails, popa3 crashes and sends a
   Failed or refused to load /var/spool/mail/somebox
to syslog. I have written a small perl script which is checking all
mailboxes regularly by a cron job and repairs them; but that does not
seem to be a good solution... :-)

So, do you have any hints, what to do?

Or could someone tell me what to do to convince popa3d to delete initial
empty lines in a mailbox?

Thanks and bye,
Hatto v. Hatzfeld

Solar Designer | 30 Oct 2002 03:06
Favicon

Re: "failed or refused to load"

On Tue, Oct 29, 2002 at 07:03:27PM +0100, Hatto von Hatzfeld wrote:

Hi,

> For some reason (a problem of procmail or formail, or of popa3 itself?)

Please mention the versions of everything involved, including the OS.

> in my mailboxes there is sometimes (hard to verify under which
> conditions) an initial empty line (ASCII 10), either before the first
> "From " or as only contents of a mailbox.

I suggest that you start by making sure all of the software on your
system that may access mailboxes uses compatible locking.

> When a pop3 client tries to fetch mails, popa3 crashes and sends a
>    Failed or refused to load /var/spool/mail/somebox
> to syslog. I have written a small perl script which is checking all
> mailboxes regularly by a cron job and repairs them; but that does not
> seem to be a good solution... :-)

Indeed.

> So, do you have any hints, what to do?

Best is to locate and eliminate the problem such that mailboxes aren't
corrupted in this way.

> Or could someone tell me what to do to convince popa3d to delete initial
> empty lines in a mailbox?

That would be a modification to the state machine implemented in
mailbox.c: mailbox_parse().  Not too hard to do, but still some work.

--

-- 
/sd

Hatto von Hatzfeld | 30 Oct 2002 09:24
Picon
Favicon

Re: "failed or refused to load"

On Wed, Oct 30, 2002 at 05:06:02AM +0300, Solar Designer wrote:
> On Tue, Oct 29, 2002 at 07:03:27PM +0100, Hatto von Hatzfeld wrote:
> 
> > For some reason (a problem of procmail or formail, or of popa3 itself?)
> 
> Please mention the versions of everything involved, including the OS.

Sorry for having forgotten this. 
OS Linux SuSE 7.3, Kernel 2.4.10-4GB
sendmail 8.11.6
procmail/formail v3.15.1 2001/01/08
popa3d 0.5 (Oct 2001)

> > in my mailboxes there is sometimes (hard to verify under which
> > conditions) an initial empty line (ASCII 10), either before the first
> > "From " or as only contents of a mailbox.
> 
> I suggest that you start by making sure all of the software on your
> system that may access mailboxes uses compatible locking.

As far as I know all of them use flock(). Especially procmail certainly
does it.

> > When a pop3 client tries to fetch mails, popa3 crashes and sends a
> >    Failed or refused to load /var/spool/mail/somebox
> > to syslog.
> 
> Best is to locate and eliminate the problem such that mailboxes aren't
> corrupted in this way.

Since only procmail and popa3d access the mailboxes...

OK, it seems that the problem increased since I made procmail (resp.
formail) insert a header line in every message. So probably I have to
blame procmail or formail.

> > Or could someone tell me what to do to convince popa3d to delete
> > initial empty lines in a mailbox?
> 
> That would be a modification to the state machine implemented in
> mailbox.c: mailbox_parse(). Not too hard to do, but still some work.

Sigh; I finally should start learning a bit of C...

Thanks and bye,
Hatto v. Hatzfeld

Solar Designer | 30 Oct 2002 16:50
Favicon

Re: "failed or refused to load"

On Wed, Oct 30, 2002 at 09:24:16AM +0100, Hatto von Hatzfeld wrote:
> On Wed, Oct 30, 2002 at 05:06:02AM +0300, Solar Designer wrote:
> > On Tue, Oct 29, 2002 at 07:03:27PM +0100, Hatto von Hatzfeld wrote:
> > > in my mailboxes there is sometimes (hard to verify under which
> > > conditions) an initial empty line (ASCII 10), either before the first
> > > "From " or as only contents of a mailbox.
> > 
> > I suggest that you start by making sure all of the software on your
> > system that may access mailboxes uses compatible locking.
> 
> As far as I know all of them use flock(). Especially procmail certainly
> does it.

The convention is to use fcntl(), not flock(), on Linux.

popa3d certainly defaults to fcntl().  Check out its params.h file you
built it with and "procmail -v".  Both should use fcntl().

> > > Or could someone tell me what to do to convince popa3d to delete
> > > initial empty lines in a mailbox?
> > 
> > That would be a modification to the state machine implemented in
> > mailbox.c: mailbox_parse(). Not too hard to do, but still some work.
> 
> Sigh; I finally should start learning a bit of C...

Well, if nothing else works, I may do this mod just for you or try to
investigate the problem right on your system, at my usual consulting
rate for own software (see http://www.openwall.com/services/).

--

-- 
/sd


Gmane