Be careful if you forward email to a gmail account. Gmail doesn’t like receiving mail delivery status notices or reports. This server filled up overnight with tens of thousands of email reports bouncing back and forth between it and gmail. If you emailed me in the last 24 hours and I haven’t replied, I may not have received it (yet).
postfix/cleanup: 9FE58326C1: reject: header Content-Type: multipart/report; report-type=delivery-status;??boundary=”A507733AD3.1188834275/mail.ocaoimh.ie” from local; from=<donncha_@_ocaoimh.ie> to=<firstname.lastname@example.org>: no third-party DSNs
I really haven’t had any luck with email recently …
How I fixed everything
- First of all I disabled the forward to my gmail accounts by moving .procmailrc out of the way.
- Then I deleted a lot of log files to make more breathing space for everything and watched the mail spool into my mail file.
- That was taking too long so I shutdown Postfix and went into /var/spool/postfix/ and into the active, incoming and maildrop folders where I moved every file with the string “Undelivered Mail Returned to Sender” out of the way:
for i in `grep "Undelivered Mail Returned to Sender" * -rl`; do mv $i /tmp/xxx/ -vi; done
- After restoring the .procmailrc, I restarted Postfix and lots of legitimate email started flowing again!
- I added the following recipe to my .procmailrc which I hope will stop bounced messages getting to Google:
* ^Subject: Undelivered Mail Returned to Sender
What caused the problem in the first place? A bounced email from Yahoo. Someone left a comment with a fake email address, subscribed to the post and when another comment was left on that post the subscription email bounced. It’s worked before fine so I’m not sure why Google are complaining now! Over 2GB of bounced mail. My poor server.
Update! It happened again but I stopped Postfix at 9.5MB free on the filesystem and this time I found out what went wrong. I implemented these Postfix rules Justin blogged about without running Spamassassin. Well, I used to run SA but then when I started using Gmail I stopped, which is probably why I didn’t see this earlier. Not Justin’s fault, my own for playing with fire!
6 thoughts on “gmail: no third-party DSNs”
Things are just so much better when you run your own server
Yes, the joys of being an admin!
Good recovery there, but the Procmail rule for catching DSNs is likely to match some (not all contain that subject).
Use the following instead:
Procmail should substitute the FROM_DAEMON for a very long and hairy regexp which should catch just about every variety of DSN there is.
In case you want to see something which at first glance looks like line noise, here’s the scary regexp:
(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To: Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)? |daemon|m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps) |r(e(quest|sponse)|oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er) |mtp(error)?|ystem)|A(dmin(istrator)?|MMGR|utoanswer))(([^).!:a-
(That’s straight from the man page of Procmail)
Thanks David, I’ve added that first rule in and I’ll keep an eye on that text file. Hopefully it’ll work fine!
A number of emails were trapped, but they were all legitimate emails. I’ll have to give the second rule a whirl and see how that goes.
I use Gmail to back up my business emails. I have an forwarder on my hosting that forwards all incoming emails to a Gmail account and in Thunderbird I have it set to send a copy of all outgoing emails to the same account.
I can’t believe how often I use the Gmail search facility to find stuff I’ve lost, usually receipts and passwords.