Can NethServer show emails that have been sent via an external device (Photocopier)?

Eg - A user NethServer account (Photocopier) is setup and other users in Webtop have access to the account via Webtop sharing.

When the photocopier relays via NethServer I would like the sent emails from the photocopier to show up in Webtop Photocopier > Sent

@markareait

Hi Mark

No matter what you call the account, what’s actually happening is:

Photocopierer sends mail via SMTP (It’s NOT relaying!).
NethServer “photocopierer” account is listed as reciepient, so mails will be put in Inbox, NOT in sent!

-> If this is a shared account, others will be able to see the incoming mails. As only the photocopierer sends mail, I’d limit this account to “internal only”.

It just won’t be in “sent”, but in “inbox”!

My 2 cents
Andy

Thanks Andy,

To clarify what I need to achieve is the Photocopier emails an external party via NethServer account (via an account eg photocopier@ ) I need a local copy of that email able to be referenced in the future by other users.

The Photcopier does not have a bcc function.

So far I have not been able to find a solution. Any suggestions?

Update the firmware for the MFP
 Maybe a BCC field will appear.
Or configure the MFP to send only to a mailbox, which should be manually routed to other mailboxes.

@markareait

Hi

Not too hard


Create a “relay” account for each external reciepient, eg relay_client_a.
The photocopierer sends mails here (for this specific target).
This account has a rule (Set this with Roundcube, this works for all mail systems on NethServer), forwarding all incoming mails to the intended external reciepient - and also to your internal archive.
Here you do have the option for BCC
 :slight_smile:

-> You can also use this account as archive specific for this reciepient. (Then shared!).

My 2 cents
Andy

Thanks Michael and Andy,

I do have other use cases as well include ERP package that sends to many accounts. I was hoping for a solution of just being able to see emails sent from an account. A Gmail will do it without any extra config.

1 Like

@markareait

You’re lucky you can use Gmail - in a lot of cases, it would not be legal in Switzerland to send business mail (or even use Gmail).

I’d lose a lot of clients if I even were to suggest something like that!

See also this about BCC in NethServer:
https://docs.nethserver.org/en/v7/mail.html

NethServer allows storing an hidden copy of all messages directed to a particular domain: they will be delivered to the final recipient and also to a custom email address. The hidden copy is enabled by the Copy inbound messages switch (formerly Always send a copy (Bcc) check box).

My 2 cents
Andy

Many softwares or devices allow you to send mails by relying on the company e-mail server.

The problem is that they don’t make a copy of the mails sent in “Sent Mail” of the account used if you use direct sending via SMTP.

Or you need to edit the sent email, in this case the email should go to “Drafts” of the account but not sent immediately, so you can allow the user to edit it and then send it independently.

In the case of the presence of mail client via Web like Webtop, the problem is definitely manifested because usually people try to avoid installing a mail client on their PCs.

It’s possible to configure Nethserver NG 7.x, and especially Postfix, to perform this operation automatically.

Postfix will listen on the non-standard ports 1587 or 1465 to which the sending agents must point.

In case the mails should end up in “Drafts” without being sent immediately, the agent must point to ports 2587 or2465.

By receiving mails on those ports, Postfix will also make a copy of those mails in the “Sent Items” of the corresponding accounts.

Edit the Postfix configuration file /etc/postfix/master.cf creating the template-custom

mkdir -p /etc/e-smith/templates-custom/etc/postfix/master.cf
cd /etc/e-smith/templates-custom/etc/postfix/master.cf

add the template-custom

vi 55submission

and insert in 55submission the lines

#
# 55submission

#
# Send mail and make a copy in Sent folder
# TCP ports 1587 (submission), 1465 (smtps) listeners
#

0.0.0.0:1587 inet n       -       n       -       -       smtpd
{
    $OUT = join("\n", map { "  -o " . $_ } @submission_smtpd_options);
}
  -o content_filter=sendandcopyinsent:

0.0.0.0:1465   inet	n	-	n	-	-	smtpd
  -o smtpd_tls_wrappermode=yes
{
    $OUT = join("\n", map { "  -o " . $_ } @submission_smtpd_options);
}
  -o content_filter=sendandcopyinsent:

sendandcopyinsent      unix    -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/var/lib/nethserver/filters/sendandcopyinsent -f $\{sender\} -- $\{recipient\}


#
# DO NOT Send mail and make a copy in Drafts folder
# TCP ports 2587 (submission), 2465 (smtps) listeners
#

0.0.0.0:2587 inet n       -       n       -       -       smtpd
{
    $OUT = join("\n", map { "  -o " . $_ } @submission_smtpd_options);
}
  -o content_filter=copyindrafts:

0.0.0.0:2465   inet	n	-	n	-	-	smtpd
  -o smtpd_tls_wrappermode=yes
{
    $OUT = join("\n", map { "  -o " . $_ } @submission_smtpd_options);
}
  -o content_filter=copyindrafts:

copyindrafts      unix    -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/var/lib/nethserver/filters/copyindrafts -f $\{sender\} -- $\{recipient\}

Expand and activate editing by typing

expand-template /etc/postfix/master.cf
postfix reload

Create the sendandcopyinsent filter that will handle the copy

mkdir -p /var/lib/nethserver/filters
cd /var/lib/nethserver/filters

vi sendandcopyinsent

and insert in sendandcopyinsent the lines

#!/bin/sh
 
# Simple shell-based filter. It is meant to be invoked as follows:
#       /path/to/script -f sender recipients...

# Localize these. The -G option does nothing before Postfix 2.3.
INSPECT_DIR=/var/spool/filter
SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
 
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
 
# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15
 
# Start processing.
cd $INSPECT_DIR || {
    echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
 
cat >in.$$ || { 
    echo Cannot save mail to file; exit $EX_TEMPFAIL; }

# Specify your content filter here.
/usr/libexec/dovecot/dovecot-lda -f $2 -d $2 -m "Sent" <in.$$ || {
   echo Message content rejected; exit $EX_UNAVAILABLE; }

$SENDMAIL "$@" <in.$$

exit $?

Create the copyindrafts filter that will handle the copy

mkdir -p /var/lib/nethserver/filters
cd /var/lib/nethserver/filters

vi copyindrafts

and insert in copyindrafts the lines

#!/bin/sh
 
# Simple shell-based filter. It is meant to be invoked as follows:
#       /path/to/script -f sender recipients...

# Localize these. The -G option does nothing before Postfix 2.3.
INSPECT_DIR=/var/spool/filter
SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
 
# Exit codes from <sysexits.h>
EX_TEMPFAIL=75
EX_UNAVAILABLE=69
 
# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15
 
# Start processing.
cd $INSPECT_DIR || {
    echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
 
cat >in.$$ || { 
    echo Cannot save mail to file; exit $EX_TEMPFAIL; }

# Specify your content filter here.
/usr/libexec/dovecot/dovecot-lda -f $2 -d $2 -m "Drafts" <in.$$ || {
   echo Message content rejected; exit $EX_UNAVAILABLE; }

#$SENDMAIL "$@" <in.$$

exit $?

Set permissions to sendandcopyinsent and copyindrafts

cd /var/lib/nethserver/filters    
chmod 755 sendandcopyinsent copyindrafts
chown vmail:vmail sendandcopyinsent copyindrafts

Create the support directory /var/spool/filter

mkdir -p /var/spool/filter
chown vmail:vmail /var/spool/filter

Create a firewall rule to open ports 1587, 1465, 2587 and 2465 to trusted networks (green)

config set fw_sendandcopy service status enabled TCPPorts 1587,1465,2587,2465 access green
signal-event firewall-adjust
signal-event runlevel-adjust

If you want to open ports to untrusted networks as well (e.g. reds)

config set fw_sendandcopy service status enabled TCPPorts 1587,1465,2587,2465 access green,red
signal-event firewall-adjust
signal-event runlevel-adjust

Mail sending agents on programs, applications and devices will have to be configured to use non-custom ports so, if for example they used 465, they will have to be configured to use 1465 (if you want the email to be sent immediately and put a copy in “sent mail”) or 2465 (if you want the email to be put in “drafts” of the account so that it can be edited manually but not sent immediately), and they will follow the account authentication rules set on Nethserver as on normal ports.

Reference: http://www.postfix.org/FILTER_README.html

6 Likes

IMVHO this should be
 a great feature!. Raising the dev call


I also made a filter that copies the email to “drafts” without sending it directly.
I don’t have the instructions handy but as soon as I can, I’ll update the post.

EDIT: Post updated!

I hope that Nethesis will agree with me about this “nice” SMTP tool :wink:

Nethesis already knows that I made these scripts. The request to be able to insert Webtop’s signatures in an email that is in drafts but not generated by Webtop itself came from a request I made to satisfy a client of mine to whom I installed these scripts.

Thanks Saito Benkei, I second this is a great feature and to raising a Dev call.

I can report the [saitobenkei] solution worked so far for all I have tested it with except for when I tried with Flectra outgoing emails.

I have attached two NethServer email logs from two test below, the first log is the test is with standard port 465 and the second log is from the test with port 1465 which fails to send any emails. I have made a break and added a note where the two test start to be different.

The NethServer administrator receives an error message “Undelivered Mail Returned to Sender”
Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; Message content rejected

It looks to be failing at a Rspamd process, but in the history in the Rspamd interface there is no indication of an issue.

Has anyone got any suggestions?

– Below - NethServer email log of email send via port 465 - which is working –

Aug 28 17:05:23 emails postfix/smtpd[26076]: connect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:05:23 emails rspamd[22678]: <96bc0c>; proxy; proxy_accept_socket: accepted milter connection from /var/run/rspamd/worker-proxy port 0
Aug 28 17:05:23 emails rspamd[22678]: <96bc0c>; milter; rspamd_milter_process_command: got connection from [removed - my IP address]:44392
Aug 28 17:05:23 emails postfix/smtpd[26076]: disconnect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:05:23 emails rspamd[22678]: <96bc0c>; proxy; proxy_milter_finish_handler: finished milter connection
Aug 28 17:05:49 emails postfix/smtpd[26076]: connect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; proxy_accept_socket: accepted milter connection from /var/run/rspamd/worker-proxy port 0
Aug 28 17:05:49 emails postfix/smtpd[26076]: 89360D9D44: client=74.8.233.220.static.exetel.com.au[[removed - my IP address]], sasl_method=PLAIN, sasl_username=[removed - email address senting from]
Aug 28 17:05:49 emails rspamd[22678]: ; milter; rspamd_milter_process_command: got connection from [removed - my IP address]:44394
Aug 28 17:05:49 emails postfix/cleanup[26153]: 89360D9D44: message-id=281009409502812.1630134349.256407022476196-flectra-private@aits-ub
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_message_parse: loaded message; id: 281009409502812.1630134349.256407022476196-flectra-private@aits-ub; queue-id: <89360D9D44>; size: 1047; checksum:
Aug 28 17:05:49 emails rspamd[22678]: ; lua; settings.lua:363: 281009409502812.1630134349.256407022476196-flectra-private@aits-ub apply static settings authenticated (id = 1937017268); authenticated matched; priority high
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; dkim_symbol_callback: skip DKIM checks for local networks and authorized users
Aug 28 17:05:49 emails rspamd[22678]: ; lua; spf.lua:185: skip SPF checks for local networks and authorized users
Aug 28 17:05:49 emails rspamd[22678]: ; lua; dmarc.lua:596: skip DMARC checks as either SPF or DKIM were not checked
Aug 28 17:05:49 emails rspamd[22678]: ; lua; once_received.lua:99: Skipping once_received for authenticated user or local network
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; lua_task_insert_result_common: symbol insertion issue: unknown symbol GENERIC_REPUTATION; trace: [1]:{/usr/share/rspamd/plugins/reputation.lua:83 - add_symbol_score [Lua]}; [2]:{/usr/share/rspamd/plugins/reputation.lua:645 - continuation_cb [Lua]}; [3]:{/usr/share/rspamd/plugins/reputation.lua:929 - callback [Lua]}; [4]:{/usr/share/rspamd/lualib/lua_redis.lua:1296 - callback [Lua]}; [5]:{/usr/share/rspamd/lualib/lua_redis.lua:917 - [Lua]};
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_SPAM of classifier bayes: not enough learns 38; 200 required
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_HAM of classifier bayes: not enough learns 32; 200 required
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_stat_classifiers_process: skip statistics as SPAM class is missing
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_task_write_log: id: 281009409502812.1630134349.256407022476196-flectra-private@aits-ub, qid: <89360D9D44>, ip: [removed - my IP address], user: [removed - email address senting from], from: <bounce@[removed - my domain]>, (default: F (no action): [3.30/20.00] [CTYPE_MIXED_BOGUS(1.00){},MIME_BASE64_TEXT_BOGUS(1.00){},MID_RHS_NOT_FQDN(0.50){},R_PARTS_DIFFER(0.50){100.0%;},FORGED_SENDER(0.30){[removed - email address senting to];bounce@[removed - my domain];},MIME_BASE64_TEXT(0.10){},MIME_GOOD(-0.10){multipart/mixed;multipart/alternative;text/plain;},ASN(0.00){asn:10143, ipnet:220.233.8.0/21, country:AU;},FROM_HAS_DN(0.00){},FROM_NEQ_ENVFROM(0.00){[removed - email address senting to];bounce@[removed - my domain];},GENERIC_REPUTATION(0.00){-0.39521405646944;},HAS_REPLYTO(0.00){[removed - email address senting to];},MIME_TRACE(0.00){0:+;1:+;2:+;3:~;},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_ZERO(0.00){0;},REPLYTO_EQ_FROM(0.00){},TAGGED_FROM(0.00){81;},TO_DN_NONE(0.00){},TO_EQ_FROM(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 1047, time: 12.057ms, dns req: 3, digest: , rcpts: <[removed - email address senting to]>, mime_rcpts: <[removed - email address senting to]>, settings_id: authenticated
Aug 28 17:05:49 emails rspamd[22678]: ; proxy; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 3 regexps matched, 174 regexps total, 44 regexps cached, 0B scanned using pcre, 580B scanned total
Aug 28 17:05:49 emails opendkim[26002]: 89360D9D44: DKIM-Signature field added (s=default, d=[removed - my domain])
Aug 28 17:05:49 emails postfix/qmgr[22325]: 89360D9D44: from=<bounce+81@[removed - my domain]>, size=1341, nrcpt=1 (queue active)

– Below here is where the difference is with this successful port 465 test –

Aug 28 17:05:49 emails postfix/smtpd[26076]: disconnect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:05:49 emails rspamd[22678]: <65f546>; proxy; proxy_milter_finish_handler: finished milter connection
Aug 28 17:05:49 emails dovecot: lmtp(26156): Connect from local
Aug 28 17:05:49 emails dovecot: lmtp([removed - email address senting to]): save: box=INBOX, uid=5785, msgid=281009409502812.1630134349.256407022476196-flectra-private@aits-ub, from=[removed - my name]<[removed - email address senting to]>, subject=12, flags=()
Aug 28 17:05:49 emails dovecot: lmtp([removed - email address senting to]): 6NV2JU3gKWEsZgAAEA1DJQ: sieve: msgid=281009409502812.1630134349.256407022476196-flectra-private@aits-ub: stored mail into mailbox ‘INBOX’
Aug 28 17:05:49 emails postfix/lmtp[26155]: 89360D9D44: to=<[removed - email address senting to]>, relay=emails.[removed - my domain][/var/run/dovecot/lmtp], delay=0.1, delays=0.05/0.01/0.02/0.03, dsn=2.0.0, status=sent (250 2.0.0 <[removed - email address senting to]> 6NV2JU3gKWEsZgAAEA1DJQ Saved)
Aug 28 17:05:49 emails dovecot: lmtp(26156): Disconnect from local: Successful quit
Aug 28 17:05:49 emails postfix/qmgr[22325]: 89360D9D44: removed

– Below - NethServer email log of email send via port 1465 - which is not working –

Aug 28 17:06:09 emails rspamd[22679]: ; lua; bayes_expiry.lua:440: finished expiry step 13: 985 items checked, 356 significant (0 made persistent), 7 insignificant (0 ttls set), 0 common (0 discriminated), 622 infrequent (0 ttls set), 1 mean, 1 std
Aug 28 17:06:56 emails postfix/smtpd[26374]: connect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; proxy_accept_socket: accepted milter connection from /var/run/rspamd/worker-proxy port 0
Aug 28 17:06:56 emails postfix/smtpd[26374]: 47B70D9D44: client=74.8.233.220.static.exetel.com.au[[removed - my IP address]], sasl_method=PLAIN, sasl_username=[removed - email address senting from]
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; milter; rspamd_milter_process_command: got connection from [removed - my IP address]:49402
Aug 28 17:06:56 emails postfix/cleanup[26153]: 47B70D9D44: message-id=812138549935327.1630134415.985342502593994-flectra-private@aits-ub
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_message_parse: loaded message; id: 812138549935327.1630134415.985342502593994-flectra-private@aits-ub; queue-id: <47B70D9D44>; size: 1047; checksum: <51de5f5dec2982d6d33bb70747a0078a>
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; lua; settings.lua:363: 812138549935327.1630134415.985342502593994-flectra-private@aits-ub apply static settings authenticated (id = 1937017268); authenticated matched; priority high
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; dkim_symbol_callback: skip DKIM checks for local networks and authorized users
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; lua; spf.lua:185: skip SPF checks for local networks and authorized users
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; lua; dmarc.lua:596: skip DMARC checks as either SPF or DKIM were not checked
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; lua; once_received.lua:99: Skipping once_received for authenticated user or local network
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; lua_task_insert_result_common: symbol insertion issue: unknown symbol GENERIC_REPUTATION; trace: [1]:{/usr/share/rspamd/plugins/reputation.lua:83 - add_symbol_score [Lua]}; [2]:{/usr/share/rspamd/plugins/reputation.lua:645 - continuation_cb [Lua]}; [3]:{/usr/share/rspamd/plugins/reputation.lua:929 - callback [Lua]}; [4]:{/usr/share/rspamd/lualib/lua_redis.lua:1296 - callback [Lua]}; [5]:{/usr/share/rspamd/lualib/lua_redis.lua:917 - [Lua]};
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_symcache_finalize_item: slow rule: RSPAMD_EMAILBL(280): 310.35 ms; enable slow timer delay
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_SPAM of classifier bayes: not enough learns 38; 200 required
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_redis_connected: skip obtaining bayes tokens for BAYES_HAM of classifier bayes: not enough learns 32; 200 required
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_stat_classifiers_process: skip statistics as SPAM class is missing
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_task_write_log: id: 812138549935327.1630134415.985342502593994-flectra-private@aits-ub, qid: <47B70D9D44>, ip: [removed - my IP address], user: [removed - email address senting from], from: <bounce@[removed - my domain]>, (default: F (no action): [3.30/20.00] [CTYPE_MIXED_BOGUS(1.00){},MIME_BASE64_TEXT_BOGUS(1.00){},MID_RHS_NOT_FQDN(0.50){},R_PARTS_DIFFER(0.50){100.0%;},FORGED_SENDER(0.30){[removed - email address senting to];bounce@[removed - my domain];},MIME_BASE64_TEXT(0.10){},MIME_GOOD(-0.10){multipart/mixed;multipart/alternative;text/plain;},ASN(0.00){asn:10143, ipnet:220.233.8.0/21, country:AU;},FROM_HAS_DN(0.00){},FROM_NEQ_ENVFROM(0.00){[removed - email address senting to];bounce@[removed - my domain];},GENERIC_REPUTATION(0.00){-0.3952000363363;},HAS_REPLYTO(0.00){[removed - email address senting to];},MIME_TRACE(0.00){0:+;1:+;2:+;3:~;},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_ZERO(0.00){0;},REPLYTO_EQ_FROM(0.00){},TAGGED_FROM(0.00){82;},TO_DN_NONE(0.00){},TO_EQ_FROM(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 1047, time: 418.323ms, dns req: 3, digest: <51de5f5dec2982d6d33bb70747a0078a>, rcpts: <[removed - email address senting to]>, mime_rcpts: <[removed - email address senting to]>, settings_id: authenticated
Aug 28 17:06:56 emails rspamd[22678]: <77003f>; proxy; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 3 regexps matched, 174 regexps total, 44 regexps cached, 0B scanned using pcre, 580B scanned total
Aug 28 17:06:56 emails opendkim[26002]: 47B70D9D44: DKIM-Signature field added (s=default, d=[removed - my domain])
Aug 28 17:06:56 emails postfix/qmgr[22325]: 47B70D9D44: from=<bounce+82@[removed - my domain]>, size=1341, nrcpt=1 (queue active)

– Below here is where the difference is with the port 465 test that worked –

Aug 28 17:06:56 emails rspamd[22678]: <9f52b3>; proxy; proxy_milter_finish_handler: finished milter connection
Aug 28 17:06:56 emails postfix/smtpd[26374]: disconnect from 74.8.233.220.static.exetel.com.au[[removed - my IP address]]
Aug 28 17:06:56 emails postfix/pipe[26378]: 47B70D9D44: to=<[removed - email address senting to]>, relay=sendandcopy, delay=0.51, delays=0.44/0.01/0/0.06, dsn=5.3.0, status=bounced (service unavailable. Command output: Message content rejected )
Aug 28 17:06:56 emails postfix/cleanup[26153]: C304EDDA79: message-id=<20210828070656.C304EDDA79@emails.[removed - my domain]>
Aug 28 17:06:56 emails postfix/qmgr[22325]: C304EDDA79: from=<>, size=4666, nrcpt=1 (queue active)
Aug 28 17:06:56 emails postfix/bounce[26383]: 47B70D9D44: sender non-delivery notification: C304EDDA79
Aug 28 17:06:56 emails postfix/qmgr[22325]: 47B70D9D44: removed
Aug 28 17:06:56 emails dovecot: lmtp(26384): Connect from local
Aug 28 17:06:56 emails dovecot: lmtp(bounce@[removed - my domain]): Error: qAUNMZDgKWEQZwAAEA1DJQ: sieve: Execution of script /var/lib/nethserver/sieve-scripts/unknown.sieve failed with unsuccessful implicit keep (user logfile /var/lib/nethserver/sieve-scripts/unknown.sieve.log may reveal additional details)
Aug 28 17:06:56 emails dovecot: lmtp(bounce@[removed - my domain]): msgid=<20210828070656.C304EDDA79@emails.[removed - my domain]>: save failed to open mailbox 82: Mailbox doesn’t exist: 82
Aug 28 17:06:56 emails dovecot: lmtp(bounce@[removed - my domain]): save: box=INBOX, uid=5786, msgid=<20210828070656.C304EDDA79@emails.[removed - my domain]>, from=MAILER-DAEMON@emails.[removed - my domain] (Mail Delivery System), subject=Undelivered Mail Returned to Sender, flags=()
Aug 28 17:06:56 emails dovecot: lmtp(bounce@[removed - my domain]): msgid=<20210828070656.C304EDDA79@emails.[removed - my domain]>: saved mail to INBOX
Aug 28 17:06:56 emails postfix/lmtp[26155]: C304EDDA79: to=<bounce+82@[removed - my domain]>, relay=emails.[removed - my domain][/var/run/dovecot/lmtp], delay=0.05, delays=0.01/0/0.02/0.03, dsn=2.0.0, status=sent (250 2.0.0 <bounce+82@[removed - my domain]> qAUNMZDgKWEQZwAAEA1DJQ Saved)
Aug 28 17:06:56 emails dovecot: lmtp(26384): Disconnect from local: Successful quit
Aug 28 17:06:56 emails postfix/qmgr[22325]: C304EDDA79: removed

Following on from the above issue -

I receive the NethServer administrator receives an error message “Undelivered Mail Returned to Sender”
Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; Message content rejected

Looking at the email header from Flectra to see the difference with an email that works I see this difference -

Content-Type: multipart/mixed; boundary="===============2547424826581957680=="
MIME-Version: 1.0

Note - these emails work when sent to port 465 or 587 but error on 1465, 1587, 2465 and 2587

Does anyone familiar with this code see where the issue is?

I really enjoy this community. I was crawling the internet searching for the very same question and then searched on this forum and BAM → found it.

That said, @saitobenkei I remember that Fastmail.fm had an option to put the mails sent by a dumb client through their SMTP server in your Sent Items without having to configure anything.

In other words, they handled the dumb vs smart client thing transparently, no need to configure alternate ports.

I wonder how they did that.