OVH Cloud OVH Cloud

config sendmail

1 réponse
Avatar
Thierry
Bonsoir;
J'aimerai faire fonctionner sendmail sur un portable + FreeBSD 5.1.
Habituellement j'utilise ssmtp+fetchmail+procmail et mutt comme client.
Mais là j'ai besoin de sendmail ...

Je cherche tout simplement à envoyer des mails, c'est tout, donc je
cherche à faire un fichier de config très basic.

Lorsque j'envoie un mail apres avoir fait un make restart, j'ai :

Feb 1 18:19:49 <mail.info> mael sm-mta[2503]: restarting /usr/sbin/sendmail due to signal
Feb 1 18:19:49 <mail.info> mael sm-msp-queue[2501]: restarting /usr/sbin/sendmail due to signal
Feb 1 18:19:49 <mail.warn> mael sm-mta[2503]: gethostbyaddr(xxx.xxx.x.x) failed: 1
Feb 1 18:19:49 <mail.info> mael sm-msp-queue[2607]: starting daemon (8.12.9p1): queueing@00:30:00
Feb 1 18:19:49 <mail.info> mael sm-mta[2609]: starting daemon (8.12.9p1): SMTP+queueing@00:30:00


Feb 1 18:20:38 <mail.info> mael sendmail[2663]: i11HKcEN002663: from=tst, size=529, class=0, nrcpts=1, msgid=<20040201172037.GA2647@mael>, relay=tst@localhost
Feb 1 18:20:43 <mail.info> mael sm-mta[2664]: i11HKhn1002664: from=<toto@mael.my.domain>, size=692, class=0, nrcpts=1, msgid=<20040201172037.GA2647@mael>, proto=E
SMTP, daemon=MTA, relay=mael [127.0.0.1]
Feb 1 18:20:43 <mail.info> mael sendmail[2663]: i11HKcEN002663: to=test@isp.com, ctladdr=tst (1001/1001), delay=00:00:05, xdelay=00:00:05, mailer=relay, pri=30405
, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (i11HKhn1002664 Message accepted for delivery)
Feb 1 18:20:46 <mail.info> maelenn sm-mta[2666]: i11HKhn1002664: to=<test@isp.fr>, ctladdr=<tst@mael.my.domain> (1001/1001), delay=00:00:03, xdelay=00:00:03, mail
er=relay, pri=30568, relay=smtp.isp.com. [xxx.xxx.xx.xx], dsn=5.1.3, stat=User unknown
Feb 1 18:20:46 <mail.info> mael sm-mta[2666]: i11HKhn1002664: i11HKkn1002666: DSN: User unknown
Feb 1 18:20:51 <mail.info> mael sm-mta[2666]: i11HKkn1002666: to=<toto@mael.my.domain>, delay=00:00:05, xdelay=00:00:05, mailer=local, pri=31716, dsn=2.0.0, stat=
Sent

mon fichier de config sendmail:

divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.28 2003/04/18 01:25:41 gshapiro Exp $')
OSTYPE(freebsd5)
DOMAIN(generic)

FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
define(`PROCMAIL_MAILER_PATH', `/usr/local/bin/procmail')
FEATURE(local_procmail)
FEATURE(masquerade_envelope)
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')
MASQUERADE_AS(`mail.maelenn.org')

dnl Uncomment to allow relaying based on your MX records.
dnl NOTE: This can allow sites to use your server as a backup MX without
dnl your permission.
dnl FEATURE(relay_based_on_MX)

dnl DNS based black hole lists
dnl --------------------------------
dnl DNS based black hole lists come and go on a regular basis
dnl so this file will not serve as a database of the available servers.
dnl For that, visit
dnl http://directory.google.com/Top/Computers/Internet/Abuse/Spam/Blacklists/

dnl Uncomment to activate Realtime Blackhole List
dnl information available at http://www.mail-abuse.com/
dnl NOTE: This is a subscription service as of July 31, 2001
dnl FEATURE(dnsbl)
dnl Alternatively, you can provide your own server and rejection message:
dnl FEATURE(dnsbl, `blackholes.mail-abuse.org', `"550 Mail from " $&{client_addr} " rejected, see http://mail-abuse.org/cgi-bin/lookup?" $&{client_addr}')

dnl Dialup users should uncomment and define this appropriately
dnl define(`SMART_HOST', `smtp.wanadoo.fr')

dnl Uncomment the first line to change the location of the default
dnl /etc/mail/local-host-names and comment out the second line.
dnl define(`confCW_FILE', `-o /etc/mail/sendmail.cw')
define(`confCW_FILE', `-o /etc/mail/local-host-names')

dnl Uncomment both of the following lines to listen on IPv6 as well as IPv4
dnl DAEMON_OPTIONS(`Name=IPv4, Family=inet')
dnl DAEMON_OPTIONS(`Name=IPv6, Family=inet6')

define(`SMART_HOST', `smtp.wanadoo.fr')
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
MAILER(local)
MAILER(smtp)

Merci pour vos infos.

Thierry

1 réponse

Avatar
Thibaut Maquet
Salut,

Lorsque j'envoie un mail apres avoir fait un make restart, j'ai :

Feb 1 18:19:49 <mail.info> mael sm-mta[2503]: restarting /usr/sbin/sendmail due to signal
Feb 1 18:19:49 <mail.info> mael sm-msp-queue[2501]: restarting /usr/sbin/sendmail due to signal
Feb 1 18:19:49 <mail.warn> mael sm-mta[2503]: gethostbyaddr(xxx.xxx.x.x) failed: 1
Feb 1 18:19:49 <mail.info> mael sm-msp-queue[2607]: starting daemon (8.12.9p1): :30:00
Feb 1 18:19:49 <mail.info> mael sm-mta[2609]: starting daemon (8.12.9p1): SMTP+:30:00


Bon, ca démarre, c'est déjà ça ;-)
Tu as une erreur sur le gethostbyaddr(), parce que ton adresse IP n'est pas résolue, rajoutes là dans ton /etc/hosts

Feb 1 18:20:38 <mail.info> mael sendmail[2663]: i11HKcEN002663: from=tst, sizeR9, class=0, nrcpts=1,
msgid=, relay=


Ca marchera pas en sortie, car l'adresse source ne peut pas être résolue.

Feb 1 18:20:43 <mail.info> mael sendmail[2663]: i11HKcEN002663: to=, ctladdr=tst (1001/1001), delay:00:05,
xdelay:00:05, mailer=relay, pri0405, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (i11HKhn1002664 Message accepted for

delivery)

isp.com est donc local ?

Feb 1 18:20:43 <mail.info> mael sm-mta[2664]: i11HKhn1002664: from=, sizei2, class=0, nrcpts=1,
msgid=, proto=ESMTP, daemon=MTA, relay=mael [127.0.0.1]

Feb 1 18:20:46 <mail.info> maelenn sm-mta[2666]: i11HKhn1002664: to=, ctladdr= (1001/1001),
delay:00:03, xdelay:00:03, mailer=relay, pri0568, relay=smtp.isp.com. [xxx.xxx.xx.xx], dsn=5.1.3, stat=User unknown

Feb 1 18:20:46 <mail.info> mael sm-mta[2666]: i11HKhn1002664: i11HKkn1002666: DSN: User unknown


Cela a l'air de fonctionner, mais n'existe pas.

Feb 1 18:20:51 <mail.info> mael sm-mta[2666]: i11HKkn1002666: to=, delay:00:05, xdelay:00:05,
mailer=local, pri1716, dsn=2.0.0, stat= Sent


Le bounce de l'utilisateur qui n'existe pas.


mon fichier de config sendmail:

divert(0)
VERSIONID(`$FreeBSD: src/etc/sendmail/freebsd.mc,v 1.28 2003/04/18 01:25:41 gshapiro Exp $')
OSTYPE(freebsd5)
DOMAIN(generic)

FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)

FEATURE(mailertable, `hash -o /etc/mail/mailertable')
Inutile dans ton cas


FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
Pas franchement utile si tu n'as qu'un domaine local


define(`PROCMAIL_MAILER_PATH', `/usr/local/bin/procmail')
FEATURE(local_procmail)
FEATURE(masquerade_envelope)

FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')
Inutile + inutile


MASQUERADE_AS(`mail.maelenn.org')
<SNIP> <SNIP>


define(`confCW_FILE', `-o /etc/mail/local-host-names')
Dedans, mets y ton domaine local


define(`SMART_HOST', `smtp.wanadoo.fr')
Oui, mais c'est mieux comme ca:


define(`SMART_HOST', `esmtp:[smtp.wanadoo.fr]')

define(`confBIND_OPTS', `WorkAroundBrokenAAAA')
define(`confNO_RCPT_ACTION', `add-to-undisclosed')
define(`confPRIVACY_FLAGS', `authwarnings,noexpn,novrfy')
MAILER(local)
MAILER(smtp)
Oui.


Cordialement
Thibaut Maquet
www.pagasa.net