[1.39.1] Limiting autoresponder replies to "x per y" or simply once per sender?

Christopher

Verified User
Joined
Mar 28, 2008
Messages
7
[1.39.1] Limiting autoresponder replies to "x per y" or simply once per sender?

Is there any practicable way to limit autoresponder replies to a sender at "x per y" (e.g., once per day, twice per month) irrespective of the number of emails received from a sender? Alternatively how about a simple "send once only per sender" option?

Been unable to find anything on the DA forums about this but it's a fairly important feature for business users using the feature for OoO/vacation messages. I hate pissing off senders with multiple autoresponders, especially if it's someone who's being CCed into ongoing business discussions whilst they're on holiday, perhaps with sporadic access via (audit trails critical in business).

NB: I'm not an Exim expert, although I can wrangle confs and I've already read threads like this (relating to vanilla Exim). However as DA is handling the sending of autoresponses I don't want to muck about too much with underlying application settings. Any pointers appreciated, I think I've R all of the relevant sections of TFM. :)
 
Hire someone to make the changes for you. It is not something included or thats going to be included with directadmin unless someone finds out how to code it correctly and it is patched to exim config.
 
Ah, that's a shame. I work for a nonprofit co-operative with two employees, we can't even afford a dedicated server, never mind employ someone to fork the codebase. It's a shame this feature couldn't be implemented, it's one of the few things DA's missing from its email featureset that would be genuinely useful to lots of people.
 
@Christopher,

You've already written that you don't run your own Dedicated Server. Do you run your own DirectAdmin VPS? If not, then all you can do is work with your hosting company, but even so, this post should be useful for you, for your provider, and for the community.

@All:

Please let me start by pointing out that I believe the autoresponder and the vacation responder should be handled differently. People who send email to an autoresponder should expect and get the same thing every time. At least in my opinion. And people who write to someone who's set a vacation responder should get it no more often than once any specific period of time. Again at least in my opinion.

Why is my opinion important? Because although DirectAdmin staff wrote the first exim.conf file used by DirectAdmin, I've been maintaining it and rewriting it from time to time ever since. DirectAdmin (the company) has been distributing a version of my Version 2; (their version is marked Version 2.1.1) for some time now, but with some changes they've made over the years. I don't know if they've ever changed their version number from the one they got from me, but I do know their code for their Version 2.1.1 differs slightly from mine. And even more so from my current Version 4.1, which is actually a complete rewrite (though some of the DirectAdmin-specific code continues to be substantially the same as the code originally written by DirectAdmin staff).

Version 4.1 is better in several ways than Version 2.1.1, and I do not recommend that anyone using Version 4.1 should downgrade.

Both autoresponders and vacation responders are handled the same way in both files, but there are specific differences in how they're handled between Version 2.1.1 and Version 4.1.

Version 2.1.1
Code:
  #once re-added May 16, 2008:
  once = /etc/virtual/${domain}/reply/${local_part}.once
  once_file_size = 100K
  once_repeat = 2d
This code implements substantially what you're looking for. It will send the automatic reply to the same sender only once every two days. It was originally written by DirectAdmin staff, and I haven't exhaustively studied it. It's included both in the Autoresponder and Vacation Responder transports.

If you're not seeing this behavior it's likely your server is using one of my newer exim.conf files.
Version 4.1
Code:
#once = /etc/virtual/${domain}/reply/${local_part}.once
As you can see, my newest code has only a small part of the code to implement limiting the responder, and even that is commented out.

I'm going to update my exim.conf file within the next few weeks (but unfortunately not before the end of this month), and when I do I'll include the limiting code only in the vacation responder but not in the autoresponder.

If anyone needs this functionality before then, they can make the change themslves; be sure to test, though.

Note that this implementation is serverwide, not either domainwide, or address specific. While those features can certainly be added, it would likely be up to DirectAdmin staff to make changes to maintain required file(s) before exim.conf could make decisions based on them.

However:
During the study I made before writing this reply I noticed what I consider a bug in how the vacation responder works. I didn't test the auto responder but it may have some of the same problems...

