Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up mail relay on a server to use relay.jangosmtp.net.

I have done this before on many other servers but have never had this issue. I updated my sendmail.mc with this:

divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `relay.jangosmtp.net')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
dnl MAILER(cyrusv2)dnl

I then ran make -C /etc/mail

For some reason after I restart sendmail and try to send an email it does not use the smart host relay. This is what I get in the logs:

Oct 14 17:54:17 ip-10-191-148-198 sendmail[17476]: starting daemon (8.14.4): SMTP+queueing@01:00:00
Oct 14 17:54:17 ip-10-191-148-198 sm-msp-queue[17484]: starting daemon (8.14.4): queueing@01:00:00
Oct 14 17:54:39 ip-10-191-148-198 sendmail[17487]: r9EHsdc3017487: from=apache, size=332, class=0, nrcpts=0, msgid=<201310141754.r9EHsdc3017487@ip-10-191-148-198>, relay=apache@localhost
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Look for two pairs of from= and to= sendmail log entries. The second to= log entry should show relay via the smart host.

The first pair should be generated by submit.cf sendmail and the second by sendmail.cf sendmail.

You can connect from= and to= log entries using queue id (e.g. r9EH0clP016385).

share|improve this answer
    
I have updated my question to include the full log entry that is output whenever an email is sent. I don't see a to= anywhere in there. –  Prince Oct 14 '13 at 18:00
    
Procedure for partial debug: as use apache send a test message from command line in verbose mode. (echo Subject: test; echo) | /usr/sbin/sendmail -i -v -- john.doe@example.net –  Andrzej A. Filip Oct 14 '13 at 18:23
    
OK that worked and I received the email in my gmail box. So it is not working when I use a php script to send the email. Any idea on what could be the cause of that? –  Prince Oct 14 '13 at 18:32
    
Have you changes email settings in php.in file? [especially sendmail_path] php.net/manual/en/mail.configuration.php –  Andrzej A. Filip Oct 14 '13 at 22:41
    
Yeah that was one of the first things that I checked. I ended up just using phpMailer to get it done. –  Prince Oct 15 '13 at 23:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.