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:

VERSIONID(`setup for 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(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')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

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).

  • 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
  • 1
    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
    – AnFi
    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
    – AnFi
    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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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