Re: THANKS - Re: [CentOS] [OT] List of all email users

2008-11-04 Thread Jussi Hirvi
Les Mikesell ([EMAIL PROTECTED]) kirjoitteli (3.11.2008 16:05):
> _And_ keep in mind that you are going to get replies and probably spam
> to this address.  So you'll probably want to turn on the moderation
> feature of the list.

Instead I keep that alias commented out except when I want to send
information to the email users! That alias really would be a jackpot for the
spammers. :-) 

- Jussi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
[EMAIL PROTECTED] * http://www.greenspot.fi

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: THANKS - Re: [CentOS] [OT] List of all email users

2008-11-03 Thread Les Mikesell

mouss wrote:

Jussi Hirvi wrote:

Thanks Mouss and others. I have now more than enough to get on with.

mouss ([EMAIL PROTECTED]) kirjoitteli (2.11.2008 19:39):

why comma? isn't LF better (one user per line)?


LF or comma, it doesn't matter much. I said comma, because I am going to
utilize the list to build one huge alias "my_email_customers". :-)



if the list is huge, you may run into problems. better use a mailing-list.



_And_ keep in mind that you are going to get replies and probably spam 
to this address.  So you'll probably want to turn on the moderation 
feature of the list.


--
  Les Mikesell
   [EMAIL PROTECTED]
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: THANKS - Re: [CentOS] [OT] List of all email users

2008-11-03 Thread mouss

Jussi Hirvi wrote:

Thanks Mouss and others. I have now more than enough to get on with.

mouss ([EMAIL PROTECTED]) kirjoitteli (2.11.2008 19:39):

why comma? isn't LF better (one user per line)?


LF or comma, it doesn't matter much. I said comma, because I am going to
utilize the list to build one huge alias "my_email_customers". :-)



if the list is huge, you may run into problems. better use a mailing-list.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


THANKS - Re: [CentOS] [OT] List of all email users

2008-11-03 Thread Jussi Hirvi
Thanks Mouss and others. I have now more than enough to get on with.

mouss ([EMAIL PROTECTED]) kirjoitteli (2.11.2008 19:39):
> why comma? isn't LF better (one user per line)?

LF or comma, it doesn't matter much. I said comma, because I am going to
utilize the list to build one huge alias "my_email_customers". :-)

Regards,
Jussi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
[EMAIL PROTECTED] * http://www.greenspot.fi

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-11-02 Thread mouss

Jussi Hirvi wrote:

This is not CentOS-specific, hence OT.

I need a list of all email users on my system (there are hundreds of them).
The list could be extracted from /etc/aliases and the virtusertable.

Does anyone know of a script that would do this automatically? It would have
to 
- exclude commented-out lines (of course)


and exclude "continuation" lines (lines starting with spaces).


- exclude duplicates
- produce a list of usernames (or maybe unresolved email addresses for some
users) separated by a comma


why comma? isn't LF better (one user per line)?



I imagine perl would be the way to go. I haven't used perl at all myself.



you could start with something like

getkey()
{
  files=$*

  for file in $files; do
sed -e '/^[\#   ]/d' -e '/^$/d' $file | \
  awk -F'[: ]' '{print $1}'
  done
}

getkey /etc/aliases /etc/passwd | sort|uniq > users.local
getkey yourvirtualmap > users.virtual


If you want a list of all valid email addresses, you need to append the 
domains in mydestination to users.local.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-31 Thread Bill Campbell
On Fri, Oct 31, 2008, Jussi Hirvi wrote:
>John R Pierce ([EMAIL PROTECTED]) kirjoitteli (30.10.2008 17:39):
>> and what about the user accounts in /etc/passwd ?
>
>Hm, yes, never thought of that! That would be a very good (certainly easy)
>approach, though with its own limitations (it misses those users whose mail
>is forwarded in /etc/aliases to external addresses like gmail.com etc.).

I have a routine that pulls addresses from all the aliases files defined in
the postfix main.cf file, and gets all non-admin accounts from /etc/passwd,
combining the two to get all valid user names.  It then gets all the
domains from the postfix mydestination, combining the user names with these
domains to build a large virtual file for a border MX server that has no
users to allow it to validate incoming mail.

This have been working nicely for several years at an ISP with about 10,000
e-mail accounts.  The border MX server does preliminary IP based anti-spam
and uses amavisd and clamav to scan for phishing and worms that attack the
Microsoft virus, Windows, but does no spam checking.  It then sends
messages that pass amavisd to a cluster of servers that do spamassassin
checking, and delivery to NFS mounted Maildir stores.

