[plug] Re: How to send-to-all email clients

Top Page

Reply to this message
Author: Rosaldo Garcia
Date:  
To: plug
Subject: [plug] Re: How to send-to-all email clients
#!/usr/bin/perl -w
use strict;
use warnings;

my $reminder = "/root/scripts/perl/reminder.msg"; # create reminder.msg this
is the body of your mail
chomp $reminder;

my @passwdfile = `cat /etc/passwd `;
        foreach(@passwdfile){
                        s/:/ /go;
                        my @passwdfile = split;
                       system ("cat $reminder | mail -s SUBJECT OF MAIL' 
@passwdfile[0]\@domain.com");
                        }
----- Original Message ----- 
From: <plug-request@???>
To: <plug@???>
Sent: Friday, August 18, 2006 10:59 AM
Subject: PLUG Digest, Vol 17, Issue 53



> Send PLUG mailing list submissions to
> plug@???
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.hosting.qsr.com.ph/mailman/listinfo/plug
> or, via email, send a message with subject or body 'help' to
> plug-request@???
>
> You can reach the person managing the list at
> plug-owner@???
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PLUG digest..."
>
>
> Today's Topics:
>
>   1. Re: How to send-to-all email clients (Michael Tinsay)
>   2. Re: VPN design from a newbie's point of view (Michael Tinsay)
>   3. Re: VPN design from a newbie's point of view
>      (Federico Sevilla III)
>   4. Re: VPN design from a newbie's point of view
>      (Rafael 'Dido' Sevilla)
>   5. Re: How to send-to-all email clients (jopoy solano)
>   6. Re: How to know if the file writing is finish (Zak B. Elep)
>   7. Re: How to know if the file writing is finish (Rowel Atienza)
>   8. Re: How to know if the file writing is finish (ramfree17)

>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 18 Aug 2006 05:10:46 +0100 (BST)
> From: Michael Tinsay <tinsami1@???>
> Subject: Re: [plug] How to send-to-all email clients
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID: <20060818041046.915.qmail@???>
> Content-Type: text/plain; charset=iso-8859-1
>
>
> I'm using postfix and here's what I'm using. This
> works by sending mail to _All@???. Can be
> used for sending to all users or a group of users.
>
>
> In /etc/postfix/aliases, I have the entry:
>
> _All: "|/etc/postfix/mail2group 100"
>
> where 100 us the groupid for "users" of which all my
> email accounts are member of.
>
>
> Here's the mail2group script:
>
> #!/usr/bin/perl
>
> $ENV{"PATH"}="/bin:/usr/bin:/sbin:/usr/sbin";
>
> $group = $ARGV[0] + 0;
>
> open(IN, "< /etc/passwd") || die "can't open
> /etc/passwd";
> while (<IN>)
> {
>        chomp;
>        @usr = split(/:/, $_);
>        if ( $usr[3] == $group )
>        {
>                push(@ppl, $usr[0]);
>        }
> }
> close(IN);

>
> open(IN, "< /etc/group") || die "can't open
> /etc/group";
> while (<IN>)
> {
>        chomp;
>        @grp = split(/:/, $_);
>        if ( $grp[2] == $group )
>        {
>                push(@ppl, split(/, */, $grp[3]));
>        }
> }
> close(IN);

>
> exit if ( $#ppl <= 0);
>
> open(MAIL, "| /usr/sbin/sendmail " . join(" ", @ppl))
>        || die "can't run sendmail";
> while (<STDIN>)
> {
>        print MAIL $_;
> }
> close(MAIL);

>
>
>
>
>
>
> --- Leo Angelo Cordero <leoangelo.cordero@???>
> wrote:
>
>> i suggest that you create a mailing-list (e.g.
>> everyone@domain). medyo
>> matrabaho lng pag-input ng lahat ng clients..
>>
>>
>>
>> On 8/17/06, tikz chat <tikzchat@???> wrote:
>> >
>> > you can just create a script calling all the email
>> users and inserting the
>> > mail content to it. :P
>> >
>> >
>> >
>> > On 7/19/06, John Homer Alvero <
>> johnhomer@???> wrote:
>> > >
>> > > If you want you to send personalized mails, say
>> you want to include
>> > > data based on
>> > > values from a database table per email (think
>> tokens), you may want to
>> > > brew a
>> > > perl script to do this. I did mine using
>> Mail::QmailQueue.
>> > >
>> > > john
>> > >
>> > >
>> > >
>> > > On 7/19/06, seekuel < seekuel@???> wrote:
>> > > >
>> > > >
>> > > > hello,
>> > > >
>> > > > What if you'll make those clients a member of
>> your domain's mailing
>> > > lists. :)
>> > > >
>> > > >
>> > > >
>> > > > On 7/19/06, sp@rt@cus < rhcelinux@???>
>> wrote:
>> > > >
>> > > > >
>> > > >
>> > > >
>> > > > Hi guys,
>> > > > what is the best way to do this? Send an email
>> to all my clients, let
>> > > say informing some scheduled maintenance on the
>> server. I though of using
>> > > the alias file. Is there any other good ways to
>> do it? Im using postfix.
>> > > >
>> > > > thanks.
>> > > >
>> > > >
>> > > >
>> > > > ________________________________
>> > > Talk is cheap. Use Yahoo! Messenger to make
>> PC-to-Phone calls. Great
>> > > rates starting at 1¢/min.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> _________________________________________________
>> > > > Philippine Linux Users' Group (PLUG) Mailing
>> List
>> > > > plug@??? (#PLUG @
>> irc.free.net.ph)
>> > > > Read the Guidelines:
>> http://linux.org.ph/lists
>> > > > Searchable Archives:
>> http://archives.free.net.ph
>> > > >
>> > > >
>> > > >
>> > > >
>> _________________________________________________
>> > > > Philippine Linux Users' Group (PLUG) Mailing
>> List
>> > > > plug@??? (#PLUG @
>> irc.free.net.ph)
>> > > > Read the Guidelines: http://linux.org.ph/lists
>> > > > Searchable Archives:
>> http://archives.free.net.ph
>> > > >
>> > > >
>> > >
>> _________________________________________________
>> > > Philippine Linux Users' Group (PLUG) Mailing
>> List
>> > > plug@??? (#PLUG @
>> irc.free.net.ph)
>> > > Read the Guidelines: http://linux.org.ph/lists
>> > > Searchable Archives: http://archives.free.net.ph
>> > >
>> >
>> >
>> > _________________________________________________
>> > Philippine Linux Users' Group (PLUG) Mailing List
>> > plug@??? (#PLUG @ irc.free.net.ph)
>> > Read the Guidelines: http://linux.org.ph/lists
>> > Searchable Archives: http://archives.free.net.ph
>> >
>> >
>> > _________________________________________________
>> Philippine Linux Users' Group (PLUG) Mailing List
>> plug@??? (#PLUG @ irc.free.net.ph)
>> Read the Guidelines: http://linux.org.ph/lists
>> Searchable Archives: http://archives.free.net.ph
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 18 Aug 2006 05:30:33 +0100 (BST)
> From: Michael Tinsay <tinsami1@???>
> Subject: Re: [plug] VPN design from a newbie's point of view
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID: <20060818043033.7441.qmail@???>
> Content-Type: text/plain; charset=iso-8859-1
>
>
> --- Jun Martin <jun.martin@???> wrote:
>
>> More enlightenment, please. Can I subscribe to
>> PLDT's WeRoam with the
>> IPSec option even if the network I intend to access
>> outside is behind a
>> firewall with NAT?
>
> I have a WeRoam subscription and have tested and used
> openswan/ipsec, openvpn, and pptp to connect to the
> head office. Right now, I'm using OpenVPN with it
> because I had some difficulty having with
> linux+openswan and dynamic addresses. Connected to a
> Windows-based laptop, I was able to establish an ipsec
> connection to the openswan server in the office, and
> also connect using the WinXP PPTP client to a PPTP
> server.
>
>
> --- mike t.
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 18 Aug 2006 12:53:49 +0800
> From: Federico Sevilla III <jijo@???>
> Subject: Re: [plug] VPN design from a newbie's point of view
> To: plug@???
> Message-ID: <20060818045349.GC3063@???>
> Content-Type: text/plain; charset=us-ascii
>
> On Fri, Aug 18, 2006 at 10:07:39AM +0800, Jun Martin wrote:
>> More enlightenment, please. Can I subscribe to PLDT's WeRoam with the
>> IPSec option even if the network I intend to access outside is behind
>> a firewall with NAT?
>
> If you subscribe to PLDT's WeRoam VPN service, they'll provide you with
> an end-to-end configuration (that means a separate PLDT VPN service for
> your head office as well). If that's not what you want, you can get the
> PLDT WeRoam Internet service and then use IPSec or OpenVPN or whatever,
> and set things up yourself.
>
> Cheers!
>
> --> Jijo
>
> --
> Federico Vicente C. Sevilla III
> Information Technology Consultant
> Q Software Research Corporation
> Website: http://jijo.free.net.ph
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 18 Aug 2006 13:25:50 +0800
> From: Rafael 'Dido' Sevilla <dido@???>
> Subject: Re: [plug] VPN design from a newbie's point of view
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID: <44E54F5E.2010006@???>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Michael Tinsay wrote:
>> Based on my experience, Openswan is (a) pretty easy to
>> configure, and
>
> Not as easy as OpenVPN in my experience.
>
>> (b) I haven't had the need to patch a
>> kernel for it, though I'm using a 2.4 kernel with
>> KLIPS, as I prefer to have an ipsec0 interface.
>
> Lucky you that you already have a patched kernel. I suppose many modern
> distributions already incorporate the kernel patches necessary for IPsec
> support.
>
>> Haven't tested it where one endpoint is behind a NAT.
>>
>
> I have. Out of the box it doesn't work at all. There are supposed to
> be patches for OpenS/WAN to provide NAT traversal capability, but I've
> experienced other problems with them, e.g. trouble with path MTU
> discovery. Since in my experience I have almost never gotten a routable
> IP address while traveling as a road warrior, any VPN protocol that has
> trouble dealing with network address translation is completely worthless
> as far as that is concerned.
>
>> There is no openvpn client for windoze and wince. If
>> you're planning to have Windows and WinCE/PocketPC VPN
>> roadwarriors, openswan is the choice between the two,
>> though there are other alternatives like PPTP.
>
> False. There is an OpenVPN client for Windows, apparently they've had
> one ever since. We have used it, and while it does have some
> limitations compared to the GNU/Linux client, it works well enough for
> our Windows-based road warriors.
>
> And whatever you do, stay away from MPPE/MS-PPTP. The security record
> on that protocol is horrible, to say the least.
>
> --
> What this country needs is more unemployed politicians.
> http://stormwyrm.blogspot.com/
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 18 Aug 2006 14:04:30 +0800
> From: "jopoy solano" <jopoy.solano@???>
> Subject: Re: [plug] How to send-to-all email clients
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID:
> <9f6f2b9c0608172304r2a6ba6cs48c894012038a044@???>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On 8/17/06, Leo Angelo Cordero <leoangelo.cordero@???> wrote:
>>
>> i suggest that you create a mailing-list (e.g. everyone@domain). medyo
>> matrabaho lng pag-input ng lahat ng clients..
>>
>
> You can use awk to extract all your clients:
>
> awk -F: '$3 > 100 { print $1 }' /etc/passwd > allmyclients.txt
>
> hth.
>
> 'Jopoy
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> https://lists.hosting.qsr.com.ph/mailman/private/plug/attachments/20060818/9fa1b194/attachment.htm
>
> ------------------------------
>
> Message: 6
> Date: Fri, 18 Aug 2006 16:37:26 +0800
> From: "Zak B. Elep" <zakame@???>
> Subject: Re: [plug] How to know if the file writing is finish
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID:
> <111458c60608180137n8ad0c1r776f9eb5b687964e@???>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> Hi Reiner!
>
> On 8/18/06, Reiner Tolentino <reiner.tolentino@???> wrote:
>> Hi guys,
>>
>> I have a service that dumps some files (300MB each file) to my local
>> directory, I have no control of this service! All I know is a service is
>> dumping the files in that directory. And another service that gets the
>> files dumped to other location for backup. My problem is, how can I know
>> if the service that dumps the files were finish dumping these files so
>> that I can copy the file for backup?
>
> Well, the dumper program should call flock(3) on the output file in
> the first place, in particular an exclusive lock on the file. Your
> backup program, in turn, should be able to honor such file locking,
> and when it sees that there are no locks on the file anymore it can do
> a shared lock on that file and do its thing before unlocking and
> removing the file.
>
> Other than that, if your programs don't do locking at all, then
> there's no safe way for you to determine whether a file is done being
> written to or not, allowing for a subtle race condition, perhaps just
> as subtle as tempfile cracking.
>
> Cheers,
>
> Zakame
>
> --
> Zak B. Elep || http://zakame.spunge.org
> zakame@??? || zakame@???
> 1486 7957 454D E529 E4F1 F75E 5787 B1FD FA53 851D
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 18 Aug 2006 17:56:46 +0800 (PHT)
> From: "Rowel Atienza" <rowel@???>
> Subject: Re: [plug] How to know if the file writing is finish
> To: "Philippine Linux Users' Group (PLUG) Technical Discussion List"
> <plug@???>
> Message-ID: <48073.127.0.0.1.1155895006.squirrel@www.dnsph.com>
> Content-Type: text/plain;charset=iso-8859-1
>
>
>> Other than that, if your programs don't do locking at all, then
>> there's no safe way for you to determine whether a file is done being
>> written to or not, allowing for a subtle race condition, perhaps just
>> as subtle as tempfile cracking.
>>
>
> There is:
>
> fuser <filename>
>
> or
>
> lsof <filename>
>
> returns 0 if the filename is being written.
>
> rowel
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 18 Aug 2006 22:06:28 +1200
> From: ramfree17 <ramfree17@???>
> Subject: Re: [plug] How to know if the file writing is finish
> To: Philippine Linux Users' Group (PLUG) Technical Discussion List
> <plug@???>
> Message-ID: <f62643975c494fae7195b815d09b87ab@???>
> Content-Type: text/plain; charset="ISO-8859-1"
>
>
>
> On Fri, 18 Aug 2006 11:25:49 +0800, Reiner Tolentino
> <reiner.tolentino@???> wrote:
>> Hi guys,
>>
>> I have a service that dumps some files (300MB each file) to my local
>> directory, I have no control of this service! All I know is a service is
>> dumping the files in that directory. And another service that gets the
>> files dumped to other location for backup. My problem is, how can I know
>> if the service that dumps the files were finish dumping these files so
>> that I can copy the file for backup?
>>
>
> top of my head, i would say a script that checks the modification time of
> the file. this is useful only if you can be sure that a file modification
> time of x (min | seconds) means that the file is ready for copying.
>
> the rsync suggestion is also nice and efficient if it is applicable to
> your situation. :)
>
> ciao!
>
> --
> "Programming, an artform that fights back"
>
> Anuerin G. Diaz
> Registered Linux User #246176
> Friendly Linux Board @ http://mandrivausers.org/index.php
> http://capsule.ramfree17.org , when you absolutely have nothing else
> better to do
>
>
>
> ------------------------------
>
> _________________________________________________
> Philippine Linux Users' Group (PLUG) Mailing List
> plug@??? (#PLUG @ irc.free.net.ph)
> Read the Guidelines: http://linux.org.ph/lists
> Searchable Archives: http://archives.free.net.ph
>
> End of PLUG Digest, Vol 17, Issue 53
> ************************************
>
>



_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
plug@??? (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph