Perfect Storm
18th May 2006, 02:30 AM
I recently upgraded from FC3 to FC5 and for the most part everything went smoothly.
That is aside from sendmail....
Most of the problems I've fixed, but the 2 nagging ones are these:
1. Apache cannot seem to send to anything through sendmail. I have a lot of sites hosted here, many which use the php mail() function. This was never a problem before, but now the messages are in my root inbox as undeliverable.
2. This appears to be a related problem, but I cannot use my server as an smtp server anymore, except to local addresses. This is a problem because I am working out of the province until the end of the year and don't have an smtp to send through.
Please, any help would be greatly appreciated!!
liro
18th May 2006, 08:06 AM
1. Apache cannot seem to send to anything through sendmail. I have a lot of sites hosted here, many which use the php mail() function. This was never a problem before, but now the messages are in my root inbox as undeliverable.
for this prupose i would advice you to set the apache user into "trusted-users" of sendmail.
2. This appears to be a related problem, but I cannot use my server as an smtp server anymore, except to local addresses. This is a problem because I am working out of the province until the end of the year and don't have an smtp to send through.
sendmail is default setup to only relay local email (to be sure, not to act as an open relay server). for this to change, you must update your sendmail.mc file at the following line:
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
by adding a 'dnl' on last line, you enable sendmail to accept mails not only from localhost....then recompile (make -C /etc/mail) and restart sendmail.
but: be sure to not configure your server as an open relay! check it with telnet relay-test.mail-abuse.org
Perfect Storm
22nd May 2006, 02:45 AM
The first solution worked, however I am still unable to have scripts send to addresses outside of localhost.
I also still get rejected connection when using smtp
gavinw6662
22nd May 2006, 03:32 AM
The first solution worked, however I am still unable to have scripts send to addresses outside of localhost.
I also still get rejected connection when using smtp
if you get rejected when using smtp - have you started the saslauthd service? Since FC3 that was pretty much a requirement to get sendmail to work. Also - when you state "however I am still unable to have scripts send to addresses outside of localhost" are you saying that you are using the "mail" command and trying to send to an external e-mail address?
The scripts problem, I am not too sure about. To test its functionality I would do:
mail -s "testing" user@remoteemailaddress.ext
.
return
return
If that file gets to where it is going, then php_mail should work. If not, you might need to make changes to the php.ini. To resolve the second part there, you could also do an 'alias' hack and make php_mail send to a local user account, and in the /etc/aliases file create an alias for that user.
localusername: <tab><tab>remote@emailaddress.ext
newaliases (to rebuild your aliases file) and then test......
mail -s "testing" localusername
.
return
return
and that should end up in that aliases mailbox.
liro
22nd May 2006, 09:00 AM
The first solution worked, however I am still unable to have scripts send to addresses outside of localhost.
I also still get rejected connection when using smtp
have you correclty configured your sendmail? did you set an entry in virtusertable for your domain, are all the mx records correct setup...
and with the advises gavinw6662 gave you, it should run...if not, post the /var/log/maillog errors...
Perfect Storm
22nd May 2006, 06:09 PM
Here's what the maillog says after trying to send a message from root@mydomain.ca to me@anotherdomain.ca
May 22 13:00:05 mydomain sendmail[26886]: k4MG058T026886: from=root, size=51, class=0, nrcpts=1, msgid=<200605221600.k4MG058T026886@mydomain.ca>, relay=root@localhost
May 22 13:00:05 mydomain sendmail[26887]: k4MG05U6026887: from=<root@mydomain.ca>, size=329, class=0, nrcpts=1, msgid=<200605221600.k4MG058T026886@mydomain.ca>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 22 13:00:05 mydomain sendmail[26886]: k4MG058T026886: to=me@anotherdomain.ca, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30051, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k4MG05U6026887 Message accepted for delivery)
May 22 13:02:05 mydomain sendmail[26889]: k4MG05U6026887: to=<me@anotherdomain.ca>, ctladdr=<root@mydomain.ca> (0/0), delay=00:02:00, xdelay=00:02:00, mailer=esmtp, pri=120329, relay=smtpin.anotherdomain.ca. [24.222.0.18], dsn=4.0.0, stat=Deferred: Connection timed out with smtpin.anotherdomain.ca.
May 22 13:02:20 mydomain sendmail[26903]: k4MG2KHM026903: from=root, size=28, class=0, nrcpts=1, msgid=<200605221602.k4MG2KHM026903@mydomain.ca>, relay=root@localhost
Here's my sendmail.mc file
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # default logging level is 9, you might want to set it higher to
dnl # debug the configuration
dnl #
dnl define(`confLOG_LEVEL', `9')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.anotherdomain.ca')
FEATURE(authinfo)dnl
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
dnl define(`confAUTO_REBUILD')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
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p y')dnl
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl # Please remember that saslauthd needs to be running for AUTH.
dnl #
dnl TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl # cd /usr/share/ssl/certs; make sendmail.pem
dnl # Complete usage:
dnl # make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekey file')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)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
dnl #
dnl # The following limits the number of processes sendmail can fork to accept
dnl # incoming messages or process its message queues to 12.) sendmail refuses
dnl # to accept connections once it has reached its quota of child processes.
dnl #
dnl define(`confMAX_DAEMON_CHILDREN', 12)dnl
dnl #
dnl # Limits the number of new connections per second. This caps the overhead
dnl # incurred due to forking new sendmail processes. May be useful against
dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address
dnl # limit would be useful but is not available as an option at this writing.)
dnl #
dnl define(`confCONNECTION_RATE_THROTTLE', 3)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
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
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
dnl DAEMON_OPTIONS(`Port=smtp,Addr=192.168.0.104, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # enable both ipv6 and ipv4 in sendmail:
dnl #
dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
liro
23rd May 2006, 07:16 PM
so in your maillog you see the error sendmail has, sending your mail:
stat=Deferred: Connection timed out with smtpin.anotherdomain.ca.
which means, that sendmail doesn't have a connection to your smtp-relay-host...
but, what me confuses is, that in your sendmail config you setup the relay host to "smtp.anotherdomain.ca" and not "smtpin.anotherdomain.ca"...
have you recomiled (make -C /etc/mail) and restarted sendmail, in other words is this config actual?
check the connection to the smtp-relay that you use...
Perfect Storm
23rd May 2006, 07:42 PM
so in your maillog you see the error sendmail has, sending your mail:
stat=Deferred: Connection timed out with smtpin.anotherdomain.ca.
which means, that sendmail doesn't have a connection to your smtp-relay-host...
but, what me confuses is, that in your sendmail config you setup the relay host to "smtp.anotherdomain.ca" and not "smtpin.anotherdomain.ca"...
have you recomiled (make -C /etc/mail) and restarted sendmail, in other words is this config actual?
check the connection to the smtp-relay that you use...
The another domains mentioned are 2 different sites, I should have mentioned that. But as you can see the relay line in sendmail.mc is dnl'ed so it doesn't make a difference anyway
liro
24th May 2006, 12:27 PM
oh yes, sorry i surveyed that its commented out...
so, your dns reloution to the maildomain is setup correctly?
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.