Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: jufra on April 12, 2011, 07:29:32 AM
-
Hi all,
I have a specific issue with sending email. I am using an SME server as a datalogging server, ie, it receives data from a number of data loggers via udp, and also can receive a basic email from the dataloggers. The problem is that the IP card of the dataloggers is very basic and just sends email without date header. I found out how to make SME accept the email regardless of the missing date header here: http://bugs.contribs.org/show_bug.cgi?id=492
(http://bugs.contribs.org/show_bug.cgi?id=492) and it receives it now. But (and here is my question) since the SME server will be integrated into a commercial network, I need to be able to forward the email that is now stored on the SME box to another address in the network. I used the forwarding in the server manager panel to forward the email, but again it forwards it without the date header (I had hoped that SME would add the header when forwarding, but it doesn't). So my question is how can I forward these emails so that they contain the header and are seen as "nice and well-behaved" emails in the outside network? :)
I've been using SME for a few years now, I sort of find my way around things, but far from being an expert, hence my question, which I hope is not too stupid
Any help is much appreciated
Cheers
Frank
-
It's just an idea, I have not tried this, but you could use the mailsorting contrib from dungog http://www.dungog.net/wiki/Smeserver-mailsorting (http://www.dungog.net/wiki/Smeserver-mailsorting) and create some procmail rules.
I have an SME server setup in a school to retrieve all the admin emails from their SUSE based server, and use the procmail to send the rejeceted emails on to the correct users back to the SUSE server, as there are a lot of emails from mailing lists people are on that get rejected by the SUSE and thus end up in the admin mail box. I use the SME to sort based on recipient, subject or 'email headers' and forward on to the respective users mail boxes. It seems to work quite well for what I want.
Alternately, set up your email client to get the mail as a pop3 account in addition to your main email - if you're inside your corporate network, this could be OK. If your corporate email server can retrieve email from a POP3 server, you may be able to get it to retrieve from your SME. MS Exchange can do this, and forward all mail to a specific user mailbox.
I guess the other possibility is to use the email delegation feature of SME to send the email upstream, but this may not work if email is passed without the date headers.
-
Thanks for this, well the question is whether the mailsorting will take care of the header? I will see if I can get it to work...
The pop3 idea, yes, that's a workaround, but not really practical
And the internal forwarding, it doesn't work since it just forwards w/o any headers, and the target email server rejects it for the same reason my SME server did (before I disabled the header check)
Will try mailsorting though, thanks again
Frank
-
Once you have mailsorting / procmail installed, you'll need to create a rule something like:
# Get the date
DATE_=`/bin/date -R`
:0
* ^From:.*SenderWithBrokenDate
{
:0 fhwi
| formail -I"Date: ${DATE_}"
:0:
${DEFAULT}
}
References:
http://www.cs.kent.edu/~yhijazi/MyWebs/useful_example.htm (search for "Date")
man date
-R, --rfc-2822: output RFC-2822 compliant date string
man formail
-I headerfield: Same as -i, except that any existing similar fields are simply
removed. If headerfield consists only of a field-name, it effec-
tively deletes the field.
(Note: I haven't created a working procmail rule since the '90s -- the above info is meant as a hint only!)