Sendmail: Difference between revisions
Line 113: | Line 113: | ||
# cat /tmp/sendmail.txt | sendmail -i -t | # cat /tmp/sendmail.txt | sendmail -i -t | ||
==mail headers== | |||
Accept-Language mail [RFC4021] | |||
Alternate-Recipient mail [RFC4021] | |||
Archived-At prov/archived-at mail standard [RFC5064] | |||
Authentication-Results mail standard [RFC7601] | |||
Auto-Submitted mail standard [RFC3834 section 5] | |||
Autoforwarded mail [RFC4021] | |||
Autosubmitted mail [RFC4021] | |||
Bcc mail standard [RFC5322] | |||
Cc mail standard [RFC5322] | |||
Comments mail standard [RFC5322] | |||
Content-Identifier mail [RFC4021] | |||
Content-Return mail [RFC4021] | |||
Conversion mail [RFC4021] | |||
Conversion-With-Loss mail [RFC4021] | |||
DL-Expansion-History mail [RFC4021] | |||
Date mail standard [RFC5322] | |||
Deferred-Delivery mail [RFC4021] | |||
Delivery-Date mail [RFC4021] | |||
Discarded-X400-IPMS-Extensions mail [RFC4021] | |||
Discarded-X400-MTS-Extensions mail [RFC4021] | |||
Disclose-Recipients mail [RFC4021] | |||
Disposition-Notification-Options mail [RFC4021] | |||
Disposition-Notification-To mail [RFC4021] | |||
DKIM-Signature mail standard [RFC6376] | |||
Downgraded-Bcc mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Cc mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Disposition-Notification-To mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Final-Recipient mail standard [RFC6857 Section 3.1.10] | |||
Downgraded-From mail obsoleted [RFC5504][RFC6857 Section 3.1.10] | |||
Downgraded-In-Reply-To mail standard [RFC6857 Section 3.1.10] | |||
Downgraded-Mail-From mail obsoleted [RFC5504][RFC6857 Section 3.1.10] | |||
Downgraded-Message-Id mail standard [RFC6857 Section 3.1.10] | |||
Downgraded-Original-Recipient mail standard [RFC6857 Section 3.1.10] | |||
Downgraded-Rcpt-To mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-References mail standard [RFC6857 Section 3.1.10] | |||
Downgraded-Reply-To mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-Bcc mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-Cc mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-From mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-Reply-To mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-Sender mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Resent-To mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Return-Path mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-Sender mail obsoleted [RFC5504][RFC6857] | |||
Downgraded-To mail obsoleted [RFC5504][RFC6857] | |||
Encoding mail [RFC4021] | |||
Encrypted mail [RFC4021] | |||
Expires mail [RFC4021] | |||
Expiry-Date mail [RFC4021] | |||
From mail standard [RFC5322][RFC6854] | |||
Generate-Delivery-Report mail [RFC4021] | |||
Importance mail [RFC4021] | |||
In-Reply-To mail standard [RFC5322] | |||
Incomplete-Copy mail [RFC4021] | |||
Keywords mail standard [RFC5322] | |||
Language mail [RFC4021] | |||
Latest-Delivery-Time mail [RFC4021] | |||
List-Archive mail [RFC4021] | |||
List-Help mail [RFC4021] | |||
List-ID mail [RFC4021] | |||
List-Owner mail [RFC4021] | |||
List-Post mail [RFC4021] | |||
List-Subscribe mail [RFC4021] | |||
List-Unsubscribe mail [RFC4021] | |||
Message-Context mail [RFC4021] | |||
Message-ID mail standard [RFC5322] | |||
Message-Type mail [RFC4021] | |||
MMHS-Exempted-Address mail [RFC6477][ACP123 Appendix A1.1 and Appendix B.105] | |||
MMHS-Extended-Authorisation-Info mail [RFC6477][ACP123 Appendix A1.2 and Appendix B.106] | |||
MMHS-Subject-Indicator-Codes mail [RFC6477][ACP123 Appendix A1.3 and Appendix B.107] | |||
MMHS-Handling-Instructions mail [RFC6477][ACP123 Appendix A1.4 and Appendix B.108] | |||
MMHS-Message-Instructions mail [RFC6477][ACP123 Appendix A1.5 and Appendix B.109] | |||
MMHS-Codress-Message-Indicator mail [RFC6477][ACP123 Appendix A1.6 and Appendix B.110] | |||
MMHS-Originator-Reference mail [RFC6477][ACP123 Appendix A1.7 and Appendix B.111] | |||
MMHS-Primary-Precedence mail [RFC6477][ACP123 Appendix A1.8 and Appendix B.101] | |||
MMHS-Copy-Precedence mail [RFC6477][ACP123 Appendix A1.9 and Appendix B.102] | |||
MMHS-Message-Type mail [RFC6477][ACP123 Appendix A1.10 and Appendix B.103] | |||
MMHS-Other-Recipients-Indicator-To mail [RFC6477][ACP123 Appendix A1.12 and Appendix B.113] | |||
MMHS-Other-Recipients-Indicator-CC mail [RFC6477][ACP123 Appendix A1.12 and Appendix B.113] | |||
MMHS-Acp127-Message-Identifier mail [RFC6477][ACP123 Appendix A1.14 and Appendix B.116] | |||
MMHS-Originator-PLAD mail [RFC6477][ACP123 Appendix A1.15 and Appendix B.117] | |||
MT-Priority mail standard [RFC6758] | |||
Obsoletes mail [RFC4021] | |||
Organization mail informational [RFC7681] | |||
Original-Encoded-Information-Types mail [RFC4021] | |||
Original-From mail standard [RFC5703] | |||
Original-Message-ID mail [RFC4021] | |||
Original-Recipient perm/original-recipient mail standard [RFC3798][RFC5337] | |||
Originator-Return-Address mail [RFC4021] | |||
Original-Subject mail standard [RFC5703] | |||
PICS-Label mail [RFC4021] | |||
Prevent-NonDelivery-Report mail [RFC4021] | |||
Priority mail [RFC4021] | |||
Received mail standard [RFC5322][RFC5321] | |||
Received-SPF mail standard [RFC7208] | |||
References mail standard [RFC5322] | |||
Reply-By mail [RFC4021] | |||
Reply-To mail standard [RFC5322] | |||
Require-Recipient-Valid-Since mail standard [RFC7293] | |||
Resent-Bcc mail standard [RFC5322] | |||
Resent-Cc mail standard [RFC5322] | |||
Resent-Date mail standard [RFC5322] | |||
Resent-From mail standard [RFC5322][RFC6854] | |||
Resent-Message-ID mail standard [RFC5322] | |||
Resent-Reply-To mail obsoleted [RFC5322] | |||
Resent-Sender mail standard [RFC5322][RFC6854] | |||
Resent-To mail standard [RFC5322] | |||
Return-Path mail standard [RFC5322] | |||
Sender mail standard [RFC5322][RFC6854] | |||
Sensitivity mail [RFC4021] | |||
Solicitation mail [RFC3865] | |||
Subject mail standard [RFC5322] | |||
Supersedes mail [RFC4021] | |||
To mail standard [RFC5322] | |||
VBR-Info mail standard [RFC5518] | |||
X400-Content-Identifier mail [RFC4021] | |||
X400-Content-Return mail [RFC4021] | |||
X400-Content-Type mail [RFC4021] | |||
X400-MTS-Identifier mail [RFC4021] | |||
X400-Originator mail [RFC4021] | |||
X400-Received mail [RFC4021] | |||
X400-Recipients mail [RFC4021] | |||
X400-Trace mail [RFC4021] | |||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Unix]] | [[Category:Unix]] |
Revision as of 14:27, 1 February 2016
resend mails
sendmail -q -v
delete mails from a recipiant
sendmail -qR -v hotmail.com
Who owns mails with problem
mailq | grep @ | grep -v ^k | cut -d \< -f 2 | cut -d @ -f2 | awk '{print $1}' | sort | uniq -c | sort -n | grep -v `hostname` | cut -d \> -f 1| tail
send mail with netcat
[user@host]# telnet smtp.domain.com 25 Trying 192.168.0.1... Connected to smtp.domain.com (192.168.0.1). Escape character is '^]'. 220 myrelay.domain.com ESMTP HELO smtp.domain.com 250 myrelay.domain.com MAIL FROM:<alice@hacker.com> 250 sender <alice@hacker.com> ok RCPT TO:<bob@secure.net> 250 recipient <bob@secure.net> ok DATA 354 go ahead From: [Alice Hacker] <alice@hacker.com> To: [Bob Smith] <bob@secure.net> Date: Mon, 12 Apr 2010 14:21:26 -0400 Subject: Test Message Hi there! This is supposed to be a real email... Have a good day! Alice . 250 ok: Message 222220902 accepted QUIT 221 myrelay.domain.com Connection closed by foreign host.
SMTP servers for internet providers
mailrelay.bostream.com smtp smtp.bredband.net smtp
smarthost
set smarthost and domain. /etc/mail/sendmail.mc define(`SMART_HOST', `smtp.bredband.net')
LOCAL_DOMAIN(`www.halfface.se')dnl
sendmail listen on all network interfaces
Enable smtp on all interfaces.
/etc/mail/sendmail.mc DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl
Usermappings
/etc/mail/virtusertable
anden@halfface.se bjorklun andreas.bjorklund@halfface.se bjorklun stannaks@halfface.se stannaks none@halfface.se error:nouser 550 No such user here wrong@halfface.se error:5.7.0:550 Address invalid @halfface.se bjorklun anna-karin@sivberg.se stannaks @sivberg.se stannaks @mobbad. bjorklun @anden.homeip.net bjorklun
aliases for your host
<verbatim> /etc/mail/local-host-names
anden.homeip.net www.halfface.se halfface.se www.mobbad.nu mobbad.nu www.sivberg.se sivberg.se
Access rights. Who can send mail and username and password at www.bredband.net smtp server.
<verbatim> /etc/mail/access
localhost.localdomain RELAY localhost RELAY 127.0.0.1 RELAY 192.168.2.1 RELAY 192.168.3.1 RELAY AuthInfo:smtp.bredband.net "U:b586378" "I:b586378" "P:??????" "M:LOGIN PLAIN"
Forward a copy of email.
~/.forward
\bjorklun andreas.bjorklund@infineon.com
sending mail from command line
From: "From hoever" <email@inter.net> To: "Andreas halfface Bjorklund" <email@inter.net> Subject: Test Email MIME-Version: 1.0 Content-Type: text/plain Andreas Bjorklund doing test. anden@halfface.se # cat /tmp/sendmail.txt | sendmail -i -t
mail headers
Accept-Language mail [RFC4021] Alternate-Recipient mail [RFC4021] Archived-At prov/archived-at mail standard [RFC5064] Authentication-Results mail standard [RFC7601] Auto-Submitted mail standard [RFC3834 section 5] Autoforwarded mail [RFC4021] Autosubmitted mail [RFC4021] Bcc mail standard [RFC5322] Cc mail standard [RFC5322] Comments mail standard [RFC5322] Content-Identifier mail [RFC4021] Content-Return mail [RFC4021] Conversion mail [RFC4021] Conversion-With-Loss mail [RFC4021] DL-Expansion-History mail [RFC4021] Date mail standard [RFC5322] Deferred-Delivery mail [RFC4021] Delivery-Date mail [RFC4021] Discarded-X400-IPMS-Extensions mail [RFC4021] Discarded-X400-MTS-Extensions mail [RFC4021] Disclose-Recipients mail [RFC4021] Disposition-Notification-Options mail [RFC4021] Disposition-Notification-To mail [RFC4021] DKIM-Signature mail standard [RFC6376] Downgraded-Bcc mail obsoleted [RFC5504][RFC6857] Downgraded-Cc mail obsoleted [RFC5504][RFC6857] Downgraded-Disposition-Notification-To mail obsoleted [RFC5504][RFC6857] Downgraded-Final-Recipient mail standard [RFC6857 Section 3.1.10] Downgraded-From mail obsoleted [RFC5504][RFC6857 Section 3.1.10] Downgraded-In-Reply-To mail standard [RFC6857 Section 3.1.10] Downgraded-Mail-From mail obsoleted [RFC5504][RFC6857 Section 3.1.10] Downgraded-Message-Id mail standard [RFC6857 Section 3.1.10] Downgraded-Original-Recipient mail standard [RFC6857 Section 3.1.10] Downgraded-Rcpt-To mail obsoleted [RFC5504][RFC6857] Downgraded-References mail standard [RFC6857 Section 3.1.10] Downgraded-Reply-To mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-Bcc mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-Cc mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-From mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-Reply-To mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-Sender mail obsoleted [RFC5504][RFC6857] Downgraded-Resent-To mail obsoleted [RFC5504][RFC6857] Downgraded-Return-Path mail obsoleted [RFC5504][RFC6857] Downgraded-Sender mail obsoleted [RFC5504][RFC6857] Downgraded-To mail obsoleted [RFC5504][RFC6857] Encoding mail [RFC4021] Encrypted mail [RFC4021] Expires mail [RFC4021] Expiry-Date mail [RFC4021] From mail standard [RFC5322][RFC6854] Generate-Delivery-Report mail [RFC4021] Importance mail [RFC4021] In-Reply-To mail standard [RFC5322] Incomplete-Copy mail [RFC4021] Keywords mail standard [RFC5322] Language mail [RFC4021] Latest-Delivery-Time mail [RFC4021] List-Archive mail [RFC4021] List-Help mail [RFC4021] List-ID mail [RFC4021] List-Owner mail [RFC4021] List-Post mail [RFC4021] List-Subscribe mail [RFC4021] List-Unsubscribe mail [RFC4021] Message-Context mail [RFC4021] Message-ID mail standard [RFC5322] Message-Type mail [RFC4021] MMHS-Exempted-Address mail [RFC6477][ACP123 Appendix A1.1 and Appendix B.105] MMHS-Extended-Authorisation-Info mail [RFC6477][ACP123 Appendix A1.2 and Appendix B.106] MMHS-Subject-Indicator-Codes mail [RFC6477][ACP123 Appendix A1.3 and Appendix B.107] MMHS-Handling-Instructions mail [RFC6477][ACP123 Appendix A1.4 and Appendix B.108] MMHS-Message-Instructions mail [RFC6477][ACP123 Appendix A1.5 and Appendix B.109] MMHS-Codress-Message-Indicator mail [RFC6477][ACP123 Appendix A1.6 and Appendix B.110] MMHS-Originator-Reference mail [RFC6477][ACP123 Appendix A1.7 and Appendix B.111] MMHS-Primary-Precedence mail [RFC6477][ACP123 Appendix A1.8 and Appendix B.101] MMHS-Copy-Precedence mail [RFC6477][ACP123 Appendix A1.9 and Appendix B.102] MMHS-Message-Type mail [RFC6477][ACP123 Appendix A1.10 and Appendix B.103] MMHS-Other-Recipients-Indicator-To mail [RFC6477][ACP123 Appendix A1.12 and Appendix B.113] MMHS-Other-Recipients-Indicator-CC mail [RFC6477][ACP123 Appendix A1.12 and Appendix B.113] MMHS-Acp127-Message-Identifier mail [RFC6477][ACP123 Appendix A1.14 and Appendix B.116] MMHS-Originator-PLAD mail [RFC6477][ACP123 Appendix A1.15 and Appendix B.117] MT-Priority mail standard [RFC6758] Obsoletes mail [RFC4021] Organization mail informational [RFC7681] Original-Encoded-Information-Types mail [RFC4021] Original-From mail standard [RFC5703] Original-Message-ID mail [RFC4021] Original-Recipient perm/original-recipient mail standard [RFC3798][RFC5337] Originator-Return-Address mail [RFC4021] Original-Subject mail standard [RFC5703] PICS-Label mail [RFC4021] Prevent-NonDelivery-Report mail [RFC4021] Priority mail [RFC4021] Received mail standard [RFC5322][RFC5321] Received-SPF mail standard [RFC7208] References mail standard [RFC5322] Reply-By mail [RFC4021] Reply-To mail standard [RFC5322] Require-Recipient-Valid-Since mail standard [RFC7293] Resent-Bcc mail standard [RFC5322] Resent-Cc mail standard [RFC5322] Resent-Date mail standard [RFC5322] Resent-From mail standard [RFC5322][RFC6854] Resent-Message-ID mail standard [RFC5322] Resent-Reply-To mail obsoleted [RFC5322] Resent-Sender mail standard [RFC5322][RFC6854] Resent-To mail standard [RFC5322] Return-Path mail standard [RFC5322] Sender mail standard [RFC5322][RFC6854] Sensitivity mail [RFC4021] Solicitation mail [RFC3865] Subject mail standard [RFC5322] Supersedes mail [RFC4021] To mail standard [RFC5322] VBR-Info mail standard [RFC5518] X400-Content-Identifier mail [RFC4021] X400-Content-Return mail [RFC4021] X400-Content-Type mail [RFC4021] X400-MTS-Identifier mail [RFC4021] X400-Originator mail [RFC4021] X400-Received mail [RFC4021] X400-Recipients mail [RFC4021] X400-Trace mail [RFC4021]