Note this code:
Code:
 subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {I am on vacation}}"
How do you expect this to work? Would you expect it to use the subject I am on vacation in the reply to the sender? If not you might be disappointed.

The subject line I am on vacation only appears if the email sent to the vacation responder has no subject line (which of course is usually not true). I'm going to bring this to the attention of DirectAdmin staff, and I'd like the fix, whether written by me or by DirectAdmin staff, to include a vacation message either by prepending something to the subject or by putting it into the actual body of the email.

Anyone else want to see anything else?

Jeff
 
Hello Jeff, many thanks for another awesome reply. (Silently learnt a lot of things from your previous contributions to these forums.) Also noted that your comments and additions were all over the DA exim.conf when I was first had to dip into the exim conf (don't worry, I left it as I arrived ;)).

Luckily I do administer the VPS our sites are hosted on and I have root access to the VPS, so I can effect changes. The poor thing is buckling under the strain though, I've had to hard restart the image more times than I'd like. (excessive disk I/O is the root cause I think)... But I digress - I can modify confs, I just didn't want to dive in to files I understand are critically important to functionality without even knowing if the features are already there, but commented.

I concur with you on the handling of autoresponder vs. OoO; for vacations once is enough, autoresponders should deliberately send email every time. (Is there an anti-flood trigger in case someone decides to flood an autoresponder inbox?)

Great to hear you're already planning to implement the rate limiting for vacation responders, it's much appreciated indeed. Thanks on behalf of the community for continuing to improve things for all of us. :) And thanks also for your very technical replies, it means people like me can actually learn as they implement instead of simply following "add x code to y section" without an explanation as to purpose. Slowly climbing the learning curve.

Will your exim.conf be an optional download after I upgrade our VPS to DirectAdmin 1.40? I was contemplating updating it during the small hours on Saturday but I'll hold off if your updates are going to be rolled into the DA autoupdate.
 
I'm sorry if I wasn't clear enough. The code from DirectAdmin works as it should. My code doesn't. Which version of exim.conf are you running?

Version 4.x is not scheduled for inclusion in DirectAdmin. You'll need to do it yourself or hire someone (me?) to do it, once the fixes are ready. See my information page, here (nobaloney.net).

Jeff
 
I'm sorry if I wasn't clear enough. The code from DirectAdmin works as it should. My code doesn't. Which version of exim.conf are you running?

Version 4.x is not scheduled for inclusion in DirectAdmin. You'll need to do it yourself or hire someone (me?) to do it, once the fixes are ready. See my information page, here (nobaloney.net).

Jeff

Don't worry, all received and understood! I can likely implement the mods ok myself after some careful examination of changes, our hosting provider's very clueful and always gives me a hand when I'm not sure what I'm doing. And I always backup original files. ;)
 
Jeff, should i suggest the ability to use a custom object in vacation autoreply? Not sure if is fixed (apparently ive understood that way) and should be nice if user who set the autoresponder can choose an object (example different language or different reason, holiday/vacations/whatever), should be that hard to implement? If yes, dont take consideraiton of my post, just an hint that maybe should be useful as not.

Regards and, as usual, thanks for your work.

PS. There is a maling list for get updated for your exim.conf releases?

Regards
 
All the examples i've seen include text hardcoded into files or into exim.conf itself. If you can find all the required information (see the hardcoded exim.conf text for the vacation responder for example), and if it's not too hard to implement, I might be willing to consider it, but if you remember, when I first started exim.conf changes, I pointed out that I was scratching my own itch; doing stuff I needed :).

Jeff
 
Yes i know, in fact, mine was just a suggestion if wanst too hard, ill check if i find something about that, but, assuming your are more expert than me on exim.conf and you always saw hardcoded text i suppose there is no other way... if i find some time to search for it, ill let you know and you will decide if implement or not :)

Regards
 
Actually this is just an idea reading the exim.conf and should be totally wrong, but... something like this?

Code:
#EDIT#58:
uservacation:
  driver = autoreply
  file = /etc/virtual/${domain}/reply/${local_part}.msg
  from = "${local_part}@${domain}"
  log = /etc/virtual/${domain}/reply/${local_part}.log
  reply_subject =  ${if exists{/etc/virtual/${domain}/reply/${local_part}.subject}}
  no_return_message
  subject = "${if def:h_Subject: {Autoreply: ${quote:${escape:$h_Subject:}}} {$reply_subject}}"

Not sure about the code, but the idea should be save in same folder of vacation message body the subject in .subject file and "cat" it in a variable and use that variable in the subject line.

Is that too wrong?

Regards
 
It appears your code will not change the subject if it exists, but will add a custom subject if one doesn't exist, and not put in any message body at all. Is this what you want to do? Or do you believe the code will do something else?

Jeff
 
Well actually i didnt notice the "Autoreply" but my idea was to save the custom subject in a file and, if that file exist (if user have put a custom subject in the form), take that as mail subject

As i sayd, was just an opinion, nothing that important actually :)

Regards
 
While that could allow for a custom subject, I'm not sure a custom subject is as good as maintaining the standard subject with the Autoreply indicator.

I'd rather leave the subject alone if it exists, and replace it if it doesn't, which is exactly what it's doing now. The message is already set by the user. If you'd like to see the stock part of the message in a different language, I believe you can change that yourself directly in your exim.conf file.

As far as customizing the stock part of the message, changing the language based on either the sender or the sender's domain, personally I think that would be a bit complex and for me not worth doing. One language per server would suffice for me.

Jeff
 
Mmmh you mean that now user can choose the email subject when create auto-reply? If yes so thats my fault, the skin i use doenst ask for email subject when creating an autoreply :)

I wasnt talkin about language but about email subject itself, like.. if a user doenst set anything so the subject stay in Autoreply, otherwise, the email subject is the one user-defined.

Maybe im not explaining well what i mean... im sorry for that

Regards
 
Sorry, but it looks as if I'm still being confusing.

Currently a custom subject cannot be defined through the control panel. You can define either the subject prefix, or the entire subject if the sender didn't use one.

For example, if the sender sends a message with the subject , hi how are you currently the autoresponder and the vacation reply will both use Autoreply: hi how are you. That's what happens most of the time; most people send emails with subjects. You can change the prefix word to anything you want; it's a simple change in exim.conf. You can change the whole line, too; that's not so simple, and you can learn it yourself :).

When people don't send any subject, then the vacation reply will send Autoreply: I am on vacation and the autoresponder will send Autoreply message. You can change those as well, but only on a perserver basis, and only manually through changes to exim.conf.

If you want to be able to make this sort of change through the control panel, then it will require both changes to DirectAdmin and to exim.conf. If that's what you want, then create a new Feature Request, and reply here that I should close this thread.

Thanks.

Jeff
 
Ok Jeff, now i got what you was meaning :) yes, a customization like what you sayd should be a FR :)

Thanks for clarification and sorry for confusion :)

Ill send this link to DA staff as FR cause i should be confusing John too :)
 
With exim, all of the checks and conditions are going to be part of the set variable itself.

This is going to be somewhat pseudo code (best guess), but something like:
Code:
subject = "${if \
		exists{/etc/virtual/${domain}/reply/${local_part}.subject} \
		{ \
			${readfile{/etc/virtual/${domain}/reply/${local_part}.subject}{\ }} \
		} \
		{ \
			${if \
				def:h_Subject: \
				{Autoreply: ${quote:${escape:$h_Subject:}}} \
				{I am on vacation} \
			} \
		} \
	}"
which hasn't been tested or proven, but may be what you're looking for. Tried to make it as "clean" as possible with newline breaks ( \), in case changes are needed.

John
 
So for test it need to create just the subject file and an autoresponder?

Regards and thanks

PS. if this work should be done as default in new da install with needed skins edit?
 
Correct, just add the subject file after creating the autoresponder.
If it works, we can consider making it part of the skins.

John
 
Back
Top