LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2018, 09:28 AM   #1
duanekimball
LQ Newbie
 
Registered: Jun 2018
Location: New Jersey
Posts: 2

Rep: Reputation: Disabled
sendmail: how to wildcard hostnames in virtusertable or genericstable?


I work for a big company and we have many host that follow a naming convention.

What we do now, is handle each email for the server based on its function
@dns001.bigcompany.com dns-admin
@dns002.bigcompany.com dns-admin
@dns003.bigcompany.com dns-admin
@dns004.bigcompany.com dns-admin
@mail001.bigcompany.com mail-admin
@mail002.bigcompany.com mail-admin
.
.
@mail321.bigcompany.com mail-admin
@logger001.bigcompany.com log-admin
...and so forth
where: dns-admin, mail-admin, log-admin are /etc/mail/aliases

We're running 8.14.4 on our mail relay hub (redhad 6) that gets email from 100's of these boxes and currently we just have to add/delete lines to the /etc/mail files as hosts are (mostly) added and deleted

We just want something simple like:
@dns*.bigcompany.com dns-admin
@mail*.bigcompany.com mail-admin
@logger*.bigcompany.com log-admin

thanks!

Last edited by duanekimball; 06-01-2018 at 09:55 AM. Reason: thanks! in wrong spot ;p
 
Old 06-02-2018, 08:26 AM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Rep: Reputation: 270Reputation: 270Reputation: 270
Do you have sendmail's source installed on your system? If not, you can get it free @sendmail.org. cf/README explains this clearly.
 
Old 06-02-2018, 10:49 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
Quote:
We just want something simple like:
@dns*.bigcompany.com dns-admin
@mail*.bigcompany.com mail-admin
@logger*.bigcompany.com log-admin
You can use procmail to filter mail based on ^TO and using wildcards for the domain part.
Something like the following (untested) in /etc/procmailrc:
Code:
:0
* ^TO.*@dns[0-9].bigcompany.com
! dns-admin
:0
* ^TO.*@mail[0-9].bigcompany.com
! mail-admin

Last edited by bathory; 06-03-2018 at 02:56 AM. Reason: forgot the ^
 
Old 06-03-2018, 01:08 AM   #4
duanekimball
LQ Newbie
 
Registered: Jun 2018
Location: New Jersey
Posts: 2

Original Poster
Rep: Reputation: Disabled
wildcard hostnames

Quote:
Originally Posted by RandomTroll View Post
Do you have sendmail's source installed on your system? If not, you can get it free @sendmail.org. cf/README explains this clearly.
I didn't see anything about wildcarding the RHS of an email address. I tried the +* trick in the generics or virtuals..no luck. I think that only works with the username and then for mailertable entries, which doesn't meet my needs
 
Old 06-03-2018, 09:17 AM   #5
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by duanekimball View Post
I didn't see anything about wildcarding the RHS of an email address. I tried the +* trick in the generics or virtuals..no luck. I think that only works with the username and then for mailertable entries, which doesn't meet my needs
If you've read cf/README and can't find what you want I don't understand your question. You can ask at comp.mail.sendmail; be prepared for Mr Claus Aßmann's reply.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Emails being delayed by 00:01:20 seconds while using genericstable - Sendmail Rohit_4739 Linux - Server 2 07-16-2012 08:33 AM
sendmail problem --> genericstable not working baldwonder Linux - Software 1 04-23-2012 12:05 PM
Sendmail virtusertable rruivo Linux - Server 5 02-11-2010 06:34 AM
sendmail virtusertable user1234321 Linux - Server 1 06-10-2007 11:17 AM
My genericstable feature in sendmail seems to be ignored colpaarm Linux - Software 0 07-03-2003 09:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration