Saturday, May 10, 2008

Sendmail for GMX communication

I configured the system to send the emails with the WAV attachments to an GMX email address.
Thats my sendmail.mc:

root@home-nas:~# cat /etc/mail/sendmail.mc
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`setup debian Linux')dnl
OSTYPE(`linux')dnl
dnl# DOMAIN(`debian-mta')dnl
dnl#
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`SMART_HOST',`mail.gmx.net')dnl
define(`confTO_IDENT', `0')dnl
define(`confCW_FILE', `-o /etc/mail/local-host-names')dnl
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl
define(`confNO_RCPT_ACTION', `add-to-undisclosed')dnl
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')dnl
define(`confLOG_LEVEL',15)dnl
FEATURE(`genericstable')dnl
FEATURE(`generics_entire_domain')dnl
FEATURE(`relay_hosts_only')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`access_db', `hash -T /etc/mail/access')dnl
FEATURE(`local_procmail',`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`redirect')dnl
FEATURE(`masquerade_entire_domain')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`always_add_domain',`gmx.net')dnl
EXPOSED_USER(`root')dnl
GENERICS_DOMAIN(`home-nas.lab.test')dnl
MASQUERADE_AS(`asterisk1.local')dnl
MASQUERADE_DOMAIN(`lab.test')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MAILER(local)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
root@home-nas:~#


My submit.mc:

root@home-nas:~# cat /etc/mail/submit.mc
divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: submit.mc,v 8.13.8 2006-09-30 07:18:48 cowboy Exp $
#
# Copyright (c) 2000-2005 Richard Nelson. All Rights Reserved.
#
# cf/debian/submit.mc. Generated from submit.mc.in by configure.
#
# submit.mc prototype config file for building Sendmail 8.13.8
#
# Note: the .in file supports 8.7.6 - 9.0.0, but the generated
# file is customized to the version noted above.
#
# This file is used to configure Sendmail for use with Debian systems.
#
# If you modify this file, you will have to regenerate /etc/mail/submit.cf
# by running this file through the m4 preprocessor via one of the following:
# * `sendmailconfig`
# * `make`
# * `m4 /etc/mail/submit.mc > /etc/mail/submit.cf`
# The first two options are preferred as they will also update other files
# that depend upon the contents of this file.
#
# The best documentation for this .mc file is:
# /usr/share/doc/sendmail-doc/cf.README.gz
#
#-----------------------------------------------------------------------------
divert(0)dnl
#
# Copyright (c) 2000-2002 Richard Nelson. All Rights Reserved.
#
# This file is used to configure Sendmail for use with Debian systems.
#
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: submit.mc, v 8.13.8-2 2006-09-30 07:18:48 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-msp')dnl
dnl #
dnl #---------------------------------------------------------------------
dnl # Masquerading information, if needed, should go here
dnl # You likely will not need this, as the MTA will do it
dnl #---------------------------------------------------------------------
dnl MASQUERADE_AS()dnl
dnl FEATURE(`masquerade_envelope')dnl
dnl #
dnl #---------------------------------------------------------------------
dnl # The real reason we're here: the FEATURE(msp)
dnl #---------------------------------------------------------------------
FEATURE(`msp', `[127.0.0.1]', `MSA')dnl
dnl #
dnl #---------------------------------------------------------------------
dnl # Some minor cleanup from FEATURE(msp)
dnl #---------------------------------------------------------------------
dnl #
dnl #---------------------------------------------------------------------
root@home-nas:~#


My client-info:

root@home-nas:~# cat /etc/mail/auth/client-info
Authinfo:mail.gmx.net "U:yaya@gmx.net" "I:yaya@gmx.net" "P:xxx" "R:gmx.net" "M:CRAM-MD5"
root@home-nas:~#


My access:

root@home-nas:~# cat /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
home-nas.lab.test RELAY

root@home-nas:~#


As mentioned before, I don't claim this to be an optimized configuration, but it works. Comments welcome.

2 comments:

pareclo said...

Relied on this when trying to get sendmail working on raspberry pi4, but unfortunately no luck.
No errors on output, but also nothing in mailbox :-(

pareclo said...

I'm testing with:

# echo "Subject: test" | /usr/lib/sendmail -v mail.adress@sld.tld

and then getting output:

mail.adress@sld.tld... Connecting to [127.0.0.1] via relay...
220 localhost.localadmin ESMTP Sendmail 8.15.2/8.15.2/Debian-14~deb10u1; Sat, 6 Feb 2021 22:21:10 +0100; (No UCE/UBE) logging access from: localhost.localadmin(OK)-localhost.localadmin [127.0.0.1]
>>> EHLO localhost.localadmin
250-localhost.localadmin Hello localhost.localadmin [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From: SIZE=14
250 2.1.0 ... Sender ok
>>> RCPT To:
>>> DATA
250 2.1.5 ... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 116LLAd9001885 Message accepted for delivery
mail.adress@sld.tld... Sent (116LLAd9001885 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localadmin closing connection

everything seems to go well, but nothing happens in my inbox