How do I get the uucp node name passed to postfix when the mail is sent ?
I have many client servers sending mails to us for relay. When any one client is compromised then the servers sends abnornmal number of mails , this is what I plan to monitor for.
> -- > Steve Kostecke <st...@kostecke.net> UUCP: ...!kostecke!stasis!steve > GPG/PGP Public Key at gopher://kostecke.net or `finger st...@kostecke.net`
On 2010-05-11, ram <ramprasad...@gmail.com> wrote:
> Hello, all
> We use uucp ( still !!!) for relaying mails for our clients.
> I want to implement a uucp ratelimit, so that I can limit how many > mails a particular node can send in an hour.
> Is there any implementation already , or will I have to hack the code > myself.
> Thanks > Ram
Hello, this is just a shot in the dark since I've only ever played with UUCP for a project I'm working on.
Are all the mails sent in a single batch file that is processed by rmail or in multiple files processed by rmail?
If there are huge batch files being sent Taylor uucp seems to have a way to limit the max size of a file sent to any given system.
I'm sure the problem isn't that simple though. If I were attacking the problem I would likely write a perl script that runs on the client's system that examines the UUCP spools for a large amount of queued mail requests and then can modify the UUCP config to not send (or do whatever you desire) and send you a mail notifying you of the problem over the UUCP link.
You could likely invoke this perl script in cron just like you do uucico but either leave execution of uucico to the perl script itself or have the regular execution of uucico handled by a shell script that first calls your custom perl script (or whatever language you decide to use)
I'm also assuming that your clients have a UNIX/Linux machine that queues up mail and sends it via UUCP I hope this helps since like I said before I've done very little with UUCP other than read a few books and a bit of tinkering around in my spare time.
I do know though that you can accomplish just about anything you want with creative scripting under any unix like system.
ram <ramprasad...@gmail.com> wrote: > On May 14, 8:36 pm, Steve Kostecke <st...@kostecke.net> wrote: > > On 2010-05-13, ram <ramprasad...@gmail.com> wrote:
> > > How do I get the uucp node name passed to postfix when the mail is > > > sent ?
> > If the clients are all running postfix at their sites as the SMTP/UUCP > > interface you may be able to add a custom header there.
> No I cannot control the sending servers MTA. > Also I have no reason to trust the sending servers headers
> Is there a way I can add the header after the mail has been recd. I am > ready to patch my uucico/rmail for this if required.
I know on my OpenBSD/Taylor's UUCP setup, uuxqt sets the environment variable UU_MACHINE with the remote node name. OpenBSD's rmail pass it to sendmail so it can use it in the Received header.
But I can't find a description of your setup. (Which unix-like? Commercial UUCP or Taylor's UUCP? Which MTA you currently use? Is your rmail from your OS or directly taken from your MTA sources?)
Like the rmail from Postfix is just a shell script. It be easy to call "formail" from procmail to add any header.
That OpenBSD's rmail trick is only found on OpenBSD and depends on the sendmail's -p switch which is ignored by Postifx's sendmail compatibility interface.
I have looked at that policyd thingie and I haven't figured how to use it for your requirement.
> ram <ramprasad...@gmail.com> wrote: > > On May 14, 8:36 pm, Steve Kostecke <st...@kostecke.net> wrote: > > > On 2010-05-13, ram <ramprasad...@gmail.com> wrote:
> > > > How do I get the uucp node name passed to postfix when the mail is > > > > sent ?
> > > If the clients are all running postfix at their sites as the SMTP/UUCP > > > interface you may be able to add a custom header there.
> > No I cannot control the sending servers MTA. > > Also I have no reason to trust the sending servers headers
> > Is there a way I can add the header after the mail has been recd. I am > > ready to patch my uucico/rmail for this if required.
> I know on my OpenBSD/Taylor's UUCP setup, uuxqt sets the environment > variable UU_MACHINE with the remote node name. OpenBSD's rmail pass it > to sendmail so it can use it in the Received header.
> But I can't find a description of your setup. (Which unix-like? > Commercial UUCP or Taylor's UUCP? Which MTA you currently use? Is your > rmail from your OS or directly taken from your MTA sources?)
> Like the rmail from Postfix is just a shell script. It be easy to call > "formail" from procmail to add any header.
> That OpenBSD's rmail trick is only found on OpenBSD and depends on the > sendmail's -p switch which is ignored by Postifx's sendmail > compatibility interface.
> I have looked at that policyd thingie and I haven't figured how to use > it for your requirement.