Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-05-2011, 03:50 PM
|
#1
|
Member
Registered: May 2010
Posts: 50
Rep:
|
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
|
|
|
05-05-2011, 06:40 PM
|
#2
|
Senior Member
Registered: Aug 2009
Posts: 3,790
|
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) ?
|
|
|
05-05-2011, 07:14 PM
|
#3
|
Member
Registered: May 2010
Posts: 50
Original Poster
Rep:
|
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
|
|
|
05-15-2011, 05:26 PM
|
#4
|
Member
Registered: May 2010
Posts: 50
Original Poster
Rep:
|
When I carefully RTFM I note the override option so I'll give that a go and post my success or otherwise.
|
|
|
05-15-2011, 07:19 PM
|
#5
|
Member
Registered: May 2010
Posts: 50
Original Poster
Rep:
|
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???
|
|
|
05-15-2011, 09:35 PM
|
#6
|
Senior Member
Registered: Aug 2009
Posts: 3,790
|
Which service did you add it to - 127.0.0.1:10025 ?
|
|
|
05-16-2011, 04:01 PM
|
#7
|
Member
Registered: May 2010
Posts: 50
Original Poster
Rep:
|
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.
|
|
|
05-16-2011, 07:00 PM
|
#8
|
Senior Member
Registered: Aug 2009
Posts: 3,790
|
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.
|
|
|
05-16-2011, 09:12 PM
|
#9
|
Senior Member
Registered: Aug 2009
Posts: 3,790
|
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
|
|
|
All times are GMT -5. The time now is 07:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|