LinuxQuestions.org
Review your favorite Linux distribution.
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-07-2004, 12:11 AM   #1
ricky_ds
Member
 
Registered: Aug 2004
Location: Bern, Switzerland
Distribution: Kubuntu, FC, RHEL
Posts: 48
Blog Entries: 2

Rep: Reputation: 17
sendmail configuration problems (hylafax mail to fax gateway)


Hello all,

If you are familiar with Sendmail, then I'm sure this question is a very basic one, but I've been trying hard to figure out myself without any success.

Basically, I have to redirect all xxxxx@01234567.FAX addresses to the faxmail program. Right now, all TLD "fax" try to get resolved instead of being recognized correctly as a fake TLD. Since the sendmail.cf is so long, I will include only the relevant parts here. If I miss one important part, just let me know, I'll add it later.

Code:
######################################################################
######################################################################
#####
#####		SENDMAIL CONFIGURATION FILE
#####
##### built by root on Die Nov 2 11:37:34 CET 2004
##### in /etc/mail
##### using /usr/share/sendmail-cf/ as configuration include directory
#####
######################################################################
#####
#####	DO NOT EDIT THIS FILE!  Only edit the source .mc file.
#####
######################################################################
######################################################################

#####  $Id: cfhead.m4,v 8.108.2.6 2003/12/05 02:26:47 ca Exp $  #####
#####  $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $  #####

####################################
###   FAX Mailer specification   ###
####################################

#####  $Id: fax.m4,v 8.16 2001/11/12 23:11:34 ca Exp $  #####

Mfax,		P=/usr/local/bin/faxmail, F=DFMhu, S=14, R=24,
		M=100000, T=X-Phone/X-FAX/X-Unix,
		A=faxmail -d $u@$h $f


#####  $Id: linux.m4,v 8.13 2000/09/17 17:30:00 gshapiro Exp $  #####



#####  $Id: local_procmail.m4,v 8.21.42.1 2002/11/17 04:25:07 ca Exp $  #####
Code:
# dequoting map
Kdequote dequote

# class E: names that should be exposed as from this host, even if we masquerade
# class L: names that should be delivered locally, even if we have a relay
# class M: domains that should be converted to $M
# class N: domains that should not be converted to $M
#CL root
C{E}root
C{w}localhost.localdomain



# my name for error messages
DnMAILER-DAEMON

CPREDIRECT

CPFAX
#####  setup for Red Hat Linux  #####
Code:
######################################
###   Ruleset 0 -- Parse Address   ###
######################################

Sparse=0

R$*			$: $>Parse0 $1		initial parsing
R<@>			$#local $: <@>		special case error msgs
R$*			$: $>ParseLocal $1	handle local hacks
R$*			$: $>Parse1 $1		final parsing

#
#  Parse0 -- do initial syntax checking and eliminate local addresses.
#	This should either return with the (possibly modified) input
#	or return with a #error mailer.  It should not return with a
#	#mailer other than the #error mailer.
#

SParse0
R<@>			$@ <@>			special case error msgs
R$* : $* ; <@>		$#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
R@ <@ $* >		< @ $1 >		catch "@@host" bogosity
R<@ $+>			$#error $@ 5.1.3 $: "553 User address required"
R$+ <@>			$#error $@ 5.1.3 $: "553 Hostname required"
R$*			$: <> $1
R<> $* < @ [ $* ] : $+ > $*	$1 < @ [ $2 ] : $3 > $4
R<> $* < @ [ $* ] , $+ > $*	$1 < @ [ $2 ] , $3 > $4
R<> $* < @ [ $* ] $+ > $*	$#error $@ 5.1.2 $: "553 Invalid address"
R<> $* < @ [ $+ ] > $*		$1 < @ [ $2 ] > $3
R<> $* <$* : $* > $*	$#error $@ 5.1.3 $: "553 Colon illegal in host name part"
R<> $*			$1
R$* < @ . $* > $*	$#error $@ 5.1.2 $: "553 Invalid host name"
R$* < @ $* .. $* > $*	$#error $@ 5.1.2 $: "553 Invalid host name"
R$* < @ $* @ > $*	$#error $@ 5.1.2 $: "553 Invalid route address"
R$* @ $* < @ $* > $*	$#error $@ 5.1.3 $: "553 Invalid route address"
R$* , $~O $*		$#error $@ 5.1.3 $: "553 Invalid route address"


# now delete the local info -- note $=O to find characters that cause forwarding
R$* < @ > $*		$@ $>Parse0 $>canonify $1	user@ => user
R< @ $=w . > : $*	$@ $>Parse0 $>canonify $2	@here:... -> ...
R$- < @ $=w . >		$: $(dequote $1 $) < @ $2 . >	dequote "foo"@here
R< @ $+ >		$#error $@ 5.1.3 $: "553 User address required"
R$* $=O $* < @ $=w . >	$@ $>Parse0 $>canonify $1 $2 $3	...@here -> ...
R$- 			$: $(dequote $1 $) < @ *LOCAL* >	dequote "foo"
R< @ *LOCAL* >		$#error $@ 5.1.3 $: "553 User address required"
R$* $=O $* < @ *LOCAL* >
			$@ $>Parse0 $>canonify $1 $2 $3	...@*LOCAL* -> ...
R$* < @ *LOCAL* >	$: $1

#
#  Parse1 -- the bottom half of ruleset 0.
#

SParse1

