Re: log subject of mail in maillog

2021-07-15 Thread William Ahern
On Thu, Jul 15, 2021 at 03:20:56PM +0200, Marcus MERIGHI wrote:
> Hello!
> 
> m...@protonmail.ch (mabi), 2021.07.15 (Thu) 08:16 (CEST):
> > I was wondering with OpenSMTPD if it is possible to log the subject of
> > the mail in the maillog? Currently the from/to are being logged and I
> > wanted to also log the subject if possible.
> 
> Daemons that handle the Simple Mail Transfer Protocol do not care about
> the content of the message. The Subject: ist part of the content, as
> seen from the POV of the smtpd. 
> 
> Spam filters and local delivery agents inspect the content, though.
> 
> I know you can make rspamd and dovecot-lda log the Subject:.
> 
> Marcus

Moreover, as a practical matter there's no singularly *correct* way to
identify the Subject header for malformed messages, which means the Subject
displayed by your MUA may not be the same identified by the MTA.

Mostly that's thanks to Microsoft Exchange and Outlook. The traditional way
to parse headers--as implemented by Sendmail and copied by *most*
software--is to stop at the first line that is neither a header continuation
(leading space) nor a valid start of header (field name + colon).[1] This
matches a proper end-of-headers delimiter (empty line), as well as when a
message begins without an end-of-headers break, usually with a line that
does not parse as a header.

Microsoft Exchange and Outlook, though, has alot of magic code to try to
catch malformed header continuations (i.e. missing leading space) for
Content-Type and similar headers. This means a malformed message can be
parsed two different ways depending on the MTA or MUA. This allows smuggling
not only different Subject headers, but entirely different bodies and
attachments as you can effectively present different Content-Type,
Content-Disposition, etc. headers to the parser.

Smart software should just do like Sendmail does. Or like GMail--which
parses like Sendmail but also triggers protective measures when
malformedness is detected (e.g. to help prevent sneaking a trojan attachment
past the GMail scanner through to Microsoft Exchange or Outlook).

But these are choices that can leave a large number of people dissatified.
Better to not put yourself in the position of having to make that choice if
you can help it, like when you're a simple MTA that focuses on SMTP, relying
on user plugins to handle any and all message parsing.

[1] Sendmail was also tolerant of a leading Unix "From " line as typically
inserted for Berkeley MBOX storage. Alot of older software also tolerates
this, but plenty doesn't and you rarely see this in the wild anymore.
Usually only locally if at all.



Re: log subject of mail in maillog

2021-07-15 Thread Marcus MERIGHI
Hello!

m...@protonmail.ch (mabi), 2021.07.15 (Thu) 08:16 (CEST):
> I was wondering with OpenSMTPD if it is possible to log the subject of
> the mail in the maillog? Currently the from/to are being logged and I
> wanted to also log the subject if possible.

Daemons that handle the Simple Mail Transfer Protocol do not care about
the content of the message. The Subject: ist part of the content, as
seen from the POV of the smtpd. 

Spam filters and local delivery agents inspect the content, though.

I know you can make rspamd and dovecot-lda log the Subject:.

Marcus



log subject of mail in maillog

2021-07-15 Thread mabi
Hello,

I was wondering with OpenSMTPD if it is possible to log the subject of the mail 
in the maillog? Currently the from/to are being logged and I wanted to also log 
the subject if possible.

Thank you.




[no subject]

2020-11-17 Thread Matthieu C
 Hi,

I am new to mail servers, and I ran into a nice tutorial from a French NGO.
However, I'd like to tweak a bit my configuration, and I cannot find a
proper way to achieve my goal: I want to discard mails whose recipient is
the address my_system_u...@my-domain.net (and r...@my-domain.net and so
on), while accepting mails to be routed to my_system_user, through a list
of aliases or virtual users. In fact, I want all the mails to go through
this system user, and to be read by a unique dovecot account (hence, I'd
say the simplest way to do is to have an unique Maildir?).

I created a thread on Stack Overflow for that matter:
https://stackoverflow.com/questions/64715521/prevent-mailing-to-my-username-in-opensmtp-config
; its content is below:

