i am configuring sendmail server in my fedora core 1
machine.
i have configured my mail server to send outgoing mail via a smtp relay agent(smart host and running on windows 2k) with public IP(203...) and possibly NATted and my mail server(which i call mail hub) that has private IP(192.168...) for security reasons.
among most of the documents i have read including the 'bat book' by b.c. & e.a. i have found that the configuration is explained for mail servers having public IP.
now what i would like to request you to inform me about is how to go about configuring my sendmail.
Moreover, the m4 configuration generated too many things i dont want to bother about, so i tried creating my own sendmail.cf
the system i want is
:- all outgoing mail should go via smart host.
:-all incoming mail to smart host ( which has public IP with valid MX record) should be forwarded to mail hub
:-all local mail should be delivered via smart host so that i can specify public POP server IP.
What i could succeed in doing was :
* to relay my mail TO say, yahoo.com via smtp relay agent.
* to relay my mail FROM yahoo.com to my smart host and to forward to mail hub(sendmail server)
But what i falied in doing was
* recieving mail from yahoo.com via smtp relay agent to my sendmail server.
(i think the sendmail forwards it again to smart host).
* sending/recieving mail locally.
i am using fluffy the SMTPGuardDog as my smtp relay agent for experimental purposes.
below is my configuration file sendmail.cf, i think you will have to help me with the M definition, for smtp & local.
please spare some time to view it and feel free to make changes.
V10/Berkeley
D{REMOTE}proxy # The name of the smart host
D{HUB}keckist.edu.np # Hub as known to the outside world
Cw localhost # My other names
Fw -o /etc/mail/local-host-names # A file of other names
Ct root daemon
# Options
O QueueDirectory=/var/spool/mqueue
O Timeout.queuewarn=4h
O Timeout.queuereturn=5d
O DeliveryMode=background
O TempFileMode=0600
O DefaultUser=1:1
O LogLevel=9
O OldStyleHeaders=True
O BlankSub=. # Replace unquoted spaces
# Headers
HFrom: <$g> # Added only if missing
HReceived: by $j; $b # Always added
H?x?Full-Name: $?x$x$. # Add full name if available
H?D?Date: $a # Add if F=D
H?M?Message-Id: <$t.$i@$j> # Add if F=M
# Precedence
Pspecial-delivery=100
Pfirst-class=0
Plist=-30
Pbulk=-60
Pjunk=-100
Msmtp, P=[IPC], S=Hubset/Hubset, R=2/2, F=0xmDFMuXa, T=DNS/RFC822/SMTP, A=TCP $h
Mlocal, P=/bin/mail, F=0lsDFMAw5:/|@rmn, S=Hubset/Hubset, R=2/2, A=mail -d $u
S0 # select delivery agent
R@$+ $#error $: Missing user name
R$+@$=w $#local $: $1
R$+@$=w.$m $#local $: $1
R$+@$=m $#local $: $1
#R$+@keckist.edu.np $#local $: $1
R$+ $#smtp $@${REMOTE} $:$1 # forward to smtp relay (proxy)
S2 #Rewrite reciever for hub
R$+@keckist.edu.np $1@moodle.inet.kec #moodle.inet.kec is my sendmail server in my private network
S3 # preprocessing for all rule sets
R$* <> $* $n # handle <> error address
R$* < $* <$*> $* > $* $2<$3>$4 # de-nest brackets
R$* < $* > $* $2 # basic RFC822 parsing
SHubset # Rewrite the sender for the hub
R$- $@ $1@${HUB} # user ->
user@keckist.edu.np
R$- @ $=m $@ $1@${HUB} #user@domain ->
user@keckist.edu.np
R$- @ $=w $@ $1@${HUB} # user@local ->
user@keckist.edu.np
R$- @ $=w . $m $@ $1@${HUB} #
user@local.domain ->
user@keckist.edu.np