LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-25-2015, 08:33 PM   #1
eathernet
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Rep: Reputation: Disabled
sendmail-8.14.4-9 - Cannot configure to send to relay server w/o specifying cf file


Hi,

Long time listener, first time caller. I'm no expert on sendmail, and this one has me a little stumped - hoping someone can help

(assume everything is run as root)

I configure my linux host to relay to relayserver.example.com, however when I test using:

echo sendmail test from `hostname` at `date` | sendmail -v my.email@example.com

I see the following:

my.email@example.com... Connecting to [127.0.0.1] via relay...
220 MYSERVER.localdomain ESMTP Postfix
>>> EHLO MYSERVER.example.com
250-MYSERVER.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
>>> MAIL From:<root@MYSERVER.example.com> SIZE=69
250 2.1.0 Ok
>>> RCPT To:<my.email@example.com>
>>> DATA
250 2.1.5 Ok
354 End data with <CR><LF>.<CR><LF>
>>> .
250 2.0.0 Ok: queued as D40BA19FB3B
my.email@example.com... Sent (Ok: queued as D40BA19FB3B)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 Bye

I never receive the email. When I run the same command specifying the sendmail config:

my.email@example.com... Connecting to relayserver.example.com via relay...
220 relayserver.example.com Microsoft ESMTP MAIL Service ready at Wed, 26 Aug 2015 11:21:12 +1000
>>> EHLO MYSERVER.example.com
250-relayserver.example.com Hello [MYSERVER_IPADDRESS]
250-SIZE 55574528
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XEXCH50
>>> MAIL From:<MYSERVER@example.com> SIZE=69
250 2.1.0 Sender OK
>>> RCPT To:<my.email@example.com>
>>> DATA
250 2.1.5 Recipient OK
354 Start mail input; end with <CRLF>.<CRLF>
>>> .
250 2.6.0 <201508260121.t7Q1LDs8014576@MYSERVER.example.com> Queued mail for delivery
my.email@example.com... Sent (<201508260121.t7Q1LDs8014576@MYSERVER.example.com> Queued mail for delivery)
Closing connection to relayserver.example.com
>>> QUIT

And I receive the email fine. Here is my sendmail.mc file:

# grep -v ^dnl /etc/mail/sendmail.mc

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `relayserver.example.com')
FEATURE(masquerade_envelope)dnl
FEATURE(`genericstable')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_DOMAIN(`localhost.localdomain')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

The steps I took to configure was:

yum install sendmail
yum install sendmail-cf
[modify the sendmail.mc file to include the relayserver and 4 lines below it]
make -C /etc/mail (also tried m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf)
service restart sendmail

The man page says this about the -C option:
-C file Use alternate configuration file. Sendmail gives up any enhanced (set-user-ID or set-group-ID) privileges if an alternate configuration file is speci-fied.


My permissions look like this:
drwxr-xr-x 2 root root 4096 Aug 26 11:16 /etc/mail
drwxrwx--- 2 smmsp smmsp 4096 Aug 26 11:21 /var/spool/clientmqueue
drwx------ 2 root mail 4096 Aug 26 11:21 /var/spool/mqueue
-rwxr-sr-x 1 root smmsp 833544 May 7 22:01 /usr/sbin/sendmail.sendmail

Looking forward to any ideas someone has. I'm hoping it's just something silly I've missed!

Thanks for reading

Last edited by eathernet; 08-25-2015 at 08:34 PM.
 
Old 08-25-2015, 09:12 PM   #2
eathernet
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Got it! Rookie error...

I just needed to change
FEATURE(`msp', `[127.0.0.1]')dnl

in /etc/mail/submit.mc

to:

FEATURE(`msp', `[relayserver.example.com]')dnl

recompile and restart sendmail. The penny dropped when I noticed:

# This is the prototype file for a set-group-ID sm-msp sendmail that
# acts as a initial mail submission program.

In the submit.mc file

Given the -C argument for sendmail states:
"Use alternate configuration file. Sendmail gives up any enhanced (set-user-ID or set-group-ID) privileges if an alternate configuration file is speci-fied."

All the best.
 
  


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
configure sendmail to relay mail to exchange server goldwing Red Hat 3 10-18-2008 04:07 PM
How to configure a sendmail server to act as a relay server deep_jyotsingh Linux - Server 1 07-30-2008 11:12 PM
Can't send using sendmail via my ISP's relay service DavidWilliamson Linux - Networking 1 03-24-2008 08:09 AM
Setup sendmail to send outgoing mail to relay server markdjones82 Linux - Enterprise 2 01-31-2008 02:46 AM
SENDMAIL as an SMTP RELAY SERVER that can send email to internet. how? kublador Linux - Software 7 10-25-2003 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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