# handle numeric address spec
R$* < @ [ $+ ] > $*	$: $>ParseLocal $1 < @ [ $2 ] > $3	numeric internet spec
R$* < @ [ $+ ] > $*	$: $1 < @ [ $2 ] : $S > $3	Add smart host to path
R$* < @ [ $+ ] : > $*		$#esmtp $@ [$2] $: $1 < @ [$2] > $3	no smarthost: send
R$* < @ [ $+ ] : $- : $*> $*	$#$3 $@ $4 $: $1 < @ [$2] > $5	smarthost with mailer
R$* < @ [ $+ ] : $+ > $*	$#esmtp $@ $3 $: $1 < @ [$2] > $4	smarthost without mailer

# handle virtual users
R$+			$: <!> $1		Mark for lookup
R<!> $+ < @ $={VirtHost} . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<!> $+ < @ $=w . > 	$: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<@> $+ + $+ < @ $* . >
			$: < $(virtuser $1 + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $* . >
			$: < $(virtuser $1 + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $* . >
			$: < $(virtuser $1 @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $+ < @ $+ . >	$: < $(virtuser + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $+ . >	$: < $(virtuser + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
R<@> $+ + $* < @ $+ . >	$: < $(virtuser @ $3 $@ $1 $@ $2 $@ +$2 $: ! $) > $1 + $2 < @ $3 . >
R<@> $+ < @ $+ . >	$: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
R<@> $+			$: $1
R<!> $+			$: $1
R< error : $-.$-.$- : $+ > $* 	$#error $@ $1.$2.$3 $: $4
R< error : $- $+ > $* 	$#error $@ $(dequote $1 $) $: $2
R< $+ > $+ < @ $+ >	$: $>Recurse $1

# short circuit local delivery so forwarded email works


R$=L < @ $=w . >	$#local $: @ $1			special local names
R$+ < @ $=w . >		$#local $: $1			regular local name

# not local -- try mailer table lookup
R$* <@ $+ > $*		$: < $2 > $1 < @ $2 > $3	extract host name
R< $+ . > $*		$: < $1 > $2			strip trailing dot
R< $+ > $*		$: < $(mailertable $1 $) > $2	lookup
R< $~[ : $* > $* 	$>MailerToTriple < $1 : $2 > $3		check -- resolved?
R< $+ > $*		$: $>Mailertable <$1> $2		try domain

# resolve remotely connected UUCP links (if any)

# resolve fake top level domains by forwarding to other hosts

R$+ < @$+.FAX > 	$#fax $@ $2 $: $1		user@host.FAX

# pass names that still have a host to a smarthost (if defined)
R$* < @ $* > $*		$: $>MailerToTriple < $S > $1 < @ $2 > $3	glue on smarthost name

# deal with other remote names
R$* < @$* > $*		$#esmtp $@ $2 $: $1 < @ $2 > $3	user@host.domain

# handle locally delivered names
R$=L			$#local $: @ $1			special local names
R$+			$#local $: $1			regular local names


###########################################################################
###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
###########################################################################
Here's some tests I did. Notice that my .fax addresses to #local in ruleset 0 instead of #fax:

Code:
# sendmail -Csendmail.cf -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 0 test@0123456789.fax
parse              input: test @ 0123456789 . fax
Parse0             input: test @ 0123456789 . fax
Parse0           returns: test @ 0123456789 . fax
ParseLocal         input: test @ 0123456789 . fax
ParseLocal       returns: test @ 0123456789 . fax
Parse1             input: test @ 0123456789 . fax
Parse1           returns: $# local $: test @ 0123456789 . fax
parse            returns: $# local $: test @ 0123456789 . fax


# sendmail -Csendmail.cf -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 3,0 test@0123456789.fax
canonify           input: test @ 0123456789 . fax
Canonify2          input: test < @ 0123456789 . fax >
Canonify2        returns: test < @ 0123456789 . fax . >
canonify         returns: test < @ 0123456789 . fax . >
parse              input: test < @ 0123456789 . fax . >
Parse0             input: test < @ 0123456789 . fax . >
Parse0           returns: test < @ 0123456789 . fax . >
ParseLocal         input: test < @ 0123456789 . fax . >
ParseLocal       returns: test < @ 0123456789 . fax . >
Parse1             input: test < @ 0123456789 . fax . >
Mailertable        input: < 0123456789 . fax > test < @ 0123456789 . fax . >
Mailertable        input: 0123456789 . < fax > test < @ 0123456789 . fax . >
Mailertable      returns: test < @ 0123456789 . fax . >
Mailertable      returns: test < @ 0123456789 . fax . >
MailerToTriple     input: < > test < @ 0123456789 . fax . >
MailerToTriple   returns: test < @ 0123456789 . fax . >
Parse1           returns: $# esmtp $@ 0123456789 . fax . $: test < @ 0123456789 . fax . >
parse            returns: $# esmtp $@ 0123456789 . fax . $: test < @ 0123456789 . fax . >
I assume my error is in Ruleset 0, but if some specialist could point me into the right direction, I'd be very grateful.

ricky
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
hylafax shows problems while prefixing code in the fax no: jomy Linux - Networking 0 07-19-2005 09:24 AM
problem sending fax with hylafax jomy Linux - Networking 1 07-18-2005 08:59 AM
mail/sendmail configuration reflection666 Linux - Newbie 2 04-07-2005 06:21 AM
Sendmail spamassassin & mail gateway mdavis Linux - Software 2 11-08-2004 01:46 PM
Fax Software (not HylaFAX please) asklepios Linux - Software 1 03-03-2004 12:42 AM

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

All times are GMT -5. The time now is 05:58 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