LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Mail Issue (https://www.linuxquestions.org/questions/slackware-14/mail-issue-4175456066/)

vivanguarda 03-29-2013 04:01 PM

Mail Issue
 
1 Attachment(s)
Good Evening!!

Sorry about another thread about the same problem: mail and sendmail!


I believe after last weeks it was possible a better understanding about ways of sending mails. But, unfortunately I am not sucess yet.

Then, I need helpful to use sendmail in a smart host feature. I am using a dynamic ip in ig.com.br domain and it is hosted by Google/Gmail.

My sendmail is Version 8.14.5 and compiled with:

DNSMAP LOG MAP_REGEX MATCHGECOS MILTER MIME7TO8 MIME8TO7
NAMED_BIND NETINET NETINET6 NETUNIX NEWDB NIS PIPELINING SASLv2
SCANF SOCKETMAP STARTTLS TCPWRAPPERS USERDB XDEBUG



I used this linuxquestions HowTo which has this file

/etc/mail/authinfo

AuthInfo:smtp.ig.com.br "U:vivanguarda2@ig.com.br" "P:xxxxxxxx" "M:PLAIN"



http://www.linuxquestions.org/questi...-howto-224543/


My /etc/hosts
# For loopbacking.
127.0.0.1 localhost
127.0.0.1 maq1.local.maq1_localdomain maq1.local


Relevant sendmail-slackware.mc
PHP Code:

dnl# This is the default sendmail .mc file for Slackware.  To generate
dnl# the sendmail.cf file from this (perhaps after making some changes),
dnl# use the m4 files in /usr/share/sendmail/cf like this:
dnl#
dnl# cp sendmail-slackware.mc /usr/share/sendmail/cf/config.mc
dnl# cd /usr/share/sendmail/cf
dnl# sh Build config.cf
dnl#
dnl# You may then install the resulting .cf file:
dnl# cp config.cf /etc/mail/sendmail.cf
dnl#
include(`../m4/cf.m4')
VERSIONID(
`default setup for Slackware Linux')dnl
OSTYPE(`linux'
)dnl
dnl
# These settings help protect against people verifying email addresses
dnl# at your site in order to send you email that you probably don't want:
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
dnl# Uncomment the line below to send outgoing mail through an external server:
define(`SMART_HOST'
,`[smtp.ig.com.br]')dnl
dnl# No timeout for ident:
define(
`confTO_IDENT', `0')dnl
dnl
# Enable the line below to use smrsh to restrict what sendmail can run:
dnl FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
dnl# See the README in /usr/share/sendmail/cf for a ton of information on
dnl# how these options work:
FEATURE(`authinfo'
,`hash -o /etc/mail/authinfo.db')dnl
define(
`confAUTH_OPTIONS', `A p y')dnl"
FEATURE(`use_cw_file')dnl
FEATURE(`use_ct_file')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a 
$h -d $u')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`redirect')dnl
dnl# Turn this feature on if you don't always have DNS, or enjoy junk mail:
dnl FEATURE(`accept_unresolvable_domains')dnl
EXPOSED_USER(`root')dnl
dnl# Also accept mail for localhost.localdomain:
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl 


A partial /etc/mail/sendmail.cf in sendmail.txt arquive




And finally /var/log/maillog

Code:

Mar 29 04:47:29 maq1 sendmail[3450]: r2T7l7q8003450: from=normal, size=4, class=0, nrcpts=0,
msgid=<201303290747.r2T7l7q8003450@maq1>, relay=root@localhost
Mar 29 04:49:53 maq1 sendmail[3487]: gethostbyaddr(192.168.0.2) failed: 1
Mar 29 05:00:47 maq1 sm-mta[2722]: rejecting connections on daemon MTA: load average: 12
Mar 29 05:00:47 maq1 sm-mta[2722]: rejecting connections on daemon MSA: load average: 12
Mar 29 05:00:58 maq1 sm-mta[2722]: rejecting connections on daemon MTA: load average: 12
Mar 29 05:01:03 maq1 sm-mta[2722]: rejecting connections on daemon MSA: load average: 12
Mar 29 05:01:13 maq1 sm-mta[2722]: accepting connections again for daemon MTA
Mar 29 05:06:01 maq1 sm-mta[1893]: gethostbyaddr(192.168.0.2) failed: 2
Mar 29 05:06:01 maq1 sm-mta[1914]: starting daemon (8.14.5): SMTP+queueing@00:05:00
Mar 29 05:06:01 maq1 sm-msp-queue[1917]: starting daemon (8.14.5): queueing@00:05:00
Mar 29 14:27:04 maq1 sendmail[3304]: r2THR4o7003304: from=root, size=227, class=0, nrcpts=1,
msgid=<201303291727.r2THR4o7003304@maq1>, relay=root@localhost
Mar 29 14:30:05 maq1 sm-mta[3305]: r2THR4eW003305: from=<root@maq1>, size=433, class=0, nrcpt
s=1, msgid=<201303291727.r2THR4o7003304@maq1>, proto=ESMTP, daemon=MTA, relay=localhost [127.
0.0.1]
Mar 29 14:30:05 maq1 sm-mta[3305]: r2THR4eW003305: to=<vivanguarda2@ig.com.br>, delay=00:00:0
0, mailer=relay, pri=30433, dsn=4.4.3, stat=queued
Mar 29 14:30:05 maq1 sendmail[3304]: r2THR4o7003304: to=vivanguarda2@ig.com.br, ctladdr=root
(0/0), delay=00:03:01, xdelay=00:03:01, mailer=relay, pri=30227, relay=[127.0.0.1] [127.0.0.1
], dsn=2.0.0, stat=Sent (r2THR4eW003305 Message accepted for delivery)
Mar 29 16:42:58 maq1 sendmail[3732]: gethostbyaddr(192.168.0.2) failed


What else I need to fix this difficult sending mail problem?

Kustom42 03-29-2013 06:33 PM

Well it looks like you have not yet enabled relaying for sendmail.


Here is a good article to read over that will give you some of the basic info for sendmail.

http://www.sendmail.com/sm/open_sour...smtp_relaying/

http://www.akadia.com/services/sendmail_relay.html -- Not official documentation put pretty on point and will give you a full example of a small sendmail setup.

eloi 03-30-2013 05:27 AM

In case you're talking about your home machine and that I understood what you want to do.

Unless your only interest is to learn sendmail configuration I would use a tool like msmtp (you will find it on slackbuilds.org) instead of using the smart host sendmail feature.

With msmtp you'll be able to use multiple external smtp servers and don't care about having a static IP a FQDN and a site CA (to avoid your emails go to SPAM).

vivanguarda 03-30-2013 12:29 PM

Problem is solved! I was trying to use it like a server. Then I tried to use like a client only and did another sendmail-slackware.mc for a client mode. Then I belive a changed line server for client in sendmail-slackware.mc edition was the point.

define(`confAUTH_OPTIONS', `A p y')dnl

Thanks a lot, Kustom42, eloi but specially Mike and TB0ne in this hard task!


All times are GMT -5. The time now is 12:27 PM.