LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-29-2006, 08:57 PM   #1
JetreL
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Rep: Reputation: 0
Using wildcards in sendmail for aliases


I am hoping someone here can help me with this. I am using sendmail and need to figure out a way to use wildcards for aliases. What I am looking to do is all mail that meets a certain wildcard goes to an address and all the rest of the mail goes to another address. I know how to do the last part using:

@domain user

But the first problem has me stumped. An example of what I am looking for is:

%smith%@domain johnsmith
@domain user

Ideas?
 
Old 11-29-2006, 10:41 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
There's some info at http://www.sendmail.org/m4/features.html which looks like it might do what you need. Unfortunately, I haven't tried this...
Code:
Additionally, if the local part consists of "user+detail" then "detail" is passed as %2 and "+detail" is passed as %3  when a match against user+* is attempted, so entries like

old+*@foo.org	new+%2@example.com
gen+*@foo.org	%2@example.com
+*@foo.org	%1%3@example.com
X++@foo.org	Z%3@example.com
@bar.org	%1%3

and other forms are possible.

Note: to preserve "+detail" for a default case (@domain) %1%3 must be used as RHS. There are two wildcards after "+": "+" matches only a non-empty detail, "*" matches also empty details, e.g., user+@foo.org matches +*@foo.org but not ++@foo.org. This can be used to ensure that the parameters %2 and %3 are not empty.
 
  


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
Using wildcards in sendmail for aliases JetreL Red Hat 1 11-30-2006 04:18 AM
sendmail and NIS databases (aliases, mail.aliases) - what kind of databases? cotton213 Linux - Software 0 03-14-2006 05:57 PM
sendmail aliases guduke Linux - Software 3 03-14-2006 06:11 AM
Sendmail and aliases freelinuxcpp Linux - Networking 2 07-27-2004 05:01 AM
SENDMAIL Aliases Help echid Linux - Software 1 03-11-2004 08:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:37 PM.

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