> I just set up my own mail server at home with OpenSMTP and Dovecot (I used 
> this
> tutorial
> 
> from Framasoft). I don't like the idea that people can mail to 
> *my_system_u...@my-domain.net
> * or *r...@my-domain.net
> * (or any other system user), although I'll use this
> only *my_system_user* account to receive my mails.
>
> That's why I added root: /dev/null and my_system_u...@my-domain.net:
> /dev/null to my /home/my_system_user/.myaliases file (+ makemap -t
> aliases ~/.myaliases). But I still receive the mails for 
> *my_system_u...@my-domain.net
> *. Maybe I shouldn't go through the hassle
> of preventing this?
>
> table aliases file:/etc/aliases
> table own_aliases file:/home/my_system_user/.myaliases
>
> pki mail.my-domain.net key 
> "/etc/letsencrypt/live/mail.my-domain.net/privkey.pem"
> pki mail.my-domain.net certificate 
> "/etc/letsencrypt/live/mail.my-domain.net/cert.pem"
>
> # Deliver
> listen on lo
> listen on lo port 10029 tag DKIM
> listen on lo port 10036 tag ANTISPAM
> listen on eth0 port 25  hostname mail.my-domain.net tls pki mail.my-domain.net
> listen on eth0 port 587 hostname mail.my-domain.net tls-require pki 
> mail.my-domain.net auth
>
> accept tagged ANTISPAM for any alias  deliver to maildir 
> "~/Maildir"
> accept from local for local alias  deliver to maildir "~/Maildir"
> #accept from any for domain "my-domain.net" alias  deliver to 
> maildir "~/Maildir"
>
> # antispam
> accept from any for domain "my-domain.net" relay via smtp://127.0.0.1:10035
>
> # Relay
> # dkim tagged can be sent
> accept tagged DKIM for any relay hostname mail.my-domain.net
> # if not dkim tagged, send it to dkimproxy
> accept from local for any relay via smtp://127.0.0.1:10028 hostname 
> mail.my-domain.net
>
> In my search, I found out that virtual users could be a solution (source)
> ,
> but it seems overkill to me (setting up a new *vmail* user, new password
> table, new services...): I have only one repicient account with multiple
> (~10) aliases.
>

Any help is appreciated!
Best regards,

choumat


Re: Subject prefixing

2020-02-13 Thread Edgar Pettijohn

On Feb 13, 2020 2:01 PM, Ionel GARDAIS  wrote:
>
> Hi list,
>
> I'm looking for an easy way to add a static prefix "[*EXT*]" to all incoming emails, as long as the subject does not already contains this string.
> OpenSMTPD is running as a filtering MX running senderscore filter.
> default action is relay to another host.
>
> Can OpenSMTPD modify the header conditionally ?
A filter could be written to do this.
> If so, should I add a filter to the existing "listen" line or should I add a new "listen" line with a dedicated filter and chaining listen->action relay to local listen->action relay to external ?
If you used a separate listen directive. It would have to be on a different port.
>
> Thanks,
> Ionel
>
>



Subject prefixing

2020-02-13 Thread Ionel GARDAIS
Hi list, 

I'm looking for an easy way to add a static prefix "[*EXT*]" to all incoming 
emails, as long as the subject does not already contains this string. 
OpenSMTPD is running as a filtering MX running senderscore filter. 
default action is relay to another host. 

Can OpenSMTPD modify the header conditionally ? 
If so, should I add a filter to the existing "listen" line or should I add a 
new "listen" line with a dedicated filter and chaining listen->action relay to 
local listen->action relay to external ? 

Thanks, 
Ionel 

--
232 avenue Napoleon BONAPARTE 92500 RUEIL MALMAISON
Capital EUR 219 300,00 - RCS Nanterre B 408 832 301 - TVA FR 09 408 832 301

[no subject]

2019-01-03 Thread Bryan Harris

set misc digest-weekly


--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org



[no subject]

2015-06-03 Thread Ultramedia Libertad
Hello,

I downloaded from here http://openports.se/mail/opensmtpd-extras
the port of OpenBSD openbsd-extras, because cvs I could not get.

install it like any other port.

opensmtpd time let me use mysql tables

debug: table-mysql: (re)connecting
warn: table-mysql: mysql_stmt_prepare: Unknown column 'source' in 'where clause'
lookup: check mydomain as DOMAIN in table proc:vdomains - -1

Any ideas?
-- 
editor de sueƱos

--
You received this mail because you are subscribed to misc@opensmtpd.org
To unsubscribe, send a mail to: misc+unsubscr...@opensmtpd.org