Bill
-- 
INTERNET:   [EMAIL PROTECTED]  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:  (206) 236-1676  Mercer Island, WA 98040-0820
Fax:(206) 232-9186

Fair is the most dangerous word a politician utters. Whenever a government
does something for someone, it must do something to someone.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-31 Thread Jussi Hirvi
John R Pierce ([EMAIL PROTECTED]) kirjoitteli (30.10.2008 17:39):
> and what about the user accounts in /etc/passwd ?

Hm, yes, never thought of that! That would be a very good (certainly easy)
approach, though with its own limitations (it misses those users whose mail
is forwarded in /etc/aliases to external addresses like gmail.com etc.).

- Jussi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
[EMAIL PROTECTED] * http://www.greenspot.fi

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-30 Thread Ralph Angenendt
Jussi Hirvi wrote:
> Ralph Angenendt ([EMAIL PROTECTED]) kirjoitteli (30.10.2008 17:12):
>> for i in /etc/aliases /etc/postfix/virtual; do
>> cat $i | grep -Ev "(^#|^\s+$|^$)" | sed -e "s/://" | awk '{print $1}' | \
>> sort -u | tr \\n ,
>> done
> 
> Thanks, that looks neat, and works.
> 
> For real-world use, I guess the source files (in my case aliases,
> virtusertable) should be prepared first - the list will include unwanted
> users like "bin" or "mysql", mailing list name defined in virtusertable, and
> possibly other strange things too.

And (I forgot to say that) - it weeds out users with a ":" in their mail
address, which is completely valid. So you should check that also.

Cheers,

Ralph


pgpMpr2V4oXIt.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-30 Thread John R Pierce

Jussi Hirvi wrote:

For real-world use, I guess the source files (in my case aliases,
virtusertable) should be prepared first - the list will include unwanted
users like "bin" or "mysql", mailing list name defined in virtusertable, and
possibly other strange things too.
  



and what about the user accounts in /etc/passwd ?


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-30 Thread Jussi Hirvi
Ralph Angenendt ([EMAIL PROTECTED]) kirjoitteli (30.10.2008 17:12):
> for i in /etc/aliases /etc/postfix/virtual; do
> cat $i | grep -Ev "(^#|^\s+$|^$)" | sed -e "s/://" | awk '{print $1}' | \
> sort -u | tr \\n ,
> done
> 
> Adapt to needs.

Thanks, that looks neat, and works.

For real-world use, I guess the source files (in my case aliases,
virtusertable) should be prepared first - the list will include unwanted
users like "bin" or "mysql", mailing list name defined in virtusertable, and
possibly other strange things too.

- Jussi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
[EMAIL PROTECTED] * http://www.greenspot.fi

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] [OT] List of all email users

2008-10-30 Thread Ralph Angenendt
Jussi Hirvi wrote:
> This is not CentOS-specific, hence OT.
> 
> I need a list of all email users on my system (there are hundreds of them).
> The list could be extracted from /etc/aliases and the virtusertable.
> 
> Does anyone know of a script that would do this automatically? It would have
> to 
> - exclude commented-out lines (of course)
> - exclude duplicates
> - produce a list of usernames (or maybe unresolved email addresses for some
> users) separated by a comma


for i in /etc/aliases /etc/postfix/virtual; do
  cat $i | grep -Ev "(^#|^\s+$|^$)" | sed -e "s/://" | awk '{print $1}' | \
  sort -u | tr \\n , 
done

Adapt to needs.

Ralph


pgpJ8rYkqKVYp.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] [OT] List of all email users

2008-10-30 Thread Jussi Hirvi
This is not CentOS-specific, hence OT.

I need a list of all email users on my system (there are hundreds of them).
The list could be extracted from /etc/aliases and the virtusertable.

Does anyone know of a script that would do this automatically? It would have
to 
- exclude commented-out lines (of course)
- exclude duplicates
- produce a list of usernames (or maybe unresolved email addresses for some
users) separated by a comma

I imagine perl would be the way to go. I haven't used perl at all myself.

Regards,
Jussi

--
Jussi Hirvi * Green Spot
Topeliuksenkatu 15 C * 00250 Helsinki * Finland
Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms)
[EMAIL PROTECTED] * http://www.greenspot.fi

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos