OT Multiple recipient email - I have a solution that seems to work for me
David Fletcher
dave at thefletchers.net
Fri Jan 22 10:49:54 UTC 2010
On Thursday 21 Jan 2010, David Fletcher wrote:
> My email server went down a couple of weeks ago, so now I'm trying to get it
> configured again.
>
> It's just about working, but there's a little problem that I never managed
to
> find before.
>
> The server is configured firstly as an outgoing mail relay using postfix
with
> sasl to work as an authenticated smtp client. This appears to be working
just
> fine.
>
> At my email provider One and One, there is a mail box used to collect mail
for
> multiple people, with forwards set up to direct mail for john at example.com,
> mary at example.com etc. to the same box.
>
> This mail box is emptied by fetchmail running as a cron job, which passes
> messages to procmail for filtering and sorting.
>
> Normally, this works.
>
> AFAICT my problem is, if a single message is sent to multiple recipients
> @example.com, it goes into the One and One mail collection box as a single
> message with multiple recipients, gets collected by fetchmail as a single
> message, then gets dropped by procmail into the first matching local mail
box
> it finds, so that only one of the recipients actually receives the message.
>
> I can log into the One and One mail box with web mail, and sure enough it
> shows a single message with multiple recipients.
>
> Is it possible to somehow tell fetchmail to make multiple copies of these
> messages before passing them on to procmail?
I've had "interesting times" the last couple of days, and learnt stuff about
email that I didn't know before, I think.
Presumably with what I will call a "proper" system with a fixed IP address and
an MX record to squirt email directly into the receiving system, sendmail or
postfix takes care of everything using an alias list. I don't have that
luxury at present, so I've formulated a workaround using fetchmail and
procmail that seems to be working for me. I'm sure the result is a little
ugly, but here is the basic format of what I've done to try to make sure
email gets delivered to everybody mentioned in the headers.
I have added to it the special cases that we have, filters to eliminate
certain rubbish I'm not interested in, etc.
BCC: is still a mystery to me - it appears to fail to work with this rc file.
I may spend a little more time investigating it.
If anything is horribly wrong, someone please tell me.
MAILDIR=/var/mail
DEFAULT=$MAILDIR/mbox
:0
* ^To.*person-1 at example.com\
|^cc.*person-1 at example.com
{
# This and all the similar carbon copies
# are here to attempt to deal with the
# situation of multiple recipients of a
# message to this domain.
# This of course causes a carbon copy
# to drop off the end of the file, so
# I've added a /dev/null at the bottom
# to hopefully dump these.
:0 c:
av
}
:0
* ^To.*person-2 at example.com\
|^cc.*person-2 at example.com
{
:0 c:
dave
}
:0
* ^To.*person-3 at example.com\
|^cc.*person-3 at example.com
{
:0 c:
elaine
}
:0
* ^To.*person-4 at example.com\
|^cc.*person-4 at example.com
{
:0 c:
jf
}
:0
* ^To.*person-1 at example.com\
|^To.*person-2 at example.com\
|^To.*person-3 at example.com\
|^To.*person-4 at example.com\
|^cc.*person-1 at example.com\
|^cc.*person-2 at example.com\
|^cc.*person-3 at example.com\
|^cc.*person-4 at example.com
{
:0
/dev/null
}
# Anything else, deliver to an administrator to
# make sure problems get looked at
:0:
* .*
mailneedsattention
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20100122/4e91cda4/attachment.sig>
More information about the kubuntu-users
mailing list