fetchmail-friends
[Top] [All Lists]

[fetchmail] Abusing Multidrop using procmail recipes?

2003-05-21 19:55:39
Greetings,

I am currently using fetchmail 6.2.1 (together with sendmail and qpopper) on a MacOS X 10.1.5 host in an "abusing multidrop" configuration, as described in "THE USE AND ABUSE OF MULTIDROP MAILBOXES" on the man page. That is, two POP mailboxes receiving mail for a number of aliases, which are mapped to internal POP mailboxes by fetchmail.

I'm aware of the issues with this, and I'm almost happy accepting the consequences. I have

set no bouncemail

so that mail is never lost - it just requires manual intervention by the postmaster (aliased to root and then forwarded to me using .forward) sometimes. However, I'm after thoughts about using procmail to reduce the amount of manual intervention required. Here's my sample procmail recipe:

##
# /var/root/.procmailrc
##
# see procmailrc(5) for general documentation
##

##
# The following rules are all workarounds for an issue where fetchmail(1)
# cannot determine the recipient mailbox for mail:
# - addressed by certain mailing-list software,
# - where > 1 addressees share our MX domain,
# - where the destination mailbox is a BCC addressee, or
# - in other circumstances where the To: header is deliberately or
#   unintentionally mangled.
#
# In these cases fetchmail sends the message to the mailbox of last resort
# - postmaster - which on this system is an alias for `root'. We can use
# procmail(1) to redirect the message from `root' to the correct mailbox
# if we can predict enough of the message contents to identify it uniquely.
##
# local_user_1
##
# mailing_list_1
:0
* ^From:(_dot_)*known_user_1(_at_)known_company_1(_dot_)com
* ^To: undisclosed-recipients:;
* ^Subject:.*known_subject_regexp_pattern
!local_user_1
#
# mailing_list_2
:0
* ^From:(_dot_)*known_user_2(_at_)known_company_2(_dot_)com
* ^To:[ ]*$
!local_user_1
##
##
# local_user_2

...

##
# everything else goes through to me
##
:0
!my_account
##
# end .procmailrc
##

I've tested this with some success, but I noted that the Return-Path header was set to root(_at_)mail_server rather than the original sender - I guess this makes sense, since what the procmail recipe is doing is literally forwarding a message delivered to root after being redirected by fetchmail to the postmaster.

I'm interested in people's thoughts about the wisdom of this approach, any potential pitfalls, if I can change the Return-Path header, and if this is a wise thing to do, etc etc.

Here is my .fetchmalrc in case it is relevant:

% sudo cat /etc/mail/.fetchmailrc
Password:
##
# fetchmail(1) run control file
##
# NB:   This file contains the ISP POP mailbox passw0rd,
#       so set permissions accordingly (fetchmail requires this anyway)
#
# See:  Fetchmail home page, http://catb.org/~esr/fetchmail/
##
# global fethcmail settings
##
set syslog
set daemon 60
set no bouncemail
#
##
# default server settings
##
defaults                                \
       timeout 1200                    \
       proto POP3                      \
       auth password                   \
       password ********             \
       limit 8388608
#
##
# account_1 mailbox
##
poll pop.isp.com                   \
       aka isp.com                \
       user account_1 to                \
               account_1=user_3          \
               alias_1=user_1        \
               alias_2=user_2        \
               alias_3=user_4            \
               alias_4=user_1
#
##
# account_2 mailbox
# (for mail to our_domain.com.au virtual domain, pass addresses through
# unchanged to SMTP listener and let it map them to local mailboxes)
##
poll pop.isp.com                   \
       aka isp.com                \
       localdomains our_domain.com  \
       user account_2 to                   \
               alias_5=user_4          \
               alias_6=user_4   \
               alias_7=user_4
#
##
# end .fetchmailrc
##

Regards,
Damon

_________________________________________________________________
ninemsn Extra Storage is now available. Get larger attachments - send/receive up to 2MB attachments (up to 100 percent more per e-mail). Go to http://join.msn.com/?page=dept/home&pgmarket=en-au


<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail] Abusing Multidrop using procmail recipes?, Damon McMahon <=