procmail; recipe help; returning notification on overly large emails
Ok, here's the scoop. Our mail server is older and doesn't handle large file attaches well. We're working on replacing it, but it will take some time... anyway, in the mean time, we're basically rejecting any emails over 5meg (which roughly translates to about 7meg after uuencoding).
Here is the procmail recipe: Code:
:0 However, the procmail log file records an error, saying that there was an error writing to the given sendmail command: Code:
For: realusername Anyone have any ideas? Also, is there a way to make sendmail reject files over a certain size, while also returning an error email to the sender? That would save me some processing time. I'd appreciate any help! |
Ok, so there are no procmail recipe nerds here, eh? That's ok.. I ended up asking this question on the procmail mailing list, and received very adequate answers. Here is what was learned:
Code:
:0 c: toolarge.lock Why: The email is never sent to a file nor mailbox. No need to lock anything. Issue #2: The carbon copy is unecessary. Why: Once the email is sent to sendmail/formail, the rule does not need to send the email to /dev/null, because it's already been dealt with. This will only produce wasted processing time. Issue #3: The 'h' header-only flag is needed. Why: Without it, the entire email, header and body, are being sent to formail, causing a delay as the emails-in-question are over 5meg in size. Formail only handles the header, and stops accepting input once the header receipt is complete. Procmail then sees that the entire email was not read, and triggers an error. This is why I was getting an error in my log file. Final line should be: Code:
:0 h Code:
| (/usr/bin/formail -r -A "X-Loop: ourdomain.com"; \ Why: The build-in path's will locate the binary. It doesn't hurt to have it, but it is not necessary. Issue #2: $SENDMAIL is missing $SENDMAILFLAGS. Why: Honestly, I don't know how necessary this is. (= Final line should be: Code:
| (formail -r -A "X-Loop: ourdomain.com"; \ And finally: Code:
Why: Race conditions cannot exist on a device that cannot return anything. Issue #2: Whole rule is unnecessary. Why: Without the 'c' carbon-copy flag, this rule is no needed. Delete it. In the end, we end up looking like this: Code:
:0 |
Hi
Just read your post i'm trying to do the exact same thing using sendmail. I was just wondering if you ever found out how to do this with sendmail ?? |
All times are GMT -5. The time now is 07:44 PM. |