copy outgoing mail
Hi All, I am using postfix-2.3.3-2.3.el5_6 on CentOS 5.6 . I want to keep copy of outgoing mails for specific user. How can I do that? I am using virtual mapping to keep copy of incoming mail but what about outgoing ?? Regards
Re: copy outgoing mail
Am 12.09.2011 11:55, schrieb Amira Othman: Hi All, I am using postfix-2.3.3-2.3.el5_6 on CentOS 5.6 . I want to keep copy of outgoing mails for specific user. How can I do that? I am using virtual mapping to keep copy of incoming mail but what about outgoing ?? Regards this may help sender_bcc_maps (default: empty) Optional BCC (blind carbon-copy) address lookup tables, indexed by sender address. The BCC address (multiple results are not supported) is added when mail enters from outside of Postfix. This feature is available in Postfix 2.1 and later. The table search order is as follows: Look up the user+extens...@domain.tld address including the optional address extension. Look up the u...@domain.tld address without the optional address extension. Look up the user+extension address local part when the sender domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. Look up the user address local part when the sender domain equals $myorigin, $mydestination, $inet_interfaces or $proxy_interfaces. Look up the @domain.tld part. Specify the types and names of databases to use. After change, run postmap /etc/postfix/sender_bcc. Note: if mail to the BCC address bounces it will be returned to the sender. Note: automatic BCC recipients are produced only for new mail. To avoid mailer loops, automatic BCC recipients are not generated after Postfix forwards mail internally, or after Postfix generates mail itself. Example: sender_bcc_maps = hash:/etc/postfix/sender_bcc -- Best Regards MfG Robert Schetterer Germany/Munich/Bavaria
Inject email from web server to postfix queue
Hi List I don't know if this is possible But we have developed a website for a customer with a CRM backend, without around 72,000 subscribers. We want to update and manage the subscriber list on the webserver and generate the weekly mailshot, all these processes are running fine. Our solution was to create threads on the web server (running IIS) to generate emails to be sent by the middleware (a PHP like language). This does work fine up to around a couple of thousand emails, then it runs out of memory and the process dies. I am looking at some kind of throttle, but its not a very elegant solution. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. I have a live and very happy Postfix server, already managing the email for a couple of dozen domains. (Nothing very big, mostly 3/4 users on each). Which I don't want to risk messing up. Firstly, is the feasable? Can I create a new webqueue folder, drop the files in their and have postfix send them off? Can I copy a file from the mail queue as a template? Any thoughts on this appreciated. Regards Jon Harris
Re: Inject email from web server to postfix queue
On Mon, Sep 12, 2011 at 9:37 AM, Jon Harris j.har...@digital-ink.co.uk wrote: Hi List I don't know if this is possible It's not. Search the list archives, and there are plenty of people wanting an API for dropping mail straight into the postfix queue. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. Sure, you just need some middleware that understands SMTP and file locking. Write something up in perl, that will pickup new files on the system, lock them, pass them to postfix (either via sendmail or TCP/SMTP) and then remove the message file. Just be sure that your middleware application has some callback mechanism for registering success/fails when injecting into postfix. Postfix on its own (AFAIK) won't do this for you.
Re: Inject email from web server to postfix queue
On 12/09/2011 14:37, Jon Harris wrote: Hi List I don't know if this is possible But we have developed a website for a customer with a CRM backend, without around 72,000 subscribers. We want to update and manage the subscriber list on the webserver and generate the weekly mailshot, all these processes are running fine. Our solution was to create threads on the web server (running IIS) to generate emails to be sent by the middleware (a PHP like language). This does work fine up to around a couple of thousand emails, then it runs out of memory and the process dies. I am looking at some kind of throttle, but its not a very elegant solution. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. I may be missing something obvious here, but I don't see why a program that can't create 72,000 email messages without running out of memory will be able to create 72,000 files without failing for exactly the same reason. An email is, after all, merely a file which is written to an external process (an SMTP server, in this example example) rather than a physical location. In fact, I'm having difficulty imagining a reason why any competently written program can't send an arbitrarily large number of emails anyway - all it's doing is running round a loop repeatedly, and it doesn't matter whether it does it 72 times or 72,000 times. The real constraints are the capacity of your mail servers to handle that many emails. It sounds to me, therefore, is if what you've got is a serious flaw in your mail-generation program, and I'd be inclined to address that rather than trying to find a workaround for the problem that involves injecting mail directly into the queue. If you really can't fix the mail-generation program's sending limit (eg, because it's a third-party CMS that comes with the bug built-in), then, as has already been suggested, the simplest option is to use an intermediate program which takes files from your storage directory and then sends them out by email. That's not Postfix-specific; any program which can read a file and then write to SMTP will work with any MTA. It would be pretty trivial to code that in PHP or Perl, I'm presuming it would be equally simple in Python, Ruby, ASP or your programming language of choice. The only complex part of it is error handling to ensure that you don't send the same message twice to the same person or that you don't miss anyone out if any email fails to send. Mark -- Sent from my Babbage Difference Engine http://mark.goodge.co.uk http://www.ratemysupermarket.com
Switch to new server and forward existing mail from old server
Hi all: I've tried googling, and found a ton of stuff, but nothing specific to my question. I've got an ancient postfix server with a couple virtual domains, been chugging along solid and stable for years. Want to move to a new server at a different IP, Have the old server forward / transfer any mail collected in it's mail boxes to the new server, and not have the users have to make any changes to their email clients or loose any email. Is there any way to tell the OLD Postfix to grab a user's mail box and forward all the messages in it to that user at the NEW Postfix? I'm concerned that if a user last checked email Friday afternoon at 4:00, and I do the switch over say Saturday Night, any email collected in the interim will be stuck on the old server without manual intervention. Thanks Cla.
Re: Switch to new server and forward existing mail from old server
Am 12.09.2011 16:50, schrieb Clarence Brown: Hi all: I've tried googling, and found a ton of stuff, but nothing specific to my question. I've got an ancient postfix server with a couple virtual domains, been chugging along solid and stable for years. Want to move to a new server at a different IP, Have the old server forward / transfer any mail collected in it's mail boxes to the new server, and not have the users have to make any changes to their email clients or loose any email. Is there any way to tell the OLD Postfix to grab a user's mail box and forward all the messages in it to that user at the NEW Postfix? I'm concerned that if a user last checked email Friday afternoon at 4:00, and I do the switch over say Saturday Night, any email collected in the interim will be stuck on the old server without manual intervention already delivered mails has nothing to do with MTA / Postfix if you have a IMAP-Server use imapsync which is scriptable and has a lot of functions signature.asc Description: OpenPGP digital signature
RE: Inject email from web server to postfix queue
Hi Mark I know this does sound odd, but the middleware uses its SQLite and its own SMTP queue management. Apparently when the queue gets bloated, things start to go wrong. Whereas creating 72,000 files on disk wouldn't be a problem. Yes, I agree this does expose a weekness in the middleware, but we are already committed to it. Most web applications only have to email an order or a contact form, etc. So I can't really blame the developers for me trying to use it as a mailing list manager. So, my idea was to use something a little more industrial strength to get the messages out. I was trying to draw a few things together. I know my Postfix server works beautifully (out of 18 servers, its my most reliable) and I know I can create a SMB share on it. I wanted to create a drop-folder. I understand from Peter Blair who also answered this thread that I should be able to write something in Perl to do this. Unfortunately, my Perl skills are pretty weak. Regards Jon Harris -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Mark Goodge Sent: 12 September 2011 15:01 To: postfix-users@postfix.org Subject: Re: Inject email from web server to postfix queue On 12/09/2011 14:37, Jon Harris wrote: Hi List I don't know if this is possible But we have developed a website for a customer with a CRM backend, without around 72,000 subscribers. We want to update and manage the subscriber list on the webserver and generate the weekly mailshot, all these processes are running fine. Our solution was to create threads on the web server (running IIS) to generate emails to be sent by the middleware (a PHP like language). This does work fine up to around a couple of thousand emails, then it runs out of memory and the process dies. I am looking at some kind of throttle, but its not a very elegant solution. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. I may be missing something obvious here, but I don't see why a program that can't create 72,000 email messages without running out of memory will be able to create 72,000 files without failing for exactly the same reason. An email is, after all, merely a file which is written to an external process (an SMTP server, in this example example) rather than a physical location. In fact, I'm having difficulty imagining a reason why any competently written program can't send an arbitrarily large number of emails anyway - all it's doing is running round a loop repeatedly, and it doesn't matter whether it does it 72 times or 72,000 times. The real constraints are the capacity of your mail servers to handle that many emails. It sounds to me, therefore, is if what you've got is a serious flaw in your mail-generation program, and I'd be inclined to address that rather than trying to find a workaround for the problem that involves injecting mail directly into the queue. If you really can't fix the mail-generation program's sending limit (eg, because it's a third-party CMS that comes with the bug built-in), then, as has already been suggested, the simplest option is to use an intermediate program which takes files from your storage directory and then sends them out by email. That's not Postfix-specific; any program which can read a file and then write to SMTP will work with any MTA. It would be pretty trivial to code that in PHP or Perl, I'm presuming it would be equally simple in Python, Ruby, ASP or your programming language of choice. The only complex part of it is error handling to ensure that you don't send the same message twice to the same person or that you don't miss anyone out if any email fails to send. Mark -- Sent from my Babbage Difference Engine http://mark.goodge.co.uk http://www.ratemysupermarket.com
Re: Inject email from web server to postfix queue
On Mon, Sep 12, 2011 at 11:00 AM, Jon Harris j.har...@digital-ink.co.uk wrote: Hi Mark I know this does sound odd, but the middleware uses its SQLite and its own SMTP queue management. Bypass it. Tell it that the smart relay host is your postfix box. It is trying to do something it shouldn't. Postfix should be the only software that manages queues. Apparently when the queue gets bloated, things start to go wrong. Whereas creating 72,000 files on disk wouldn't be a problem. Yes, I agree this does expose a weekness in the middleware, but we are already committed to it. Most web applications only have to email an order or a contact form, etc. So I can't really blame the developers for me trying to use it as a mailing list manager. So, my idea was to use something a little more industrial strength to get the messages out. Yes, it is called postfix. On 12/09/2011 14:37, Jon Harris wrote: Hi List I don't know if this is possible But we have developed a website for a customer with a CRM backend, without around 72,000 subscribers. We want to update and manage the subscriber list on the webserver and generate the weekly mailshot, all these processes are running fine. Our solution was to create threads on the web server (running IIS) to generate emails to be sent by the middleware (a PHP like language). This does work fine up to around a couple of thousand emails, then it runs out of memory and the process dies. I am looking at some kind of throttle, but its not a very elegant solution. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. I may be missing something obvious here, but I don't see why a program that can't create 72,000 email messages without running out of memory will be able to create 72,000 files without failing for exactly the same reason. An email is, after all, merely a file which is written to an external process (an SMTP server, in this example example) rather than a physical location. In fact, I'm having difficulty imagining a reason why any competently written program can't send an arbitrarily large number of emails anyway - all it's doing is running round a loop repeatedly, and it doesn't matter whether it does it 72 times or 72,000 times. The real constraints are the capacity of your mail servers to handle that many emails. It sounds to me, therefore, is if what you've got is a serious flaw in your mail-generation program, and I'd be inclined to address that rather than trying to find a workaround for the problem that involves injecting mail directly into the queue. If you really can't fix the mail-generation program's sending limit (eg, because it's a third-party CMS that comes with the bug built-in), then, as has already been suggested, the simplest option is to use an intermediate program which takes files from your storage directory and then sends them out by email. That's not Postfix-specific; any program which can read a file and then write to SMTP will work with any MTA. It would be pretty trivial to code that in PHP or Perl, I'm presuming it would be equally simple in Python, Ruby, ASP or your programming language of choice. The only complex part of it is error handling to ensure that you don't send the same message twice to the same person or that you don't miss anyone out if any email fails to send. Mark -- Sent from my Babbage Difference Engine http://mark.goodge.co.uk http://www.ratemysupermarket.com
Re: Switch to new server and forward existing mail from old server
Hi Clarence we deliver mail into Maildir i.e. one file per mail. The maildirs are usually under /var/spool/maildir. If I have to copy all of the mail to a new server, i just do rsync -avure ssh /old/maildir/* new_server:/new/maildir and no problem. suomi On 2011-09-12 16:50, Clarence Brown wrote: Hi all: I've tried googling, and found a ton of stuff, but nothing specific to my question. I've got an ancient postfix server with a couple virtual domains, been chugging along solid and stable for years. Want to move to a new server at a different IP, Have the old server forward / transfer any mail collected in it's mail boxes to the new server, and not have the users have to make any changes to their email clients or loose any email. Is there any way to tell the OLD Postfix to grab a user's mail box and forward all the messages in it to that user at the NEW Postfix? I'm concerned that if a user last checked email Friday afternoon at 4:00, and I do the switch over say Saturday Night, any email collected in the interim will be stuck on the old server without manual intervention. Thanks Cla.
Re: Inject email from web server to postfix queue
Jon Harris: Hi List I don't know if this is possible But we have developed a website for a customer with a CRM backend, without around 72,000 subscribers. We want to update and manage the subscriber list on the webserver and generate the weekly mailshot, all these processes are running fine. Our solution was to create threads on the web server (running IIS) to generate emails to be sent by the middleware (a PHP like language). This does work fine up to around a couple of thousand emails, then it runs out of memory and the process dies. I am looking at some kind of throttle, but its not a very elegant solution. I thought if I could generate a postfix friendly file, I could create an SMB share and drop the 72,000 files into a folder that Postfix would see and then process. I have a live and very happy Postfix server, already managing the email for a couple of dozen domains. (Nothing very big, mostly 3/4 users on each). Which I don't want to risk messing up. Firstly, is the feasable? Can I create a new webqueue folder, drop the files in their and have postfix send them off? Can I copy a file from the mail queue as a template? Nope, you can't. The external interfaces are: SMTP protocol and the Postfix sendmail command. Wietse
Re: Switch to new server and forward existing mail from old server
Thanks suomi On rare occasions I have had to manually mess around with the mail files, ie using an editor to remove a corrupt message messing up pop3. There is one file per user mailbox. One complication I just realized is that I believe the actual user account login information may change, the new server will be running ISPConfig, and I'm not sure how it handles the email account naming. I'll have to check. hopefully the mailbox format has not changed. I'm guessing it probably hasn't. Cla. On 9/12/2011 12:02 PM, postfix wrote: Hi Clarence we deliver mail into Maildir i.e. one file per mail. The maildirs are usually under /var/spool/maildir. If I have to copy all of the mail to a new server, i just do rsync -avure ssh /old/maildir/* new_server:/new/maildir and no problem. suomi On 2011-09-12 16:50, Clarence Brown wrote: Hi all: I've tried googling, and found a ton of stuff, but nothing specific to my question. I've got an ancient postfix server with a couple virtual domains, been chugging along solid and stable for years. Want to move to a new server at a different IP, Have the old server forward / transfer any mail collected in it's mail boxes to the new server, and not have the users have to make any changes to their email clients or loose any email. Is there any way to tell the OLD Postfix to grab a user's mail box and forward all the messages in it to that user at the NEW Postfix? I'm concerned that if a user last checked email Friday afternoon at 4:00, and I do the switch over say Saturday Night, any email collected in the interim will be stuck on the old server without manual intervention. Thanks Cla. -- Clarence Brown Granite Ventures, Inc. 443-668-7326
Re: Switch to new server and forward existing mail from old server
On Mon, Sep 12, 2011 at 12:38 PM, Clarence Brown clabrown...@gmail.com wrote: On rare occasions I have had to manually mess around with the mail files, ie using an editor to remove a corrupt message messing up pop3. There is one file per user mailbox. [ ya, no longer on topic for postfix... ] Just be sure that the message store is using the same file types: http://en.wikipedia.org/wiki/MH_Message_Handling_System http://en.wikipedia.org/wiki/Mbox http://en.wikipedia.org/wiki/Maildir
Postfix Question: strange issue with mx record lookup
I have a bit of an odd problem and hoped you might be able to offer some assistance or point me in the right direction. Yesterday, my server was unable to send emails to 3M (u...@mmm.com). The logs shows: status=deferred (delivery temporarily suspended: connect to mmm.com[192.28.34.26] When I did a lookup of mmm.com it resolves to 192.28.34.26, however, the MX record for 3M shows: Authoritative answers can be found from: mmm.com nameserver = pigseye.mmm.com. mmm.com nameserver = ns.3m.com. 3m.com.inbound15.mxlogic.netinternet address = 208.65.144.12 3m.com.inbound15.mxlogic.netinternet address = 208.65.144.13 3m.com.inbound15.mxlogic.netinternet address = 208.65.145.12 3m.com.inbound15.mxlogic.netinternet address = 208.65.145.13 3m.com.inbound15.mxlogicmx.net internet address = 208.65.144.13 3m.com.inbound15.mxlogicmx.net internet address = 208.65.145.12 3m.com.inbound15.mxlogicmx.net internet address = 208.65.144.12 Does anyone know why/how Postfix would be getting the response of 192.28.34.26 instead of one of the above mail server IP addresses? Is this on part of my server or to do with the DNS configuration of 3M? The fix I have in place was to put 208.65.144.12 mmm.com in my /etc/hosts file. Thank you in advance for any assistance. Regards, -Andreas Andreas Freyvogel ecmarket Customer Solutions Manager E: afreyvo...@ecmarket.com P: 604.638.2300 x147 C: 604.603.3319
Re: Postfix Question: strange issue with mx record lookup
Am 12.09.2011 20:31, schrieb Andreas Freyvogel: I have a bit of an odd problem and hoped you might be able to offer some assistance or point me in the right direction. Yesterday, my server was unable to send emails to 3M (u...@mmm.com). The logs shows: status=deferred (delivery temporarily suspended: connect to mmm.com[192.28.34.26] When I did a lookup of mmm.com it resolves to 192.28.34.26, however, the MX record for 3M shows: Authoritative answers can be found from: mmm.com nameserver = pigseye.mmm.com. mmm.com nameserver = ns.3m.com. 3m.com.inbound15.mxlogic.netinternet address = 208.65.144.12 3m.com.inbound15.mxlogic.netinternet address = 208.65.144.13 3m.com.inbound15.mxlogic.netinternet address = 208.65.145.12 3m.com.inbound15.mxlogic.netinternet address = 208.65.145.13 3m.com.inbound15.mxlogicmx.net internet address = 208.65.144.13 3m.com.inbound15.mxlogicmx.net internet address = 208.65.145.12 3m.com.inbound15.mxlogicmx.net internet address = 208.65.144.12 Does anyone know why/how Postfix would be getting the response of 192.28.34.26 instead of one of the above mail server IP addresses? Is this on part of my server or to do with the DNS configuration of 3M? The fix I have in place was to put 208.65.144.12 mmm.com in my /etc/hosts file. i guess this was a temporary dns-problem where postfix did a fall back to the a-record ;; ANSWER SECTION: mmm.com.86400 IN A 192.28.34.26 should normally not be a problem because deferred means it would try again later signature.asc Description: OpenPGP digital signature
RE: Postfix Question: strange issue with mx record lookup
The email address to which we are sending is u...@mmm.com. Output of my postconf -n: alias_database = hash:/etc/postfix/aliases alias_maps = hash:/etc/postfix/aliases body_checks = regexp:/etc/postfix/body_checks command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix debug_peer_level = 1 default_destination_concurrency_limit = 10 default_privs = nobody header_checks = regexp:/etc/postfix/header_checks html_directory = no inet_interfaces = all local_destination_concurrency_limit = 2 mail_owner = postfix mailbox_command = /usr/bin/procmail mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, $mydomain, /etc/postfix/domains mydomain = ecmarket.com myhostname = ecmailer2.ecmarket.com mynetworks = /etc/postfix/relay-domains myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix notify_classes = delay, resource, software queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES relay_domains = $mydestination, /etc/postfix/relay-domains sample_directory = /usr/share/doc/postfix-2.2.10/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_enforce_tls = no smtp_tls_loglevel = 2 smtp_use_tls = yes smtpd_client_restrictions = permit_mynetworks, check_client_access hash:/etc/postfix/access_clientip, reject_non_fqdn_hostname, reject_invalid_hostname smtpd_helo_required = yes smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/access, reject_non_fqdn_sender,reject_rbl_client bl.spamcop.net smtpd_tls_CApath = /etc/postfix/CERTS smtpd_tls_cert_file = /etc/postfix/wildcard.conexiom.net-2011.cer smtpd_tls_key_file = /etc/postfix/wildcardKey-nopass.pem smtpd_tls_loglevel = 2 smtpd_tls_received_header = yes smtpd_tls_security_level = may smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 450 Thank you, -Andreas -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Wietse Venema Sent: Monday, September 12, 2011 12:07 PM To: Postfix users Subject: Re: Postfix Question: strange issue with mx record lookup Andreas Freyvogel: I have a bit of an odd problem and hoped you might be able to offer some assistance or point me in the right direction. Yesterday, my server was unable to send emails to 3M (u...@mmm.com). The logs shows: status=deferred (delivery temporarily suspended: connect to mmm.com[192.28.34.26] mmm.com is not an MX host for 3M.com. I therefore suspect that you have a non-default configuration that forces Postfix to look up MMM.com instead of 3M.com. This would be a good time to provide postconf -n command output. Wietse
Re: Postfix Question: strange issue with mx record lookup
Am 12.09.2011 21:11, schrieb Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Output of my postconf -n: readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES relay_domains = $mydestination, /etc/postfix/relay-domains sample_directory = /usr/share/doc/postfix-2.2.10/samples are you really using postfix 2.2.10? this is totally outdated and you probably hit a bug which was years ago a topic signature.asc Description: OpenPGP digital signature
RE: Postfix Question: strange issue with mx record lookup
Yes, the version is older and needs to be updated. I am running Fedora Core release 6 (Zod). -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Reindl Harald Sent: Monday, September 12, 2011 12:18 PM To: postfix-users@postfix.org Subject: Re: Postfix Question: strange issue with mx record lookup Am 12.09.2011 21:11, schrieb Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Output of my postconf -n: readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES relay_domains = $mydestination, /etc/postfix/relay-domains sample_directory = /usr/share/doc/postfix-2.2.10/samples are you really using postfix 2.2.10? this is totally outdated and you probably hit a bug which was years ago a topic
Re: Postfix Question: strange issue with mx record lookup
this are EIGHT releases behind the last supported F14 and 5 years ago - normally i would expect that someone updates to supported versions of software before try to solve problems with since years not supported versions Am 12.09.2011 21:22, schrieb Andreas Freyvogel: Yes, the version is older and needs to be updated. I am running Fedora Core release 6 (Zod). -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Reindl Harald Sent: Monday, September 12, 2011 12:18 PM To: postfix-users@postfix.org Subject: Re: Postfix Question: strange issue with mx record lookup Am 12.09.2011 21:11, schrieb Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Output of my postconf -n: readme_directory = /usr/share/doc/postfix-2.2.10/README_FILES relay_domains = $mydestination, /etc/postfix/relay-domains sample_directory = /usr/share/doc/postfix-2.2.10/samples are you really using postfix 2.2.10? this is totally outdated and you probably hit a bug which was years ago a topic -- Mit besten Grüßen, Reindl Harald the lounge interactive design GmbH A-1060 Vienna, Hofmühlgasse 17 CTO / software-development / cms-solutions p: +43 (1) 595 3999 33, m: +43 (676) 40 221 40 icq: 154546673, http://www.thelounge.net/ http://www.thelounge.net/signature.asc.what.htm signature.asc Description: OpenPGP digital signature
Re: Postfix Question: strange issue with mx record lookup
Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Postfix will send to the A record for mmm.com if MX lookup is disabled, or if MX lookup results in a not found response (either NXDOMAIN or NODATA). Postfix does not send to the A record if MX fails due to any other error such as timeout or server failure. If your MX lookups by hand succeed and Postfix still sends to the /etc/hosts address, then something is broken at your end. Perhaps you have an outdated (or missing) etc/resolv.conf file in the Postfix queue. With a missing etc/resolv.conf file, some resolvers will contact the DNS server on 127.0.0.1. And with an outdated etc/resolv.conf, anything could happen. Wietse
Re: Postfix Question: strange issue with mx record lookup
Reindl Harald: this are EIGHT releases behind the last supported F14 and 5 years ago - normally i would expect that someone updates to supported versions of software before try to solve problems with since years not supported versions The DNS lookup code has not changed. Looking up an MX record is not rocket science. Wietse
RE: Postfix Question: strange issue with mx record lookup
Am I to understand that Postfix will first try to lookup the MX record via DNS and if should that fail it will use the value configured in the /etc/hosts file? -Andreas -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Wietse Venema Sent: Monday, September 12, 2011 12:36 PM To: Postfix users Subject: Re: Postfix Question: strange issue with mx record lookup Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Postfix will send to the A record for mmm.com if MX lookup is disabled, or if MX lookup results in a not found response (either NXDOMAIN or NODATA). Postfix does not send to the A record if MX fails due to any other error such as timeout or server failure. If your MX lookups by hand succeed and Postfix still sends to the /etc/hosts address, then something is broken at your end. Perhaps you have an outdated (or missing) etc/resolv.conf file in the Postfix queue. With a missing etc/resolv.conf file, some resolvers will contact the DNS server on 127.0.0.1. And with an outdated etc/resolv.conf, anything could happen. Wietse
Re: Postfix Question: strange issue with mx record lookup
Andreas Freyvogel: Am I to understand that Postfix will first try to lookup the MX record via DNS and if should that fail it will use the value configured in the /etc/hosts file? No. Assuming that DNS lookups are enabled, and that there are no overrides with transport_maps or otherwise: 1) Postfix looks up the MX record. 2) If the result is one or more MX records, Postfix will try to deliver to the named hosts. 3) If the result is NXDOMAIN or NODATA then Postfix looks up the up the IP address. 4) Otherwise the result is an error (timeout, SERVFAIL, malformed reply, whatever). Postfix defers delivery or bounces the message, depending on error details. 5) Postfix can be configured (with smtp_host_lookup) to look the IP address in local databases besides DNS. But this is not the default in Postfix source code from postfix.org mirrors. In your case, apparently either DNS lookup was disabled, or the MX lookup resulted in an NXDOMAIN or NODATA response (i.e. some DNS server was confused or mis-configured and wrong information got cached in a local DNS server so Postfix kept banging into the wall). Wietse -Original Message- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Wietse Venema Sent: Monday, September 12, 2011 12:36 PM To: Postfix users Subject: Re: Postfix Question: strange issue with mx record lookup Andreas Freyvogel: The email address to which we are sending is u...@mmm.com. Postfix will send to the A record for mmm.com if MX lookup is disabled, or if MX lookup results in a not found response (either NXDOMAIN or NODATA). Postfix does not send to the A record if MX fails due to any other error such as timeout or server failure. If your MX lookups by hand succeed and Postfix still sends to the /etc/hosts address, then something is broken at your end. Perhaps you have an outdated (or missing) etc/resolv.conf file in the Postfix queue. With a missing etc/resolv.conf file, some resolvers will contact the DNS server on 127.0.0.1. And with an outdated etc/resolv.conf, anything could happen. Wietse
Re: Disclaimer with always_bcc and config problems
On 2011-09-12 06:21, Alex wrote: Hi, I'm trying to configure a disclaimer footer using altermime with postfix-2.7.5, amavisd-new-2.6.4. I've tried to follow the examples for creating a new filter, but the messages appear to be being reinjected at the wrong spot and are being delivered multiple times to the always_bcc recipient. I thought I could outline my current config, and someone could help me to find what I'm missing. I have about twenty virtual domains, but it would be okay to use the same disclaimer footer text for each domain. I'd also like to be sure SASL authenticated clients are permitted as well. I'm not sure this configuration will only work with my domains, and only on outbound mail. How is this controlled? By limiting the scope of the setting to one or more individual daemons. Settings in main.cf affect all instances of any particular daemon. If you need this controlled per domain, either use a recipient access map with a FILTER action to select among multiple filters, or take care of the domain in the content_filter. For 20 domains, adding 20 filters is probably not the easiest solution. Just parse the domain part in your content_filter and act appropriately. smtp inet n - n - - smtpd -o receive_override_options=no_address_mappings -o content_filter=filter:dummy I would suggest not naming an actual filter something as generic as filter - use footer instead, in this case. Also, smtP(8) does not receive mail, so this is not the correct place to apply these settings - they achieve nothing. submission inet n - n - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o receive_override_options=no_address_mappings -o content_filter=filter:dummy They do here, since submission is an smtpD(8) listener. The intended recipient receives a copy of the message, but the always_bcc user receives the message multiple times. Yes; always_bcc is invoked on receiving mail. If you re-inject mail (as you must after it is passed off to a content_filter), it is received for the second time. Everything in main.cf is applied anew, including always_bcc. The re-injection listener (which should NOT be the same daemon as your normal smtpd(8) listener!) should not apply always_bcc, so set your receive_override_options there. You should also be very, very careful about bouncing mail to your always_bcc address - consider what the result is. In practical terms, the recipient in always_bcc should never bounce, or you will have problems. -- J.
Re: Disclaimer with always_bcc and config problems
Le 13/09/2011 00:04, Jeroen Geilman a écrit : On 2011-09-12 06:21, Alex wrote: Hi, I'm trying to configure a disclaimer footer using altermime with postfix-2.7.5, amavisd-new-2.6.4. I've tried to follow the examples for creating a new filter, but the messages appear to be being reinjected at the wrong spot and are being delivered multiple times to the always_bcc recipient. I thought I could outline my current config, and someone could help me to find what I'm missing. I have about twenty virtual domains, but it would be okay to use the same disclaimer footer text for each domain. I'd also like to be sure SASL authenticated clients are permitted as well. I'm not sure this configuration will only work with my domains, and only on outbound mail. How is this controlled? By limiting the scope of the setting to one or more individual daemons. Settings in main.cf affect all instances of any particular daemon. If you need this controlled per domain, either use a recipient access map with a FILTER action to select among multiple filters, or take care of the domain in the content_filter. For 20 domains, adding 20 filters is probably not the easiest solution. Just parse the domain part in your content_filter and act appropriately. smtp inet n - n - - smtpd -o receive_override_options=no_address_mappings -o content_filter=filter:dummy I would suggest not naming an actual filter something as generic as filter - use footer instead, in this case. Also, smtP(8) does not receive mail, so this is not the correct place to apply these settings - they achieve nothing. the above is an smtpD. see end of line. the smtp at start of line is the name of the service to be found in /etc/services, ie: smtp=25. submission inet n - n - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o receive_override_options=no_address_mappings -o content_filter=filter:dummy They do here, since submission is an smtpD(8) listener. It is also an smtpD, but not because it's named submission. it is an smtpd as indicated by the last token in the line. again, submission simply means use the port in /etc/services that corresponds to submission. The intended recipient receives a copy of the message, but the always_bcc user receives the message multiple times. Yes; always_bcc is invoked on receiving mail. If you re-inject mail (as you must after it is passed off to a content_filter), it is received for the second time. Everything in main.cf is applied anew, including always_bcc. The re-injection listener (which should NOT be the same daemon as your normal smtpd(8) listener!) should not apply always_bcc, so set your receive_override_options there. You should also be very, very careful about bouncing mail to your always_bcc address - consider what the result is. In practical terms, the recipient in always_bcc should never bounce, or you will have problems.
Re: Disclaimer with always_bcc and config problems
Le 12/09/2011 06:21, Alex a écrit : Hi, I'm trying to configure a disclaimer footer using altermime with postfix-2.7.5, amavisd-new-2.6.4. I've tried to follow the examples for creating a new filter, but the messages appear to be being reinjected at the wrong spot and are being delivered multiple times to the always_bcc recipient. I thought I could outline my current config, and someone could help me to find what I'm missing. I have about twenty virtual domains, but it would be okay to use the same disclaimer footer text for each domain. I'd also like to be sure SASL authenticated clients are permitted as well. I'm not sure this configuration will only work with my domains, and only on outbound mail. How is this controlled? smtp inet n - n - - smtpd -o receive_override_options=no_address_mappings -o content_filter=filter:dummy submission inet n - n - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o receive_override_options=no_address_mappings -o content_filter=filter:dummy filter unix - n n - - pipe flags=Rq user=filter argv=/etc/postfix/disclaimer.sh -f ${sender} -- ${recipient} The 'filter' users exists, and disclaimer.sh contains the actual altermime command: #!/bin/sh INSPECT_DIR=/tmp SENDMAIL=/usr/sbin/sendmail # Exit codes from sysexits.h EX_TEMPFAIL=75 EX_UNAVAILABLE=69 # Clean up when done or when aborting. trap rm -f in.$$ 0 1 2 3 15 # Start processing. cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; } cat in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; } # obtain From address from_address=`grep -m 1 From: in.$$ | cut -d -f 2 | cut -d -f 1` /usr/bin/altermime --input=in.$$ \ --disclaimer=/etc/postfix/disclaimer.txt \ --disclaimer-html=/etc/postfix/disclaimer.txt \ --xheader=X-Copyrighted-Material: Please visit http://www.mydomain.com/privacy.htm; || \ { echo Message content rejected; exit $EX_UNAVAILABLE; } $SENDMAIL $@ in.$$ exit $? The intended recipient receives a copy of the message, but the always_bcc user receives the message multiple times. you didn't show the long awaited evidence: logs, logs, ... in the absence of evidence, let's call crystal ball mamma. I guess you tested this by sending mail using the sendmail command? if so, your settings in smtp and submission are useless, since sendmail uses pickup. and no, there is only one pickup per instance, you can't simply disable address rewrite. some choices: - ignore the sendmail case, if you don't care about sendmail mail - in your altermime script, resubmit mail using smtp instead of sendmail - use multiple postfix instances (taht is: run postfix multiple times, each with its own config dir, data dir, queue dir, ... etc). in this case, you can specify the instance for the sendmail command.