LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-05-2011, 03:50 PM   #1
mrpurple
Member
 
Registered: May 2010
Posts: 50

Rep: Reputation: 2
postfix always_bcc makes multiple copies


I'm using postfix and the always_bcc option to backup the emails which are passed through my MTA.

The problem is that (with spamassassin and clamav running as virtual-smtp agents) I get three copies bcc-ed through to the backup account.

Is there something I can do to stop the bcc from being carried out on the internal filters and only work on the final send or mailbox delivery?

Thanks very much
 
Old 05-05-2011, 06:40 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Depending on how you've configured the mail flow you may be able to add the always_bcc option to one of the services in /etc/postfix/master.cf instead of in main.cf. I'm guessing you're not running amavis (amavisd-new) ?
 
Old 05-05-2011, 07:14 PM   #3
mrpurple
Member
 
Registered: May 2010
Posts: 50

Original Poster
Rep: Reputation: 2
Thanks for looking
Yeah I'm not running Amavis. I managed to get all I needed setup without that overseeing the filters.
Can I do what you suggest in master.cf without it? Or do I definitely need it?
Here is my master.cf file can you suggest a line to edit and what it might look like?
Code:
smtp      inet  n       -       -       -       -       smtpd -o content_filter=spamd


## AV scan filter (used by content_filter)
scan      unix  -       -       n       -       16      smtp
        -o smtp_send_xforward_command=yes

# For injecting mail back into postfix from the filter
127.0.0.1:10025 inet  n -       n       -       16      smtpd
        -o content_filter=
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks_style=host
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8

#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache


maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)

#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}


dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:mail argv=/usr/lib/dovecot/deliver -c /etc/dovecot/dovecot.conf -f ${sender} -d ${recipient}

vacation   unix  -       n       n       -       -       pipe
  flags=Rq user=vacation argv=/var/spool/vacation/vacation.pl -f ${sender} ${recipient}

spamd   unix  -       n       n       -       -       pipe
  flags=R user=spam argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Last edited by mrpurple; 05-05-2011 at 07:17 PM. Reason: more info queried
 
Old 05-15-2011, 05:26 PM   #4
mrpurple
Member
 
Registered: May 2010
Posts: 50

Original Poster
Rep: Reputation: 2
When I carefully RTFM I note the override option so I'll give that a go and post my success or otherwise.
 
Old 05-15-2011, 07:19 PM   #5
mrpurple
Member
 
Registered: May 2010
Posts: 50

Original Poster
Rep: Reputation: 2
Well I couldn't get that to work. Adding a -o always_bcc=backup@mydomain.com and reloading postifx did nothing. Couldnt find anything of value in the log either.
Perhaps the delivery pipe can be made to deliver to two recipients???
 
Old 05-15-2011, 09:35 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Which service did you add it to - 127.0.0.1:10025 ?
 
Old 05-16-2011, 04:01 PM   #7
mrpurple
Member
 
Registered: May 2010
Posts: 50

Original Poster
Rep: Reputation: 2
First I tried the dovecot delivery line but I got an error because it wasnt an internal postfix daemon. Then I tried the smtp line and nothing happened.
then finally I added it to the end of the 127.0.0.1:10025 lines and again no bcc occurred.
Code:
127.0.0.1:10025 inet  n -       n       -       16      smtpd
        -o content_filter=
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_address_mappings
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks_style=host
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8
        -o always_bcc=backup@mydomain
I'm not sure where to go from here. The option is either not being implimented when I need it or its causing an error thats not being reported to the log.

Incidently I also noticed in another thread to add the final receive_override_options shown above which has reduced my generic always_bcc in main.cf to produce only two backup emails for each email so thats a start.
 
Old 05-16-2011, 07:00 PM   #8
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Hmm .. I'll have to try it myself to work out the exact process, I use amavis but it should be close enough - give me a day or two.
 
Old 05-16-2011, 09:12 PM   #9
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Apparently it's not "close enough" - I put always_bcc in main.cf and it works fine for me, only 1 copy of the email was received.

Code:
127.0.0.1:10025 inet  n -       n       -       16      smtpd
        -o content_filter=
        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_address_mappings
        -o smtpd_helo_restrictions=
        -o smtpd_client_restrictions=
        -o smtpd_sender_restrictions=
        -o smtpd_recipient_restrictions=permit_mynetworks,reject
        -o mynetworks_style=host
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8
        -o always_bcc=backup@mydomain
This was a dud suggestion by me, 'no_address_mappings' will prevent 'always_bcc' from functioning.

I can't really test your configuration easily but you could be on the right track with receive_override_options, I think no_address_mappings should be set in main.cf and not set in master.cf but it's been a while since I've been hip-deep in postfix. Try to digest this and see how you go.

hth
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Postfix always_bcc NaCo Linux - Server 3 10-05-2012 07:18 AM
postfix always_bcc Ammad Linux - Server 0 06-13-2009 04:55 AM
postfix: Relay copies of the same mail jignesh.vasani Linux - Software 1 05-15-2006 03:35 AM
File copies makes my computer slow down Creak Linux - General 14 02-27-2004 06:49 PM
Printing multiple copies wjn Linux - Networking 4 12-16-2003 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration