Hi,
All the mail for my company is stored into a single POP3 mailbox no matter
what the userid, just as long as the host is the same. Does anybody know
of a good program that will connect to a POP3 box, retrieve the mail and
forward it to a local SMTP server based on the original user id in the
message header, thus fanning the mail out into separate accounts.
I'd appreciate any help on this matter; you can reach me direct at
'nda...@daviesnet.com'
Thanks in advance.
Nick.
There is no standard, reliable way of doing this as far as I can see. I
checked out the RFC and the field you need is in the Received line, the For
field. The Received line is a required line but unfortunately the For for
field is an optional field. My ISP seems to support the For field most of
the time... But unfortunately not all of the time.
The To: line is definitely not reliable, as it can have multiple recepients
at your own location, as well as the fact the local recipient could be in
the CC: line.
I think the best algorithm would look for valid mail users on your system,
first in the for field of the Recieved line, then in the To: and CC: lines.
I don't believe you can make this work 100% (although I believe making 100%
may be in the control of your ISP, or the program that writes to mailbox
you're poping from).
Does anyone care to add/agree/diagree on what I've learned?
Al Youngwerth
alb...@apexxtech.com
Nicholas D. Davies <nda...@daviesnet.com> wrote in article
<01bba59e$9e51d700$738f...@ndavies.burnsos.com>...
>I'm trying to do the same thing...
>There is no standard, reliable way of doing this as far as I can see.
I am building a script that should do the trick on Linux.
I've hooked this script to my ip-up script and it seems to work great.
It basically does (be sure to check the manual pages before using this !!!):
---------------------
if popclient ...(put the enw mail in a file called newmail ) ...;
then
cat newmail | formail -cs procmail procmailrc
fi
---------------------
With the procmailrc file having something like:
---------------------
:0 c
* ^To.*us...@Basjes.nl
/var/spool/mail/user1
:0 c
* ^CC.*us...@Basjes.nl
/var/spool/mail/user1
:0 c
* ^To.*us...@Basjes.nl
/var/spool/mail/user2
:0 c
* ^CC.*us...@Basjes.nl
/var/spool/mail/user2
:0 c
* ^To.*mailinglistname
{
:0 c
/var/spool/mail/user1
:0 c
/var/spool/mail/user2
}
---------------------
I know it is primitive but it seems to work fine for my purposes.
I'm looking at changing the fact that the mail gets put in the mailbox directly
to calling sendmail to do it for me with something like :
:0 c
* ^To.*us...@Basjes.nl
! user1
Hope to have been of any help.
Grtz Niels Basjes.
-----------------------------------
| Niels Basjes |
| Home: Ni...@Basjes.nl |
| http://www.wirehub.nl/~basjesn |
| Check homepage for my PGP key |
-----------------------------------
| Work: Bas...@USoft.nl |
-----------------------------------
| "I doubt, therefore I might be" |
-----------------------------------
Any script that works by looking at the message header of the received
message will not work for mail sent via mailing lists (the header will have
the list address, not the local recipient) or mail that was sent to someone
via BCC (although mail agents are permitted to retain the BCC header
contents in the copy that goes to the blind copy recipients, most don't).
--
Barry Margolin
BBN Planet, Cambridge, MA
bar...@bbnplanet.com - Phone (617) 873-3126 - Fax (617) 873-5508
(BBN customers, please call (800) 632-7638 option 1 for support)
This problem disappears under qmail: the recipient address is recorded
in a Delivered-To field.
---Dan
Secure, reliable, efficient. Pick three. http://pobox.com/~djb/qmail.html
>Any script that works by looking at the message header of the received
>message will not work for mail sent via mailing lists (the header will have
>the list address, not the local recipient) or mail that was sent to someone
>via BCC (although mail agents are permitted to retain the BCC header
>contents in the copy that goes to the blind copy recipients, most don't).
I know about the mailing list problem and I think I had solved that by putting
this in:
:0 c
* ^To.*mailinglistname
{
:0 c
/var/spool/mail/user1
:0 c
/var/spool/mail/user2
}
Why do you think this won't work (I've tried it and it seems to go right).
Under Exim the recipient address is recorded in an Envelope-To: field.
--
Philip Hazel University Computing Service,
ph...@cus.cam.ac.uk New Museums Site, Cambridge CB2 3QG,
P.H...@ucs.cam.ac.uk England. Phone: +44 1223 334714
> I think the best algorithm would look for valid mail users on your system,
> first in the for field of the Recieved line, then in the To: and CC: lines.
> I don't believe you can make this work 100% (although I believe making 100%
> may be in the control of your ISP, or the program that writes to mailbox
> you're poping from).
>
> Does anyone care to add/agree/diagree on what I've learned?
Nope. You're spot on. Unless the ISP some how passes the evelope
destination by inserting an "X" header, there's no fully reliable means
of using a single POP3 mailbox for a whole feed. I've been trying since
May. I've hacked and re-hacked an originally written by a main member
of the ISP's mail development team, but even so it's still not fully
reliable. The main problem arises with Bcc'd mail, like mailing lists
and/or e-mail spam, which don't have either a To: or a CC: header. The
best you can do is route them to a dead-letter mailbox which .forwards to
the most likely potential recipients. I have to admit, I never thought of
using the "for" clause in the Received lines. But as you say, that's
painfully inconsistent/unreliable, too.
--
Gulraj Rijhwani \\ Courtfields Limited, Chessington, Surrey, UK
g...@courtfld.demon.co.uk \\ Tel: 0181 255 4667 Fax: 0181 287 8381
http://www.courtfld.demon.co.uk \\ Mobile: 0976 431936
----- Specialist in Pick, Unidata, datacomms and general connectivity -----
All material copyright Gulraj Rijhwani and Courtfields. ALL RIGHTS RETAINED.
>
> Nope. You're spot on. Unless the ISP some how passes the evelope
> destination by inserting an "X" header, there's no fully reliable means
> of using a single POP3 mailbox for a whole feed. I've been trying since
> May. I've hacked and re-hacked an originally written by a main member
> of the ISP's mail development team, but even so it's still not fully
Hmm, spinmail (http://www.cfw.com/~middletn/spinmail.html) handles the
above ok, part from the odd badly written list server. Even Microsoft's
list servers put the To: in the message. Perhaps when those systems
running non RFC complient list servers get enough bounced mail, they
will get some software that complies with standards set some 15 years
ago.
There really is no excuse for people to be still running this type of
software.
Nik Middleton <midd...@spinmail.com> wrote in article
<327A8B...@spinmail.com>...
Rubbish, and, cob. You say that because your POP stuff can't do what it
was never designed to do that it is the fault of perfectly compliant
mailing software.
This, and even though, your ISP has a chance to overcome the problem by
extended the behaviour of their mail system, but doesn't bother.
These list servers may be badly written, but this isn't whats badly
written.
--
Sam Liddicott | Nothing I say is to be attributed as |
Campbell Scientific Ltd. | a company statement or representation. |
Campbell Park, 80 Hathern Road, *----------------------------------------+
Shepshed, Leic. United Kingdom. LE12 9AL Phone: +44 (0) 1509 601141
Email: s...@campbellsci.co.uk Fax: +44 (0) 1509 601091
> [
> discussion about how mailing lists don't need to put the
> recipient list in the To: header
> ]
>
> Hmm, spinmail (http://www.cfw.com/~middletn/spinmail.html) handles the
> above ok, part from the odd badly written list server.
what constitutes `badly written' here?
> Even Microsoft's list servers put the To: in the message.
is it putting `To:' in the message?
> Perhaps when those systems running non RFC complient list servers get
> enough bounced mail, they will get some software that complies with
> standards set some 15 years ago.
which 15-year-old RFC requires it? for that matter, which RFC at all?
--
Russell...@locutus.ofB.ORG Shad 86c
> Gulraj Rijhwani wrote:
> > In article <01bbac1e$8dbd2440$ee3f...@alspc.apexxtech.com>
> > alb...@cyberhighway.net "Al Youngwerth" writes:
> > Nope. You're spot on. Unless the ISP some how passes the evelope
> > destination by inserting an "X" header, there's no fully reliable means
> > of using a single POP3 mailbox for a whole feed. I've been trying since
> > May. I've hacked and re-hacked an originally written by a main member
> > of the ISP's mail development team, but even so it's still not fully
> Hmm, spinmail (http://www.cfw.com/~middletn/spinmail.html) handles the
> above ok, part from the odd badly written list server. Even Microsoft's
Really? How do you handle BCC'd e-mail without any local recipient specified
(given that it's against standard practice to alter any already present
headers such as the main recipients in the To: header)??
> list servers put the To: in the message. Perhaps when those systems
> running non RFC complient list servers get enough bounced mail, they
> will get some software that complies with standards set some 15 years
> ago.
Nuts. BCC'd mail is a perfectly normal part of internet life. Perhaps
you'd like to specify which RFC(s) (which by their very nature are NOT
mandatory requirements) suggest interfering with the To: header in mail.
> There really is no excuse for people to be still running this type of
> software.
Entirely false. It's perfectly acceptable to use Bccs for non-specified
mail delivery. In fact it's common practice, and there's no way of over-
coming it with a straight POP3 feed (as I said above). It requires the
addition of a non-standard X-header specifying envelope addressee to each
message as it arrives.