How to test sendmail?

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

ericchaves
Posts: 19
Joined: Thu Dec 31, 2009 7:44 pm

How to test sendmail?

Post by ericchaves »

Hi FOlks,

After installing the OpenEMM server, I created a mailing and send message to administrator recipient. OpenEMM page says everything is ok and messages was created but I never receive them.

So I was wondering:

1- Is there a way to test the sendmail installation without using openemm?
2- Which log files could I check in order to see what went wrong?

Thanks again for all the help and support.

Best regards,
pheelix
Posts: 101
Joined: Thu Nov 20, 2008 4:34 pm
Location: Dresden, Germany
Contact:

Post by pheelix »

/var/log/mail
or similar should tell you, what happened, whether email was delivered or not.
ericchaves
Posts: 19
Joined: Thu Dec 31, 2009 7:44 pm

Post by ericchaves »

Hi Pheelix,

From the logs it seems that connections are being deferred:

Code: Select all

Jan  2 13:30:11 emm sendmail[6722]: o02FU847006722: to=myemail@hotmail.com, ctladdr=eric (1000/1001), delay=00:00:03, xdelay=00:00:00, mailer=relay, pri=30006, relay=emm.XXX.com.br. [XXX.XXX.XXX.XXX], dsn=4.0.0, stat=Deferred: Connection refused by emm.XXX.com.br.
I'm also trying to issue a test from command line with "sendmail -v myemail@..." with the same deffered connection status.

Also, when I execute netstat -nl I don't see anything listening at port 25.

Code: Select all

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 127.0.0.1:8900          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:5166          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:53432           0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:59098           0.0.0.0:*
udp        0      0 0.0.0.0:111             0.0.0.0:*
udp        0      0 0.0.0.0:762             0.0.0.0:*
udp        0      0 XX.XXX.XXX.XXX:123      0.0.0.0:*
udp        0      0 127.0.0.1:123           0.0.0.0:*
udp        0      0 0.0.0.0:123             0.0.0.0:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     10762    /var/run/mysqld/mysqld.sock
unix  2      [ ACC ]     STREAM     LISTENING     15014    /home/openemm/var/run/bav.sock

Do you guys have any idea on what could be wrong on my configuration?

Code: Select all

divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.2-2build1 2008-01-24 14:29:57 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl #	into this directory before writing files.
dnl #	If *all* your user accounts are under /home then use that
dnl #	instead - it will prevent any writes outside of /home !
dnl #   define(`confSAFE_FILE_ENV',             `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
dnl #
FEATURE(`no_default_msa')dnl
#dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
dnl DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl
#dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
FEATURE(`use_cw_file')dnl
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
# added from the openEMM wiki page
FEATURE(`nouucp',`reject')dnl
FEATURE(`local_procmail')dnl
FEATURE(`mailertable')dnl
FEATURE(`relay_entire_domain')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
# from openEMM wiki page
MAILER(`procmail')dnl
INPUT_MAIL_FILTER(`bav',`S=unix:/home/openemm/var/run/bav.sock, F=T')dnl
Finally, apart from that I'm seeing the following message at maillog:

Code: Select all

Jan  2 13:29:17 emm sendmail[6614]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1765: Xbav: local socket name /home/openemm/var/run/bav.sock unsafe: Group writable directory
Should I change permissions on file?

Thanks in advance.
ericchaves
Posts: 19
Joined: Thu Dec 31, 2009 7:44 pm

Post by ericchaves »

Ok, found the error so far, and registering it here for future reference.

The problem was related to bav.socket error, which was caused because smctrl was not running setuid, as explained in http://www.openemm.org/forums/ftopic56.html

Code: Select all

chown -R openemm:openemm .bash* *
chown root:root bin/smctrl
chown root:root conf/bav/bav.rc
chmod 6755 bin/smctrl
chmod 0600 conf/bav/bav.rc
Also needed to install libxml2, which was not installed in my ubuntu by default.

After that everything seems to be is working like a charm.
friedbrain
Posts: 62
Joined: Tue Aug 25, 2009 8:17 am

Post by friedbrain »

Thanks for the tip!

@OpenEMM Team:

Code: Select all

chown -R openemm:openemm .bash* *
chown root:root bin/smctrl
chown root:root conf/bav/bav.rc
chmod 6755 bin/smctrl
chmod 0600 conf/bav/bav.rc
Why is this not included in the current install guide of OpenEMM 6.1?
maschoff
Site Admin
Posts: 2608
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

Because it is not necessary if you use option "p" for unpacking the tarball (see extra note in chapter 5, 2nd paragraph).
OpenEMM Maintainer
friedbrain
Posts: 62
Joined: Tue Aug 25, 2009 8:17 am

Post by friedbrain »

Argh. :oops:
Post Reply